/* =============================================================================
   月子中心 · PC 管理端 统一组件库 (common.css)
   -----------------------------------------------------------------------------
   与 H5 端 merged-h5/common.css 提供同名 API（showToast/showEmpty/showLoading/
   showConfirm/Pagination/renderXxxChart/DateRangePicker），但为 PC 桌面主题。
   组件 DOM 统一使用 yy- 前缀，避免与子页内联 .empty/.btn/.table 等冲突。

   PC 主题变量（与子页 :root 保持一致；子页若自行定义则覆盖本文件）：
   --pink #F3A9B8 / --pink-dark #E0728C / --pink-light #FCEAF0
   --text #1F2330 / --text-2 #5B6072 / --text-3 #9AA0B0
   --border #ECECF1 / --page-bg #F6F7FB
   ============================================================================= */

:root{
  --pink: #F3A9B8;
  --pink-dark: #E0728C;
  --pink-light: #FCEAF0;
  --text: #1F2330;
  --text-2: #5B6072;
  --text-3: #9AA0B0;
  --border: #ECECF1;
  --page-bg: #F6F7FB;
  --rose: #E0728C;            /* 危险/确认按钮主色（红色系） */
  --shadow-soft: 0 10px 30px rgba(31,35,48,.08);
}

* { box-sizing: border-box; }

/* -----------------------------------------------------------------------------
   骨架屏（多形状）
   用法：<div class="skeleton sk-line"></div> / .sk-card / .sk-avatar / .sk-img
   --------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #e3e6ec 37%, #eef0f4 63%);
  background-size: 400% 100%;
  border-radius: 8px;
  animation: skeleton-loading 1.4s ease infinite;
}
.sk-line   { height: 14px; margin: 8px 0; }
.sk-line.short { width: 45%; }
.sk-line.mid   { width: 70%; }
.sk-card   { height: 96px; border-radius: 14px; margin: 10px 0; }
.sk-avatar { width: 52px; height: 52px; border-radius: 50%; flex: 0 0 52px; }
.sk-img    { width: 100%; height: 180px; border-radius: 12px; }
.sk-grp    { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.sk-grp .sk-body { flex: 1; }
.sk-grp .sk-line:first-child { margin-top: 0; }
.sk-grp .sk-line:last-child  { margin-bottom: 0; }
.sk-table { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.sk-table .sk-row { height: 44px; border-radius: 10px; }
@keyframes skeleton-loading { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* -----------------------------------------------------------------------------
   空状态（注入式 .yy-empty，区别于子页自带 .empty）
   用法：showEmpty(containerId, icon, text, actionText, actionCallback)
   --------------------------------------------------------------------------- */
.yy-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px; color: var(--text-3); text-align: center;
}
.yy-empty-icon { font-size: 44px; margin-bottom: 12px; opacity: .7; }
.yy-empty-text { font-size: 14px; color: var(--text-2); }
.empty-action {
  margin-top: 16px; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 20px; border-radius: 20px; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600;
  background: var(--pink); color: #fff; box-shadow: 0 6px 16px rgba(224,114,140,.25);
  transition: transform .08s ease, opacity .2s ease;
}
.empty-action:hover { background: var(--pink-dark); }
.empty-action:active { transform: scale(.97); }

/* -----------------------------------------------------------------------------
   Toast 轻提示（增强：success/error/warning/info + 图标）
   --------------------------------------------------------------------------- */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(31,35,48,.9); color: #fff; font-size: 14px;
  padding: 11px 20px; border-radius: 12px;
  z-index: 9999; pointer-events: none; max-width: 80%; text-align: center;
  opacity: 0; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }
.toast.toast-top { top: 80px; }
.toast.toast-error   { background: rgba(231,76,60,.95); }
.toast.toast-success { background: rgba(46,160,90,.95); }
.toast.toast-warning { background: rgba(243,156,18,.96); }
.toast.toast-info    { background: rgba(74,144,226,.96); }
.toast .t-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; font-weight: 700; }

/* -----------------------------------------------------------------------------
   全屏 Loading 遮罩（showLoading / hideLoading）
   --------------------------------------------------------------------------- */
