/* ============================================================
   云卡商城 · 样式模块 06/11 —— 06-data.css
   ------------------------------------------------------------
   职责：数据呈现：统计卡、表格、分页、空状态/骨架屏、弹层与提示、页脚
   涵盖：§15 §16 §17 §18 §19 §20

   ⚠️ 加载顺序即层叠顺序，请勿调整 <link> 的先后。
      本文件由 style.css 按分节边界切出，规则未做任何重排。
   ============================================================ */

/* ============================================================
   15 · 数据统计
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.stat {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.stat .k { color: var(--text-3); font-size: var(--fs-xs); }
.stat .v {
  margin-top: var(--sp-1);
  color: var(--text);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}
.stat .v.grad { color: var(--text); }
.stat .d { margin-top: var(--sp-1); color: var(--text-3); font-size: var(--fs-2xs); }

/* 首页信息条：公开信息（商品数 / 服务时间 / 支付方式 / 渠道），
   不含订单量、库存量等经营数据 */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.trust-bar .tp {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.trust-bar .tp .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.trust-bar .tp .t { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semi); }
.trust-bar .tp .s {
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trust-bar .tp > div:last-child { min-width: 0; }

/* ============================================================
   16 · 表格
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.table-wrap.flush { border: 0; border-radius: 0; background: transparent; }
table.tbl { width: 100%; min-width: 640px; font-size: var(--fs-sm); }
table.tbl th {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  text-align: left;
  white-space: nowrap;
}
table.tbl td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background var(--tr); }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl .ops { display: flex; flex-wrap: wrap; gap: var(--sp-1h); }
table.tbl .strong { color: var(--text); font-weight: var(--fw-semi); }

/* ============================================================
   17 · 分页
   ============================================================ */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1h);
  padding: var(--sp-5) 0 var(--sp-1);
}
.pager button {
  min-width: 34px;
  height: 34px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.pager button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: var(--text-on); }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pager .dim { font-size: var(--fs-sm); }

/* ============================================================
   18 · 空状态 / 骨架屏 / 加载
   ============================================================ */
.empty { padding: var(--sp-12) var(--sp-5); color: var(--text-3); text-align: center; }
.empty .ico { margin-bottom: var(--sp-3); font-size: var(--ico-lg); line-height: 1; }
.empty .t { color: var(--text-2); font-size: var(--fs-md); font-weight: var(--fw-semi); }
.empty .s { margin-top: var(--sp-1h); font-size: var(--fs-sm); }

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
}
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   19 · 弹层 / 提示
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: var(--overlay);
  backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
}
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 380px; }
.modal-head {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: var(--fs-md); }
.modal .x {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}
.modal .x:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: var(--sp-5); }
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.modal-hero {
  display: grid;
  place-items: center;
  height: 150px;
  overflow: hidden;
  background: var(--brand);
  font-size: var(--ico-lg);
}
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }

