/* ==========================================================================
   SEA Ledger — shared design system (app.css)
   Used by: store.html · bills.html · withdrawals.html · ads.html · account.html ·
            imports.html · 404.html（首页 index.html 自带一份内嵌样式，改这里记得同步）
   ========================================================================== */

:root {
  --bg: #f9f8f5;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e7e4de;
  --line-soft: #f1efea;
  /* 输入框专用边框。--line(#e7e4de) 对白底只有约 1.16:1 —— 用在卡片/表格上没问题
     （那是装饰性分隔），但输入框是**可操作控件**，WCAG 1.4.11 要求边界 ≥3:1，
     否则用户看不出哪里能打字。#8a908a 对白底 3.26:1、对暖白底 3.15:1。
     ★ 只给输入框用，不要拿它当通用描边——全站描边一压深，整体观感会立刻变硬。 */
  --line-input: #8a908a;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --teal: #059669;
  --teal-dark: #047857;
  --green: #059669;
  --orange: #eb6834;
  --brown: #4a3aa7;              /* 棕色槽位改紫：与橙无法区分，已淘汰 */
  --yellow: #eda100;
  --blue: #2a78d6;
  --red: #e34948;
  --neg: #dc2626;
  --pos: #16a34a;
  --track: #f1efea;
  --shadow: 0 0 0 1px rgba(15,23,42,.10), 0 1px 1px rgba(15,23,42,.14), 0 2px 3px rgba(15,23,42,.13), 0 4px 6px rgba(15,23,42,.12), 0 8px 12px rgba(15,23,42,.11);
  --shadow-hover: 0 0 0 1px rgba(15,23,42,.12), 0 1px 2px rgba(15,23,42,.16), 0 3px 5px rgba(15,23,42,.16), 0 7px 12px rgba(15,23,42,.16), 0 14px 22px rgba(15,23,42,.14);
  --shadow-sm: 0 0 0 1px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.10), 0 3px 6px rgba(15,23,42,.08);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
}

/* 渐变背景改成 fixed 定位的伪元素。
   原来用 background-attachment: fixed —— iOS Safari 对它的支持一直有问题：
   滚动时反复重绘、偶发闪烁掉帧。固定定位的伪元素效果一样但没有这些坑。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #fdfdfb 0%, #f9f8f5 55%, #f6f4f0 100%);
}

.app-shell { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* ---------- Topbar / breadcrumb ---------- */
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 52px;
  border-bottom: 1px solid #e7e4de;
  background: rgba(255, 255, 255, .6);
}
.topbar-title { font-size: 22px; font-weight: 700; line-height: 1; }
/* 顶栏左上角：品牌标（与浏览器标签页图标同一枚）+「首页」。
   ★ 这段原来只写在 index.html 的内联样式里，而 11 个 wiki 页也用了 .topbar-logo
     —— 它们不引 index.html 的样式，于是整块渲染成无样式的裸 img + 文字。补进这里统一。 */
.topbar-logo {
  display: flex; align-items: center; gap: 11px; flex: none;
  font-size: 22px; font-weight: 700; line-height: 1;
  color: var(--text); text-decoration: none;
}
.topbar-logo img { width: 30px; height: 30px; display: block; flex: none; }
a.topbar-logo:hover { color: var(--teal); }
.topbar-divider { width: 1px; height: 28px; background: #e7e4de; }
.crumbs { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; line-height: 1; }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.crumbs a:hover { color: var(--teal); }
.crumb-sep { color: #94a3b8; font-weight: 400; }
.crumb-cur { color: var(--text); }

/* ---------- 顶栏知识入口（公司 Wiki / 新人文档）----------
   ★ 唯一来源。在线 wiki.html / handbook.html 直接使用这里的样式；旧 wiki-*.html
     虽仍保留作部署兼容，但服务端会在静态目录前重定向，不再展示其静态内容。
     只有 index.html 因为是自包含页面（不引 app.css）仍留一份内联副本，改这里记得同步它。
   图标用 inline SVG 描边而不是 emoji：emoji 在不同系统上长相不一，而且原来移动端
   `.topnav-link span{display:none}` 会把整个 emoji 连同文字一起隐掉。 */
.topnav { display: flex; gap: 8px; margin-left: 10px; }
.topnav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--teal-dark); text-decoration: none; border: 1px solid rgba(5,150,105,.22);
  background: linear-gradient(135deg, rgba(5,150,105,.10), rgba(5,150,105,.03));
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.topnav-link svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.topnav-link:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(5,150,105,.16); transform: translateY(-1px); }
.topnav-link:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.20); }
/* 当前页高亮。★ 挂 aria-current 而不是自定义 .on 类：屏幕阅读器也要知道"你在这一页"。
   原来只写了 `.topnav-link.on` 的样式却从没有元素用它，两个入口永远都是未选中态。 */
.topnav-link[aria-current="page"] {
  background: var(--teal); color: #fff; border-color: var(--teal);
}
.topnav-link[aria-current="page"]:hover { border-color: var(--teal-dark); }
@media (max-width: 820px) {
  .topnav { margin-left: 6px; gap: 6px; }
  /* C20 触控下限 44px。原来是 padding:6px 10px + font-size:12px → 实测约 28px。
     窄屏只留图标（文字收进 .tn-t），但可点区域反而要更大。 */
  .topnav-link { min-height: 44px; min-width: 44px; justify-content: center; padding: 0 12px; font-size: 12.5px; }
  .topnav-link .tn-t { display: none; }
}

/* ---------- Page frame ---------- */
/* 全站唯一的主区留白基准。26px/45px 是方向A 之前的旧值，与首页/账单/提款
   各自写的 24px/32px 对不上，切页面时内容左右会跳 13px —— 统一到设计稿的
   24px 32px 20px，各页不要再写自己的一份。
   max-width 也只留这一个值：产品库 1480 / 店铺信息 1540 配合 margin:0 auto
   会在宽屏上凭空多出左边距，同样统一成 1600。 */