.yy-loading-mask {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: rgba(246,247,251,.6); backdrop-filter: blur(2px);
}
.yy-loading-mask.open { display: flex; }
.yy-loading-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(224,114,140,.18); border-top-color: var(--pink-dark);
  animation: yy-spin .8s linear infinite;
}
.yy-loading-text { font-size: 14px; color: var(--text); font-weight: 600; }
@keyframes yy-spin { to { transform: rotate(360deg); } }

/* 按钮内联 loading（按钮提交态） */
.btn-loading { position: relative; pointer-events: none; color: transparent !important; }
.btn-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255,255,255,.55); border-top-color: #fff;
  border-radius: 50%; animation: yy-spin .7s linear infinite;
}

/* -----------------------------------------------------------------------------
   确认弹窗（showConfirm）· 居中，确认红色，取消灰色
   --------------------------------------------------------------------------- */
.yy-confirm-mask {
  position: fixed; inset: 0; z-index: 9500;
  display: none; align-items: center; justify-content: center; background: rgba(15,18,26,.45);
}
.yy-confirm-mask.open { display: flex; }
.yy-confirm {
  width: 420px; max-width: 90vw;
  background: #fff; border-radius: 16px; padding: 24px 24px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); animation: modalIn .22s ease; text-align: center;
}
.yy-confirm-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.yy-confirm-content { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 22px; text-align: left; }
.yy-confirm-btns { display: flex; gap: 12px; }
.yy-confirm-btns button {
  flex: 1; padding: 11px 0; border-radius: 10px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; transition: transform .08s ease, opacity .2s ease;
}
.yy-confirm-btns button:active { transform: scale(.98); opacity: .92; }
.yy-confirm-cancel { background: #F1F1F4; color: #555; }
.yy-confirm-ok     { background: #E74C3C; color: #fff; box-shadow: 0 8px 18px rgba(231,76,60,.28); }
@keyframes modalIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* -----------------------------------------------------------------------------
   分页器（Pagination）· 含每页条数选择
   --------------------------------------------------------------------------- */
.yy-pg {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 6px; padding: 14px 4px; font-size: 13px; color: var(--text-2);
}
.yy-pg button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; font-size: 13px; transition: all .15s ease;
}
.yy-pg button:hover:not(:disabled) { border-color: var(--pink-dark); color: var(--pink-dark); }
.yy-pg button.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.yy-pg button:disabled { opacity: .4; cursor: not-allowed; }
.yy-pg .yy-pg-info { margin: 0 4px; }
.yy-pg .yy-pg-jump { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.yy-pg .yy-pg-jump input {
  width: 48px; height: 30px; border: 1px solid var(--border); border-radius: 8px;
  text-align: center; font-size: 13px;
}
.yy-pg .yy-pg-size { margin-left: 8px; }
.yy-pg .yy-pg-size select {
  height: 30px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 6px; font-size: 13px; color: var(--text-2); background: #fff;
}

/* -----------------------------------------------------------------------------
   日期范围选择器（DateRangePicker）
   --------------------------------------------------------------------------- */
.yy-drp-panel {
  position: absolute; z-index: 9600; display: none;
  width: 280px; padding: 16px; background: #fff; border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18); animation: modalIn .18s ease;
}
.yy-drp-panel.open { display: block; }
.yy-drp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.yy-drp-row label { width: 32px; font-size: 13px; color: var(--text-2); }
.yy-drp-row input[type=date] {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; color: var(--text);
}
.yy-drp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.yy-drp-presets button {
  padding: 6px 10px; font-size: 12px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--pink-light); background: var(--pink-light); color: var(--pink-dark);
}
.yy-drp-presets button:hover { background: var(--pink); color: #fff; }
.yy-drp-btns { display: flex; gap: 8px; justify-content: flex-end; }
.yy-drp-btns button {
  padding: 8px 16px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.yy-drp-clear { background: #F1F1F4; color: #555; }
.yy-drp-ok { background: var(--pink); color: #fff; }
.yy-drp-ok:hover { background: var(--pink-dark); }

/* -----------------------------------------------------------------------------
   图表容器统一（renderXxxChart 兜底占位）
   --------------------------------------------------------------------------- */
.yy-chart-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 220px; color: var(--text-3); font-size: 13px;
  background: var(--pink-light); border-radius: 14px;
}