#toast-host {
  position: fixed;
  top: var(--sp-5);
  left: 50%;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  width: max-content;
  max-width: 90vw;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-3);
  box-shadow: var(--sh-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.toast .ico { flex: none; font-weight: var(--fw-black); }
.toast.ok { border-color: var(--ok); }
.toast.ok .ico { color: var(--ok-fg); }
.toast.err { border-color: var(--danger); }
.toast.err .ico { color: var(--danger-fg); }
.toast.warn { border-color: var(--warn); }
.toast.warn .ico { color: var(--warn-fg); }
.toast.info .ico { color: var(--info-fg); }

/* ============================================================
   20 · 页脚
   ============================================================ */
.site-footer {
  margin-top: var(--sp-12);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.site-footer .cols {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr);
  gap: var(--sp-8);
  padding: var(--sp-10) 0 var(--sp-8);
}
.site-footer h4 {
  margin-bottom: var(--sp-4);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  letter-spacing: .3px;
}
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a,
.site-footer p { color: var(--text-3); font-size: var(--fs-sm); }
.site-footer a { transition: color var(--tr); }
.site-footer a:hover { color: var(--brand-fg); }
.site-footer .bottom {
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: var(--lh-relaxed);
  text-align: center;
}

/* 页脚支付品牌：固定网格，保留品牌色，展示项不模拟按钮交互。 */
.pay-strip { padding: 28px 0; margin-top: 32px; border-top: 1px solid var(--line); }
.pay-strip-cap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.site-footer .pay-strip-cap h4 { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.5; }
.site-footer .pay-strip-cap p { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.site-footer .pay-strip-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.site-footer .pay-item { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 58px; padding: 12px 8px; margin: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.pay-mark { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 28px; }
.pay-mark .brand-svg, .pay-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pay-item[data-payment="mpay"] .pay-mark { width: 32px; height: 32px; flex-basis: 32px; }
.pay-item[data-payment="mpay"] img { border-radius: 7px; }
.pay-item[data-payment="tng"] .pay-mark { width: 38px; height: 36px; flex-basis: 38px; }
.pay-item[data-payment="mastercard"] .pay-mark { width: 50px; height: 32px; flex-basis: 50px; }
.pay-item[data-payment="visa"] .pay-mark { width: 66px; height: 28px; flex-basis: 66px; }
.pay-item[data-payment="visa"] .pay-name, .pay-item[data-payment="mastercard"] .pay-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-footer .pay-item[data-payment="visa"], .site-footer .pay-item[data-payment="mastercard"] { justify-content: center; }
.pay-name { color: var(--text-2); font-size: 12px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
[data-theme="dark"] .site-footer .pay-item { background: #fff; border-color: #fff; }
[data-theme="dark"] .pay-name { color: #475569; }
@media (max-width: 1100px) { .site-footer .pay-strip-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 440px) {
  .pay-strip { padding: 24px 0; }
  .pay-strip-cap { display: block; }
  .site-footer .pay-strip-cap p { margin-top: 5px; }
  .site-footer .pay-strip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .site-footer .pay-item { justify-content: flex-start; padding: 10px 14px; min-height: 54px; }
}

/* 页签上的计数角标（商品管理的「上架中 12」） */
.tab-n {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-3);
  font-size: var(--fs-2xs);
  line-height: 1.7;
}
.tab.on .tab-n { background: var(--brand-bg); color: var(--brand-fg); }

/* 弹窗长内容只滚动正文，操作区保持可见。 */
.modal { display: flex; flex-direction: column; overflow: hidden; max-height: min(88vh, calc(100dvh - var(--sp-10))); }
.modal-head, .modal-foot { flex: none; padding-inline: var(--sp-6); }
.modal-head h3 { min-width: 0; overflow-wrap: anywhere; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-6); }
.modal .x { width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--r-sm); }
.empty .ico { display: flex; align-items: center; justify-content: center; }
.empty .s { margin-top: var(--sp-2); line-height: var(--lh-normal); }
.toast { line-height: var(--lh-normal); overflow-wrap: anywhere; }
.table-wrap { overscroll-behavior-x: contain; }

/* Promotional placeholder uses the same brand language as the shop UI. */
.modal-hero:not(:has(img)) { height: 112px; background: var(--brand-bg); color: var(--brand-fg); border-bottom: 1px solid var(--brand-line); }
.modal-hero > .ui-icon { width: var(--sp-10); height: var(--sp-10); }
.popup-copy { padding: var(--sp-5) 0 var(--sp-1); }

/* 首页公告：小幅品牌标识、可编辑正文与始终可见的操作区。 */
.overlay.site-popup-overlay { padding: 16px; }
.modal.site-popup { max-width: 420px; max-height: min(560px, calc(100dvh - 48px)); border-radius: 20px; }
.site-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 10px 12px 10px 22px; background: var(--brand-bg); border-bottom: 1px solid var(--brand-line); }
.site-popup-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--brand-fg); font-size: 13px; font-weight: 600; }
.site-popup-brand > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.site-popup-mark { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--brand-line); border-radius: 10px; background: var(--surface); }
.site-popup-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; }
.site-popup-close:hover { background: var(--surface); color: var(--brand-fg); }
.site-popup .site-popup-body { padding: 22px; }
.site-popup-title { margin: 0 0 12px; color: var(--text); font-size: 23px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.site-popup-title > .ui-icon { width: 24px; height: 24px; color: var(--brand-fg); vertical-align: -3px; }
.site-popup-content { color: var(--text-2); font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.site-popup-content strong { color: var(--brand-fg); font-weight: 650; }
.site-popup-image { display: flex; justify-content: center; margin-bottom: 18px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.site-popup-image img { display: block; width: 100%; height: auto; max-height: 128px; object-fit: contain; }
.site-popup .modal-foot { padding: 16px 22px 20px; background: var(--surface); }
.site-popup .modal-foot .btn { min-height: 44px; height: auto; padding: 11px 14px; line-height: 1.4; border-radius: 10px; white-space: normal; overflow-wrap: anywhere; }
.site-popup-dismiss { flex: 1; }
.site-popup-action { flex: 2; }
.site-popup-close:focus-visible, .site-popup .btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-width: 480px) {
  .site-popup-head { padding-left: 18px; }
  .site-popup .site-popup-body { padding: 18px; }
  .site-popup-title { font-size: 21px; }
  .site-popup .modal-foot { padding: 14px 18px 18px; }
}
.toast > .ico { display: flex; align-items: center; padding-top: var(--sp-1); }

/* Data cards emphasize numbers; service cards remain compact factual summaries. */
.stat { padding: var(--sp-5); border-radius: var(--r-lg); }
.stat .k { color: var(--text-2); font-size: var(--fs-sm); }
.stat .v { margin-top: var(--sp-3); line-height: var(--lh-tight); }
.stat .d { margin-top: var(--sp-2); font-size: var(--fs-xs); }
.trust-bar .tp { padding: var(--sp-5) var(--sp-4); border-radius: var(--r-lg); align-items: flex-start; }
.trust-bar .tp .s { margin-top: var(--sp-1); white-space: normal; overflow-wrap: anywhere; }