.page { padding: 24px 32px 20px; max-width: 1600px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-title { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: .2px; }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.page-sub .dot { color: #cfccc6; }
.page-sub .sep { width: 1px; height: 13px; background: #e7e4de; display: inline-block; }
.page-actions { display: flex; align-items: center; gap: 12px; flex: none; }

/* ---------- Panels ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0; /* 作为 grid/flex 子项时默认 min-width:auto 会被内部宽表格/长文本撑爆容器，清零即可 */
}
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; }
.panel-sub { margin: 4px 0 16px; color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 18px; }

/* ---------- Summary cards: bordered-left variant ---------- */
.cards { display: grid; gap: 18px; margin-bottom: 18px; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }

.sum-card {
  position: relative;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 16px 20px 17px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0; /* grid 子项默认 min-width:auto，长金额/"对比基准"等 nowrap 文案会把卡片撑宽出容器 */
}
.sum-card .sc-label, .sum-card .sc-aside { white-space: normal; } /* 极窄屏下允许换行，配合 min-width:0 彻底避免溢出 */
.sum-card.orange { border-left-color: var(--orange); }
.sum-card .sc-main { min-width: 0; }
.sum-card .sc-label { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.sum-card .sc-value { font-size: 23px; font-weight: 800; line-height: 1; white-space: nowrap; }
.sum-card .sc-value.teal { color: var(--teal); }
.sum-card .sc-aside { color: var(--muted-2); font-size: 13px; white-space: nowrap; align-self: flex-end; }

/* ---------- Summary cards: icon variant ---------- */
.icon-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  min-width: 0; /* 同 .sum-card：作为 .cards 网格子项时防止内部宽文本把卡片撑出容器 */
}
.icon-card > div { min-width: 0; }
.ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.ic svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.solid { color: #fff; box-shadow: 0 1px 1.5px rgba(15,23,42,.16), 0 3px 7px rgba(15,23,42,.13), 0 8px 18px rgba(15,23,42,.10); }
.ic.solid.teal   { background: linear-gradient(160deg, #0cab77, #04835d); }
.ic.solid.orange { background: linear-gradient(160deg, #f07a48, #dd5a24); }
.ic.solid.red    { background: linear-gradient(160deg, #ea5e5d, #d93b3a); }
.ic.solid.green  { background: linear-gradient(160deg, #22b356, #12903f); }
.ic.soft.green   { background: rgba(22,163,74,.12); color: #16a34a; }
.ic.soft.orange  { background: rgba(235,104,52,.12); color: #eb6834; }
.ic.soft.blue    { background: rgba(42,120,214,.12); color: #2a78d6; }
.icon-card .card-label { color: var(--muted); font-size: 14px; margin: 0 0 7px; }
/* 金额字号 24px 封顶；位数多时由 guard.js 的 fitAmounts() 自动缩到放得下为止 */
.icon-card .card-value { font-size: 24px; font-weight: 800; line-height: 1; white-space: nowrap; }

/* ---------- Horizontal bar chart ---------- */
.hbars { display: grid; gap: 15px; }
.hbar-row {
  display: grid;
  grid-template-columns: var(--hbar-label, 82px) 1fr var(--hbar-val, 168px);
  align-items: center;
  column-gap: 16px;
}
.hbar-label { font-size: 14px; color: var(--text); white-space: nowrap; }
.bar-track { height: 11px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; min-width: 3px; transition: width .5s ease; }
.bar-fill.teal   { background: #059669; }
.bar-fill.orange { background: #eb6834; }
.bar-fill.brown  { background: #4a3aa7; }
.bar-fill.green  { background: #16a34a; }
.bar-fill.yellow { background: #eda100; }
.bar-fill.blue   { background: #2a78d6; }
.bar-fill.red    { background: #e34948; }
.hbar-value { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.hbar-value b { color: var(--text); font-weight: 600; }

/* legend-style rows (dot + label + bar + value + count) */
.legend-rows { display: grid; gap: 13px; }
.legend-row {
  display: grid;
  grid-template-columns: 150px 1fr 132px 44px;
  align-items: center;
  column-gap: 14px;
}
.legend-name { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend-amt { text-align: right; font-size: 14px; font-weight: 600; white-space: nowrap; }
.legend-cnt { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Vertical bars (支出环比) ---------- */
.vbars { display: flex; align-items: flex-end; justify-content: center; gap: 42px; flex: 1; min-height: 128px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.vbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.vbar-val { font-size: 14px; font-weight: 700; margin-bottom: 8px; white-space: nowrap; }
.vbar-fill { width: 74px; border-radius: 8px 8px 0 0; border: 1px solid; }
.vbar-fill.teal { background: rgba(5,150,105,.16); border-color: rgba(5,150,105,.42); }
.vbar-fill.orange { background: rgba(235,104,52,.16); border-color: rgba(235,104,52,.5); }
.vbar-x { display: flex; justify-content: center; gap: 42px; margin-top: 9px; }
.vbar-x span { width: 74px; text-align: center; font-size: 13px; color: var(--muted); }

.compare-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9f8f5;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.compare-box .cb-label { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.compare-box .cb-value { font-size: 24px; font-weight: 800; color: var(--teal); line-height: 1; margin: 0 0 10px; }
.compare-box .cb-note { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- Donut ---------- */
.donut-wrap { display: grid; grid-template-columns: 168px 1fr; gap: 22px; align-items: center; }
.donut { position: relative; width: 168px; height: 168px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center .dc-label { color: var(--muted); font-size: 11.5px; }
.donut-center .dc-value { font-size: 13.5px; font-weight: 800; margin-top: 2px; }

/* ---------- Data tables ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.data-table thead { background: #f9f8f5; }
.data-table th {
  padding: 11px 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1efea;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: rgba(5,150,105,.05); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .center { text-align: center; }
.data-table .neg { color: var(--neg); font-weight: 600; }
.data-table .pos { color: var(--pos); font-weight: 600; }
.data-table .mut { color: #94a3b8; }
.data-table .strong { font-weight: 700; }
.data-table tr.total-row td { background: #f9f8f5; border-top: 1.5px solid #e7e4de; border-bottom: none; font-weight: 700; }
.data-table .wrap { white-space: normal; }

.ok-tag { color: #16a34a; font-weight: 600; }

/* ---------- Buttons / links / dropdowns ---------- */
.btn {
  height: 40px;   /* 与 .date-picker / .btn-ghost 同高：页头三个控件并排时底部要齐 */
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7e4de;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(15,23,42,.03), 0 1px 2px rgba(15,23,42,.05), 0 3px 8px rgba(15,23,42,.045);
  transition: transform .13s ease, border-color .15s ease, box-shadow .16s ease;
}
.btn:hover { border-color: #059669; transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(15,23,42,.04), 0 2px 4px rgba(15,23,42,.06), 0 8px 18px rgba(15,23,42,.07); }
.btn:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(15,23,42,.1); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.18); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ★ 唯一来源。2026-07-25 之前这段被复制在 store/withdrawals/ads/bills/imports 五个页面的
   内联 <style> 里，app.css 只有一条移动端 min-height 补丁——新页面漏抄就会退化成
   浏览器默认按钮，且不会有任何报错。加新页面时直接用这个类，不要再内联。 */
.btn-ghost {
  height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.18); }
.btn-ghost:disabled { opacity: .6; cursor: default; }

.dropdown { position: relative; }
.date-picker {
  height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e7e4de;
  border-radius: 9px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(15,23,42,.03), 0 1px 2px rgba(15,23,42,.05), 0 3px 8px rgba(15,23,42,.045);
  transition: transform .13s ease, border-color .15s ease, box-shadow .16s ease;
}
.date-picker:hover { border-color: #059669; transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(15,23,42,.04), 0 2px 4px rgba(15,23,42,.06), 0 8px 18px rgba(15,23,42,.07); }
.date-picker:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(15,23,42,.1); }
.date-picker:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.18); }
.date-picker .cal { width: 16px; height: 16px; stroke: #64748b; fill: none; stroke-width: 2; flex: none; }
.chev { width: 11px; height: 11px; border-right: 1.8px solid #94a3b8; border-bottom: 1.8px solid #94a3b8; transform: rotate(45deg) translateY(-2px); }

.menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15,23,42,.04), 0 2px 6px rgba(15,23,42,.06), 0 18px 40px rgba(15,23,42,.13);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
}
.menu.open { display: block; }
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: 0; border-radius: 6px;
  background: transparent; color: #0f172a; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.menu-item:hover { background: rgba(5,150,105,.08); }
.menu-item.selected { background: rgba(5,150,105,.13); font-weight: 700; }

.link { color: #059669; cursor: pointer; text-decoration: none; font-weight: 600; }
.link:hover { color: #047857; text-decoration: underline; }
.view-all { color: #047857; text-decoration: none; font-size: 14px; cursor: pointer; }
.view-all:hover { color: #059669; }

/* ---------- Footer + toast ---------- */
.footer { margin-top: 22px; color: #64748b; font-size: 13px; text-align: center; }
/* 备案号：工信部要求必须链接至 beian.miit.gov.cn。保持低调，但要可点、对比度达标。
   ★ 这里犯过两次同一个错，第三次改的时候请先算：
     · 最早 #b9b6b0 对底色约 2.2:1；
     · 后来改成 var(--muted-2)（#94a3b8）并在注释里写"达标"——实测对 --bg(#f9f8f5) 只有 2.41:1，
       其实还是不达标，只是没人再量过。
     · 现在 #616f86 对 --bg 4.79:1、对白底 5.09:1，字号 11.5 → 12px（11.5px 的正文本来就偏小）。 */
.beian { color: #616f86; font-size: 12px; text-decoration: none; }
.beian:hover { color: var(--teal); text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: calc(34px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  z-index: 90; max-width: 84vw; padding: 11px 20px; border-radius: 999px;
  background: rgba(15,23,42,.94); color: #f9f8f5; font-size: 14px;
  box-shadow: 0 14px 30px rgba(15,23,42,.28);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Grid helpers ---------- */
/* 两栏面板等高：原来是 align-items:start，左右内容量不同就会下缘参差、显得比例散。
   改 stretch 后两块等高，内部再把内容居中分布，边缘齐整。 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.two-col > .panel { display: flex; flex-direction: column; }
/* 条形列表在被拉高的面板里纵向居中，而不是顶到上边留一大块空 */
.two-col > .panel .hbars { flex: 1; align-content: center; }
.two-col.wide-left { grid-template-columns: 1.05fr 1fr; }
/* 网格子项默认 min-width:auto，会被内部宽表格/长文本撑爆整行（经典 CSS Grid blowout）。
   子项自身已有 overflow-x:auto 的横向滚动容器兜底，所以清零 min-width 是安全的。 */
.two-col > * { min-width: 0; }

/* 概览卡原本没有任何悬停反馈，鼠标放上去/按下去毫无变化，与首页指标卡不一致。
   补一档与全站同款的上浮 + 加深投影。 */
.icon-card, .sum-card { transition: transform .16s ease, box-shadow .2s ease; }
.icon-card:hover, .sum-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* ---------- Icon card extras ---------- */
.icon-card .card-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.icon-card.tint-green { background: rgba(5,150,105,.06); border-color: rgba(5,150,105,.24); }
.ic.soft.amber { background: rgba(237,161,0,.12); color: #b45309; }
.ic.round { border-radius: 50%; }

/* ---------- In-page sub tabs ---------- */
.subtabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.subtab { appearance: none; border: 0; background: none; padding: 0 2px 12px; margin-bottom: -1px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; transition: color .15s ease; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--teal); border-bottom-color: var(--teal); }
.subtab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.22); border-radius: 6px; }

/* ---------- Account: avatar + info columns ---------- */
.acct-head { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 0; }
.acct-id { display: flex; align-items: center; gap: 18px; min-width: 280px; padding-right: 26px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: rgba(5,150,105,.12); color: var(--teal); display: grid; place-items: center; flex: none; }
.avatar svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acct-name { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.acct-mail { color: var(--muted); font-size: 14px; margin-top: 5px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(5,150,105,.12); color: var(--teal); }
.info-col { padding: 2px 28px; border-left: 1px solid var(--line); }
.info-col .k { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.info-col .v { font-size: 15px; font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------- Form fields ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 16px; align-items: end; }
.field { position: relative; }
.field .lab { display: block; color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.input { width: 100%; height: 44px; padding: 0 42px 0 14px; border: 1px solid var(--line-input); border-radius: 9px; background: #fff; color: var(--text); font-size: 14px; }
.input::placeholder { color: #6b746e; }   /* 占位符是文字，按 4.5:1 算（对白底 4.83:1） */
.input:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 3.5px rgba(5,150,105,.16); }
/* .eye 已从不可聚焦的 <span> 改成 <button>：键盘可达，并撑到 44px 触控区 */
.eye {
  position: absolute; right: 2px; bottom: 0; width: 44px; height: 44px;
  display: grid; place-items: center; border: none; background: none; padding: 0;
  color: #94a3b8; cursor: pointer; border-radius: 9px;
}
.eye:hover { color: var(--teal); }
.eye:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.22); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.form-hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- Tags / status / row actions ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12.5px; white-space: nowrap; }
.tag.green { background: rgba(22,163,74,.12); color: #15803d; }
.tag.amber { background: rgba(237,161,0,.14); color: #b45309; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status.off .dot { background: #94a3b8; }
/* 行内操作已从 <span> 改成 <button>（键盘可达），这里给按钮补回原来的观感 */
.act-link, .act-danger {
  border: none; background: none; padding: 4px 8px; cursor: pointer;
  font: inherit; font-weight: 600; border-radius: 6px;
}
.act-link { color: var(--teal); }
.act-danger { color: var(--red); margin-left: 8px; }
.act-link:hover, .act-danger:hover { text-decoration: underline; }
.act-link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.22); }
.act-danger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(227,73,72,.25); }
.act-link:disabled, .act-danger:disabled { opacity: .5; cursor: default; text-decoration: none; }

/* ---------- Button variants ---------- */
.btn.primary { background: linear-gradient(160deg, #0cab77 0%, #059669 52%, #04815b 100%); border: none; color: #fff; font-weight: 600;
  box-shadow: 0 1px 1.5px rgba(4,90,66,.30), 0 3px 6px rgba(4,90,66,.20), 0 8px 20px rgba(4,90,66,.18); }
.btn.primary:hover { transform: translateY(-1px); border-color: transparent; background: linear-gradient(160deg, #10b981 0%, #069c6d 52%, #048560 100%);
  box-shadow: 0 1px 2px rgba(4,90,66,.28), 0 5px 12px rgba(4,90,66,.24), 0 14px 30px rgba(4,90,66,.22); }
.btn.primary:active { transform: scale(.97); background: linear-gradient(160deg, #048560 0%, #047954 52%, #036b4b 100%); box-shadow: 0 1px 2px rgba(4,90,66,.34), 0 2px 5px rgba(4,90,66,.22); }
.btn.primary:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.18); }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn.accent { color: #047857; background: rgba(5,150,105,.09); border: none; font-weight: 600; box-shadow: none; }
.btn.accent:hover { background: rgba(5,150,105,.14); transform: translateY(-1px); box-shadow: none; }

/* ---------- Table footer + pagination ---------- */
.table-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager { display: inline-flex; align-items: center; gap: 8px; }
.pg { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; color: #64748b; cursor: pointer; font-size: 13px; box-shadow: 0 0 0 1px rgba(15,23,42,.03), 0 1px 2px rgba(15,23,42,.05), 0 3px 8px rgba(15,23,42,.045); transition: transform .13s ease, border-color .15s ease, box-shadow .16s ease; }
.pg:hover { border-color: #059669; transform: translateY(-1px); }
.pg:active { transform: scale(.98); }
.pg.active { background: linear-gradient(160deg, #0cab77 0%, #059669 52%, #04815b 100%); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 1px 1.5px rgba(4,90,66,.30), 0 3px 6px rgba(4,90,66,.20), 0 8px 20px rgba(4,90,66,.18); }
.pg.nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.plat-cell { display: inline-flex; align-items: center; gap: 9px; }

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .page { padding: 22px 26px 0; }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .cards.c4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .topbar { height: 62px; padding: 0 18px; gap: 12px; }
  .topbar-title, .crumbs { font-size: 17px; }
  .page { padding: 16px 16px 0; }
  .page-head { flex-direction: column; }
  .page-title { font-size: 22px; }
  .cards.c3 { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .legend-row { grid-template-columns: 132px 1fr auto; }
  .legend-cnt { display: none; }
}

@media (max-width: 560px) {
  .cards.c4 { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 72px 1fr; row-gap: 4px; }
  .hbar-value { grid-column: 1 / -1; text-align: left; }

  /* 长金额+百分比在窄屏并排会挤在一起 → 改成上下堆叠 */
  .sum-card { flex-direction: column; align-items: flex-start; gap: 2px; }
  .page-actions { flex-wrap: wrap; }

  /* icon-card 的大图标(54px)在桌面 4 列窄格里比例正常，铺满整行(单列)后
     占到卡片六成高度，反而比数字还显眼——移动端整体缩小、收紧内边距 */
  .icon-card { grid-template-columns: 38px 1fr; gap: 12px; padding: 13px 16px; }
  .ic { width: 38px; height: 38px; border-radius: 10px; }
  .ic svg { width: 19px; height: 19px; }
  .icon-card .card-label { margin-bottom: 5px; font-size: 13px; }
  .icon-card .card-value { font-size: 20px; }

  /* legend-row: 132px名+1fr条+auto金额 在窄屏必超宽 → 去掉装饰性的条，只留 名称+金额 两列 */
  .legend-row { grid-template-columns: 1fr auto; column-gap: 10px; }
  .legend-row .bar-track { display: none; }
  .legend-name { white-space: normal; }

  /* 子菜单（店铺/月份等下拉）：手机上不再用挂在按钮下的小气泡，
     改成底部动作面板——大拇指够得着、行高够点（44px+）、长列表内部滚动（与 index.html 同款） */
  .menu {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 80;
    min-width: 0;
    max-height: 62vh;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;   /* 面板背后是深色遮罩，半透明底会透灰——改不透明 */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    /* 第一层大 spread 阴影充当全屏遮罩：阴影画在元素背景之下，白底不会被染灰
       （负 z 伪元素做遮罩会盖住自己的背景，这是坑） */
    box-shadow: 0 0 0 100vmax rgba(15,23,42,.35), 0 -8px 40px rgba(15,23,42,.2);
  }
  .menu.open { animation: sheetUp .18s ease; }
  /* 全屏透明挡板：只负责挡住对底下内容的误触，"暗"由上面的 spread 阴影负责 */
  .menu.open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
  }
  @keyframes sheetUp { from { opacity: .5; transform: translateY(26px); } to { opacity: 1; transform: none; } }
  .menu-item { padding: 13px 14px; border-radius: 9px; font-size: 15px; }
}

/* new components responsive */
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .btn { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 820px) {
  .acct-id { padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; width: 100%; }
  .info-col { border-left: 0; padding: 0; }
  .acct-head { gap: 16px 0; }
  .acct-head .info-col { width: 100%; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .subtabs { gap: 20px; }
}

/* ---------- C20 移动端触控目标 ----------
   iOS/Android 的可点区域下限都是 44px。实测这几个是全站最主要的移动端控件，
   原来只有 26–35px，手指点不准（提款/广告费页的仓库切换就是 35px）。
   只在触屏上放大，鼠标设备保持紧凑排版。 */
@media (max-width: 820px) {
  .subtabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subtab { min-height: 44px; padding: 0 2px 12px; display: inline-flex; align-items: center; white-space: nowrap; }
  .date-picker { min-height: 44px; }
  .btn, .btn-ghost { min-height: 44px; }
  .sp-chip { min-height: 34px; padding: 8px 14px; }   /* 筛选 chip 一行要放好几个，34px 是可用与可读的折中 */
  .menu-item { min-height: 44px; }
  .pg { width: 40px; height: 40px; }
}
@media (max-width: 820px), (hover: none) {
  .sp-chip { min-height: 44px; }
  .act-link, .act-danger { min-height: 44px; display: inline-flex; align-items: center; }
  .eye { width: 44px; height: 44px; }
}

/* ==========================================================================
   绩效概览新增组件（2026-07-25）
   ========================================================================== */

/* ---------- 名次徽章 ----------
   前三名要一眼看得出来：原来名次列只是普通粗体数字，和第 4 名的「—」同一视觉层级，
   而这一页的核心就是"谁在前三"。用圆形徽章而不是 🥇 emoji——emoji 跨系统长相不一。 */
.rank-badge {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums;
}
.rank-badge.r1 { background: linear-gradient(160deg, #f0b429, #d69e2e); }
.rank-badge.r2 { background: linear-gradient(160deg, #b8c0c8, #94a3b8); }
.rank-badge.r3 { background: linear-gradient(160deg, #d08c52, #b3703a); }
.rank-badge.rest { background: none; color: var(--muted-2); font-weight: 600; }
.data-table tr.top3 td { background: rgba(5,150,105,.035); }
.data-table tr.top3:hover td { background: rgba(5,150,105,.07); }

/* ---------- 分段控件（月 / 季度 / 整年）----------
   与首页那套同款观感，避免同一产品里出现两种范围切换的长相。 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: none; cursor: pointer;
  height: 32px; padding: 0 13px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(5,150,105,.12); color: var(--teal); }
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.22); }

/* ---------- 「我的名次」大字报（子账号视角）----------
   员工进这一页只关心一件事：我第几名。所以这个数字要比页面上任何数字都大。 */
.myrank { text-align: center; padding: 26px 20px 24px; }
.myrank .mr-label { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.myrank .mr-num { font-size: 46px; font-weight: 800; line-height: 1; color: var(--teal); }
.myrank .mr-num small { font-size: 20px; font-weight: 700; margin-left: 3px; }
.myrank .mr-sub { color: var(--muted); font-size: 14px; margin-top: 12px; }
.myrank.warn .mr-num { color: #b45309; font-size: 22px; line-height: 1.4; }

/* ---------- 考核记录（文字，不是勾选）----------
   四项没有可量化的达标标准，所以这里是"记录当月实际情况"，留空=无异常。
   系统不做任何自动判定，也不据此取消谁的资格。 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-item .kpi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.kpi-item .kpi-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.kpi-item .kpi-rule { font-size: 12.5px; color: var(--teal); text-decoration: none; white-space: nowrap; }
.kpi-item .kpi-rule:hover { text-decoration: underline; }
.kpi-note {
  width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line-input);
  border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-size: 14px;
  resize: vertical;
}
.kpi-note:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 3.5px rgba(5,150,105,.16); }
.kpi-note::placeholder { color: #6b746e; }
.kpi-ro { font-size: 14px; color: var(--text); padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.kpi-ro.empty { color: var(--muted-2); }

/* ---------- 手机端：榜单改卡片列表 ----------
   宽表在 390px 下只能露出前 4 列，「环比」这类关键字段被滚出屏幕。
   一行里有 3 个以上"必须同时看到"的字段时，手机端就不该用表格。 */
.rank-cards { display: none; }
@media (max-width: 820px) {
  .rank-table-wrap { display: none; }
  .rank-cards { display: grid; gap: 12px; }
  .rank-card {
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
    box-shadow: var(--shadow-sm); padding: 14px 16px;
  }
  .rank-card.top3 { border-color: rgba(5,150,105,.28); background: rgba(5,150,105,.04); }
  .rank-card .rc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .rank-card .rc-name { display: inline-flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 700; }
  .rank-card .rc-growth { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .rank-card .rc-meta { color: var(--muted); font-size: 13px; margin-top: 7px; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ---------- 手机端：概览卡两列 + 压缩 ----------
   原来 c3/c4 在窄屏都塌成 1 列，7 张卡要占掉近 1000px 高度，
   用户得滚过整整一屏多才看到真正要看的榜单。 */
@media (max-width: 560px) {
  .cards.c3, .cards.c4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .icon-card { grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 14px; }
  .ic { width: 36px; height: 36px; border-radius: 10px; }
  .ic svg { width: 19px; height: 19px; }
  .icon-card .card-label { font-size: 12.5px; margin-bottom: 5px; }
  .icon-card .card-value { font-size: 19px; }
  .seg button { height: 36px; padding: 0 11px; }
}

/* ---------- 并列名次提示 ---------- */
.tied-note { color: var(--muted-2); font-size: 12px; margin-left: 6px; white-space: nowrap; }

/* ==========================================================================
   账单网页录入（2026-08-08）
   ========================================================================== */
/* 表单弹窗复用 upload.js 注入的 .up-mask/.up-modal/.up-fld/.inp/.lab 全套，
   这里只补账单表单特有的排版。 */
.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .bf-grid { grid-template-columns: 1fr; } }
/* 收支类型分段：复用 .seg 的观感，撑满字段宽度、与 .inp 同高对齐 */
.bf-seg { display: flex; width: 100%; height: 40px; box-sizing: border-box; }
.bf-seg button { flex: 1; height: 32px; padding: 0 4px; }
/* C20 触控下限：手机上 4 个类型按钮是最高频的点击目标 */
@media (max-width: 820px) {
  .bf-seg { height: auto; }
  .bf-seg button { min-height: 44px; }
}
.bf-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 10px; cursor: pointer; }
.bf-check input { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }
.bf-check .mut { font-size: 12.5px; }

/* 作废行：灰显+删除线。比 opacity 更明确——「计入=否」是半透明，两种状态要分得开 */
.data-table tr.row-void td { color: var(--muted-2); text-decoration: line-through; background: rgba(15,23,42,.02); }
.data-table tr.row-void td .act-link,
.data-table tr.row-void td .act-danger { text-decoration: none; }

/* 网页录入行的小圆点标识（历史导入行没有） */
.src-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); margin-right: 6px; vertical-align: 2px;
}
.data-table td.nowrap { white-space: nowrap; }

/* 凭据缩略图区（编辑弹窗内） */
.bf-evlist { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; }
.bf-ev { position: relative; display: inline-block; }
.bf-ev img {
  width: 74px; height: 74px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line); cursor: zoom-in; display: block;
}
.bf-ev img:hover { border-color: var(--teal); }
.bf-evx {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.bf-evx:hover { color: var(--red); border-color: var(--red); }
.bf-evadd {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px dashed var(--line); border-radius: 9px; color: var(--teal);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s ease;
}
.bf-evadd:hover { border-color: var(--teal); }

/* .sum-card 窄屏溢出（右缘超出视口 16px）的修复要分两种排布：
   - 行向 flex（>560px）：子项默认 min-width:auto，nowrap 大字号会把 .sc-main 撑出卡片 → min-width:0；
   - 列向 flex（≤560px，flex-direction:column）：横向是交叉轴，min-width 管不着，
     要 max-width:100% 才能把子项按住。
   两个都给上之后 .sc-value 的 clientWidth 才是受限值，fitAmounts 的
   scrollWidth 检测才触发得了（否则 clientWidth 跟着内容一起变宽，永远"放得下"）。 */
.sum-card .sc-main { min-width: 0; max-width: 100%; }
.sum-card .sc-value { max-width: 100%; }

/* ---------- 账单页三轮重排（2026-08-09）：明细为主列、统计收右栏 ---------- */
/* 五轮定稿：仓库页签就是页面主标题（大标题删了，面包屑已写页面名）。
   币种/月份下沉到「明细」标题行——控件贴着它限定的内容。 */
/* 统计/更多紧跟仓库页签（不用 space-between 甩到最右）；深色按钮突出可点 */
.bills-head { align-items: center; justify-content: flex-start; gap: 26px; margin-bottom: 16px; }
.bills-head .page-actions { gap: 10px; }
/* 深色按钮走品牌绿（用户定：别用黑，与主题统一）。
   渐变与主按钮同族（登录按钮/保存按钮的绿），hover 加深。 */
.btn-dark {
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  background: linear-gradient(140deg, #059669 0%, #0d8467 60%, #047857 100%);
  color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn-dark:hover {
  background: linear-gradient(140deg, #047857 0%, #0b6b57 60%, #065f46 100%);
  transform: translateY(-1px); box-shadow: 0 3px 10px rgba(5,150,105,.25);
}
.btn-dark:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(5,150,105,.28); }
.btn-dark svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 820px), (hover: none) { .btn-dark { min-height: 44px; } }
/* hero 页签：容器不要 .subtabs 的整条 border-bottom——它只有内容宽，
   在旁边还有按钮时就是一截"断头线"。选中态靠页签自己的下划线。 */
.wh-hero { margin: 0; gap: 26px; border-bottom: none; }
.wh-hero .subtab {
  font-size: 21px; font-weight: 800; letter-spacing: .3px;
  padding: 2px 2px 9px; margin-bottom: 0;
}
.detail-toolbar { justify-content: flex-start; gap: 10px 14px; flex-wrap: wrap; }
.detail-toolbar .pending-chip { margin-left: auto; }
/* 明细行的月份导航：‹ + 月份 + › 合成一个胶囊（三个孤立小块显得零碎）。
   内部按钮去边框、直角；分隔用极淡竖线；整体高度与币种分段一致。 */
.detail-toolbar .month-nav {
  gap: 0; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; overflow: hidden;
}
.detail-toolbar .month-nav .mo-btn {
  height: 36px; min-height: 36px; width: 34px;
  border: none; border-radius: 0; background: transparent;
}
.detail-toolbar .month-nav .mo-btn:hover { background: rgba(5,150,105,.07); color: var(--teal); }
.detail-toolbar .month-nav .date-picker {
  height: 36px; border: none; border-radius: 0;
  border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
}
.detail-toolbar .cur-seg { height: 36px; align-items: center; }
/* C20：触屏回到 44px 下限，桌面才允许紧凑 */
@media (max-width: 820px), (hover: none) {
  .detail-toolbar .month-nav .date-picker { height: 44px; min-height: 44px; }
  .detail-toolbar .month-nav .mo-btn { height: 44px; min-height: 44px; width: 42px; }
  .wh-hero { gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .wh-hero .subtab { font-size: 18px; white-space: nowrap; }
}
/* 统计页仍在用的旧上下文栏 */
.book-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px 20px; flex-wrap: wrap; margin-bottom: 16px;
}
.book-ctx { display: flex; align-items: center; gap: 16px; min-width: 0; flex-wrap: wrap; }
.book-div { width: 1px; height: 22px; background: var(--line); flex: none; }
.month-nav { display: flex; align-items: center; gap: 8px; flex: none; }
.book-row .subtabs { margin: 0; }
.cur-seg { display: inline-flex; }
.cur-seg .seg-empty { opacity: .55; }
.cur-seg .seg-empty.on { opacity: 1; }
.bills-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px; align-items: start;
}
.bills-aside { display: grid; gap: 14px; min-width: 0; }
.bills-aside .sum-card { margin: 0; }
/* 加载态：无缓存请求进行中——立刻变灰给反馈，禁点防连击 */
.bills-main.loading { opacity: .55; pointer-events: none; transition: opacity .15s ease; }

/* ---------- 右栏行详情（2026-08-09 四轮：统计拆走，右栏点行即看） ---------- */
.bills-aside { position: sticky; top: 16px; }
@media (max-width: 1100px) { .bills-aside { position: static; } }
.detail-empty { color: var(--muted-2); font-size: 13.5px; text-align: center; padding: 34px 0 26px; line-height: 2; }
.dt-amt { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 12px; }
.dt-amt.neg { color: var(--neg); }
.dt-amt.pos { color: var(--pos); }
.dt-sum { font-size: 15px; font-weight: 600; margin: 6px 0 12px; overflow-wrap: anywhere; }
.dt-kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; }
.dt-kv dt { color: var(--muted); white-space: nowrap; }
.dt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dt-ev { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.dt-ev img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line); cursor: zoom-in; display: block;
}
.dt-ev img:hover { border-color: var(--teal); }
.dt-ev .mut { grid-column: 1 / -1; }
.dt-ops { display: flex; gap: 10px; margin-top: 14px; }
.dt-ops .btn-ghost { flex: 1; }
/* 选中行：与详情面板同色系，一眼对上 */
.data-table tr.row-selected td { background: rgba(5,150,105,.06); box-shadow: inset 3px 0 0 var(--teal); }
.bill-card.row-selected { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(5,150,105,.35); }
.data-table tbody tr[data-rid] { cursor: pointer; }
/* 统计页 hbar：基础网格标签列只有 82px，「仓库费用/场地房租」这类复合标签
   会溢出压到条形上。改按内容自适应（设上限+省略号），数值列也放开为 auto。 */
.stats-trend .hbar-row { --hbar-label: 96px; }
.stats-cats .hbar-row { grid-template-columns: minmax(90px, max-content) 1fr auto; }
.stats-cats .hbar-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.stats-cats .hbar-value { white-space: nowrap; }

/* 统计页：月份趋势行可点 + 选中态 */
.trend-row { cursor: pointer; border-radius: 8px; padding: 4px 8px; }
.trend-row:hover { background: rgba(5,150,105,.05); }
.trend-row.on { background: rgba(5,150,105,.08); box-shadow: inset 3px 0 0 var(--teal); }
/* 窄屏下三列（标签+条+数值）放不下 → 两行式，与侧栏占比同款 */
@media (max-width: 820px) {
  .stats-trend .hbar-row, .stats-cats .hbar-row {
    grid-template-columns: auto 1fr; grid-template-areas: "label value" "bar bar";
    row-gap: 5px; align-items: baseline;
  }
  .stats-trend .hbar-row .hbar-label, .stats-cats .hbar-row .hbar-label { grid-area: label; }
  .stats-trend .hbar-row .hbar-value, .stats-cats .hbar-row .hbar-value { grid-area: value; text-align: right; min-width: 0; }
  .stats-trend .hbar-row .bar-track, .stats-cats .hbar-row .bar-track { grid-area: bar; }
}
/* 环比卡：上月金额放小字行，不塞进标签（IDR 长金额会把标签挤爆） */
.sum-card .sc-sub { color: var(--muted-2); font-size: 12.5px; margin: 7px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 侧栏里的分类占比：300px 宽容不下「标签+条+数值」三列（条被挤没、金额顶到卡边）。
   改两行式：首行 标签左 + 占比·金额右，次行整宽条。 */
.bills-aside .hbar-row {
  grid-template-columns: auto 1fr; grid-template-areas: "label value" "bar bar";
  row-gap: 5px; align-items: baseline;
}
.bills-aside .hbar-row .hbar-label { grid-area: label; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bills-aside .hbar-row .hbar-value { grid-area: value; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.bills-aside .hbar-row .bar-track { grid-area: bar; }
@media (max-width: 1100px) {
  .bills-layout { grid-template-columns: 1fr; }
  /* 窄屏统计沉到明细下方；两张小卡并排省高度 */
  .bills-aside { grid-template-columns: 1fr 1fr; }
  .bills-aside .panel { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .bills-aside { grid-template-columns: 1fr; }
}
.mo-btn { width: 40px; padding: 0; font-size: 18px; line-height: 1; }
.mo-btn:disabled { opacity: .35; cursor: default; }
/* 待核过滤 chip：琥珀=警示但不是错误 */
.pending-chip {
  border: 1px solid rgba(237,161,0,.5); border-radius: 999px;
  background: rgba(237,161,0,.10); color: #b45309;
  font-size: 12.5px; font-weight: 700; padding: 5px 13px; cursor: pointer;
  margin: 0; min-height: 0;
}
.pending-chip.on { background: #eda100; color: #fff; border-color: #eda100; }
/* 表格里的小标签 */
.tag-tocheck, .tag-excl {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.4;
  padding: 1px 7px; border-radius: 999px; margin-right: 6px; vertical-align: 1px;
}
.tag-tocheck { background: rgba(237,161,0,.14); color: #b45309; }
.tag-excl { background: var(--line-soft); color: var(--muted); }
/* 录入条「更多选项」折叠区。
   ★ [hidden] 不能省：UA 的 [hidden]{display:none} 会被 .be-grid{display:grid} 压过——
     hidden 属性对设了 display 的元素形同虚设，必须显式补一条。 */
.be-grid.be-extra { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.be-grid.be-extra[hidden] { display: none; }
.be-grid.be-extra { grid-template-columns: 1fr 1fr 1fr auto; grid-template-areas: "acct note exp inc"; }
.be-inc-w { grid-area: inc; display: flex; align-items: end; padding-bottom: 8px; }
@media (max-width: 1100px) {
  .be-extra { grid-template-columns: 1fr 1fr; grid-template-areas: "acct note" "exp inc"; }
}
@media (max-width: 560px) {
  .be-extra { grid-template-columns: 1fr; grid-template-areas: "acct" "note" "exp" "inc"; }
}
.bills-table { min-width: 720px; }

/* ---------- 内联录入条（2026-08-09：新增/编辑不开弹窗，就在行数上方） ---------- */
.bill-entry {
  margin: 14px 0 4px; padding: 14px 16px 12px;
  border: 1px solid rgba(5,150,105,.26); border-radius: 12px;
  background: rgba(5,150,105,.035);
}
.be-ai-drop {
  display: flex; align-items: center; gap: 11px; min-height: 50px; box-sizing: border-box;
  margin: 0 0 12px; padding: 8px 10px; border: 1px dashed rgba(5,150,105,.48);
  border-radius: 10px; background: rgba(255,255,255,.68); color: var(--teal-dark, #047857);
  cursor: pointer; outline: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.be-ai-drop:hover, .be-ai-drop:focus-visible, .be-ai-drop.is-dragging {
  border-color: var(--teal); background: rgba(5,150,105,.075); box-shadow: 0 0 0 3px rgba(5,150,105,.08);
}
.be-ai-drop.is-running { cursor: wait; }
.be-ai-drop.is-done { border-style: solid; background: rgba(5,150,105,.07); }
.be-ai-drop.is-error { border-color: rgba(220,38,38,.45); background: rgba(220,38,38,.035); color: var(--neg, #dc2626); }
.be-ai-icon {
  display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 9px; color: #fff; background: linear-gradient(140deg, #10b981, #047857);
}
.be-ai-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.be-ai-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
.be-ai-copy b { font-size: 13.5px; font-weight: 700; }
.be-ai-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.be-ai-drop.is-error .be-ai-copy small { color: var(--neg, #dc2626); }
.be-ai-pick {
  min-height: 32px; padding: 0 12px; border: 1px solid rgba(5,150,105,.3); border-radius: 8px;
  background: #fff; color: var(--teal-dark, #047857); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.be-ai-pick:hover { border-color: var(--teal); }
.be-ai-pick:disabled { opacity: .55; cursor: wait; }
.bill-entry .ai-filled { animation: aiFieldFlash 1.5s ease-out; }
@keyframes aiFieldFlash { 0% { box-shadow: 0 0 0 3px rgba(5,150,105,.2); background: #ecfdf5; } 100% { box-shadow: none; } }
.be-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.be-head span { font-size: 13.5px; font-weight: 700; color: var(--teal-dark, #047857); }
/* 高频主网格两行：首行 日期/类型/分类/二级/金额，次行 摘要（占大半）+ 更多/保存。
   低频字段（账户/备注/应剩余额/计入）在 .be-extra 折叠区，见上方三轮重排一节。 */
.be-grid {
  display: grid; gap: 8px 12px;
  grid-template-columns: 128px 178px 1fr 1fr 150px;
  grid-template-areas: "date io cat sub amt" "sum sum sum act act";
  align-items: end;
}
.be-fld { min-width: 0; }
.be-date { grid-area: date; }
.be-io   { grid-area: io; }
.be-amt  { grid-area: amt; }
.be-sum  { grid-area: sum; }
.be-act  { grid-area: act; display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.be-lab { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.be-lab span { font-weight: 400; color: var(--muted-2); }
.bill-entry .inp { height: 38px; font-size: 14px; width: 100%; box-sizing: border-box; }
.bill-entry .bf-seg { height: 38px; }
.bill-entry .bf-seg button { height: 30px; font-size: 12.5px; padding: 0 2px; }
.be-inc { margin: 0; white-space: nowrap; }
.be-key {
  font-size: 11px; opacity: .75; margin-left: 6px; border: 1px solid rgba(255,255,255,.5);
  border-radius: 4px; padding: 0 4px;
}
.be-ev { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
/* 五个字段两行放不下应剩余额/备注 → 塞进第二行剩余格；小屏整体塌成两列再一列 */
@media (max-width: 1100px) {
  .be-grid { grid-template-columns: 1fr 1fr;
    grid-template-areas: "date io" "cat sub" "amt amt" "sum sum" "act act"; }
  /* 折叠区在同断点走自己的两列（选择器在后，赢过上面这条对 .be-extra 的波及） */
  .be-grid.be-extra { grid-template-columns: 1fr 1fr; grid-template-areas: "acct note" "exp inc"; }
}
@media (max-width: 560px) {
  .be-grid { grid-template-columns: 1fr;
    grid-template-areas: "date" "io" "cat" "sub" "amt" "sum" "act"; }
  .be-grid.be-extra { grid-template-columns: 1fr; grid-template-areas: "acct" "note" "exp" "inc"; }
  .be-act { justify-content: stretch; }
  .be-act .btn { flex: 1; }
  .be-ai-drop { align-items: flex-start; flex-wrap: wrap; }
  .be-ai-pick { margin-left: 43px; }
}
.be-note { grid-area: note; }
.be-exp { grid-area: exp; }
.be-acct { grid-area: acct; }

/* 正在编辑的行：与录入条同色系描边，看得出"条里装的是它" */
.data-table tr.row-editing td { background: rgba(5,150,105,.07); }
.bill-card.row-editing { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(5,150,105,.3); }

/* 刚保存的行闪一下 */
@keyframes rowFlash { 0% { background: rgba(5,150,105,.22); } 100% { background: transparent; } }
.data-table tr.row-flash td { animation: rowFlash 1.6s ease-out; }
.bill-card.row-flash { animation: rowFlash 1.6s ease-out; }

/* 没数据的账本页签：淡一点但一样能点（点进去记第一笔） */
.subtab-empty { opacity: .55; }
.subtab-empty.active { opacity: 1; }

/* 手机端账单卡片：≤820px 用卡片替代 11 列横滑宽表（D7 规矩） */
.bill-cards { display: none; }
@media (max-width: 820px) {
  #rowsScroll { display: none; }
  .bill-cards { display: grid; gap: 12px; margin-top: 14px; }
  .bill-card {
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
    box-shadow: var(--shadow-sm); padding: 13px 15px 9px;
  }
  .bill-card.void { opacity: .55; }
  .bill-card.void .blc-sum { text-decoration: line-through; }
  .bill-card.excl { opacity: .6; }
  .blc-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .blc-sum { font-size: 15px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
  .blc-amt { font-size: 16.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .blc-amt.neg { color: var(--neg, #dc2626); }
  .blc-amt.pos { color: #16a34a; }
  .blc-meta { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
  .blc-meta .bc-ok { color: #16a34a; font-weight: 600; }
  .blc-meta .bc-bad { color: var(--neg, #dc2626); font-weight: 600; }
  .blc-ops { display: flex; gap: 4px; margin-top: 4px; border-top: 1px solid var(--line-soft); padding-top: 2px; }
}

/* 表格里的凭据数徽章 */
.ev-badge {
  appearance: none; border: 0; background: rgba(5,150,105,.09); color: var(--teal-dark, #047857);
  border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600;
  cursor: pointer; margin-left: 5px; vertical-align: 1px;
}
.ev-badge:hover { background: rgba(5,150,105,.16); }

/* 币种标签：跟在卡片标签后面的小字。
   ★ 为什么不放在数值里：把「MYR 25,640.02」整串当数值，手机端窄卡放不下，
     fitAmounts 只能把整串缩小 —— 结果数额越大字越小，视觉层级和数据重要性正好反过来。
     币种本来就不需要和数字一样大，挪出来数字就能保持大号。 */
.cur-tag {
  font-size: 11.5px; font-weight: 600; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; margin-left: 6px;
  vertical-align: 1px; letter-spacing: .3px;
}

/* 前三名卡片：手机端改单列紧凑排。
   原来跟着 .cards.c3 走两列，第三张单独占一行、右边空着，很不整齐。 */
@media (max-width: 560px) {
  .cards.top3-cards { grid-template-columns: 1fr; gap: 10px; }
  .top3-cards .icon-card { grid-template-columns: 32px 1fr; padding: 11px 14px; }
  .top3-cards .ic { width: 32px; height: 32px; }
  .top3-cards .ic svg { width: 17px; height: 17px; }
  .top3-cards .card-value { font-size: 17px; }
  .top3-cards .card-label, .top3-cards .card-sub { font-size: 12px; }
}
