/* 简账企业版 · 页面级样式 · 基础与通用组件 */
.desktop-only { display: inline-flex; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(290px, 1fr); gap: 12px; align-items: start; }
.layout-main-wide { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.stack-card { display: flex; flex-direction: column; gap: 12px; }
.dot-sep { color: var(--line-strong); }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fs-11, .fs-12 { font-size: 12px; }
.fs-13 { font-size: 12px; }
.fs-15 { font-size: 14px; }
.fw-600 { font-weight: 600; }
.line-clamp-1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hover-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.soft-panel { padding: 14px; background: var(--surface-2); border-radius: 10px; }
.card-inset { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.icon-sun, .icon-moon { display: inline-grid; place-items: center; }
[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* 升级弹层 */
.upgrade-feature-list { display: flex; flex-direction: column; gap: 12px; }
.upgrade-feature { display: flex; align-items: flex-start; gap: 12px; }
.upgrade-feature .type-mark { width: 36px; height: 36px; }
.upgrade-feature b { display: block; font-size: 12px; font-weight: 600; }
.upgrade-feature p { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.plan-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.plan-card.is-current { background: var(--primary-soft); border-color: color-mix(in oklch, var(--primary) 30%, var(--line)); }
.plan-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.plan-price { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.plan-price span { margin-left: 2px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.plan-desc { color: var(--muted); font-size: 12px; }

@media (max-width: 920px) {
  .desktop-only { display: none !important; }
  .grid-2, .grid-3, .grid-4, .layout-main, .layout-main-wide { grid-template-columns: 1fr; }
}
/* ============================================================
   登录
   ============================================================ */
.login-page { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); min-height: 100vh; background: var(--bg); }
.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px 44px 34px;
  overflow: hidden;
  color: oklch(95% 0.012 92);
  background: repeating-linear-gradient(90deg, transparent 0 31px, oklch(100% 0 0 / 0.018) 31px 32px), var(--sidebar);
}
.login-brand-panel::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  right: -220px;
  top: -250px;
  border: 1px solid oklch(100% 0 0 / 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 80px oklch(100% 0 0 / 0.018), 0 0 0 160px oklch(100% 0 0 / 0.012);
  pointer-events: none;
}
.login-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.login-brand-top .brand-mark { width: 34px; height: 34px; background: oklch(94% 0.012 92); color: var(--sidebar); }
.login-brand-top .brand-mark .i { width: 22px; height: 22px; }
.login-brand-name { font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.login-edition { margin-left: 4px; padding: 2px 6px; color: oklch(78% 0.055 80); border: 1px solid oklch(60% 0.05 80 / 0.55); border-radius: 4px; font-size: 12px; letter-spacing: .12em; }
.login-story { position: relative; z-index: 1; margin-top: clamp(46px, 8vh, 88px); }
.login-kicker { display: inline-flex; align-items: center; gap: 7px; color: oklch(74% 0.026 165); font-size: 12px; letter-spacing: .04em; }
.login-kicker::before { content: ""; width: 18px; height: 1px; background: oklch(70% 0.07 75); }
.login-story h1 { margin-top: 14px; color: oklch(98% 0.006 92); font-size: clamp(40px, 4vw, 48px); font-weight: 640; line-height: 1.12; letter-spacing: -.045em; }
.login-story p { max-width: 31em; margin-top: 17px; color: oklch(76% 0.018 165); font-size: 14px; line-height: 1.8; }
.ledger-visual { position: relative; z-index: 1; width: min(430px, 84%); margin-top: clamp(26px, 4.5vh, 46px); padding-left: 18px; }
.ledger-sheet { position: relative; z-index: 2; padding: 17px 20px 15px; color: oklch(27% 0.02 165); background: oklch(97.6% 0.012 88); border-radius: 3px; box-shadow: 0 18px 42px oklch(8% 0.02 165 / 0.35); transform: rotate(-1.4deg); }
.ledger-sheet::before, .ledger-sheet::after { content: ""; position: absolute; inset: 0; z-index: -1; background: oklch(95% 0.014 88); border-radius: 3px; }
.ledger-sheet::before { transform: rotate(3deg) translate(9px, 5px); opacity: .5; }
.ledger-sheet::after { transform: rotate(-2deg) translate(-7px, 3px); opacity: .7; }
.ledger-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid oklch(84% 0.014 88); }
.ledger-sheet-head span:first-child { font-size: 12px; letter-spacing: .16em; color: oklch(52% 0.02 165); }
.ledger-sheet-no { font-family: var(--font-mono); font-size: 12px; color: oklch(62% 0.016 165); white-space: nowrap; }
.ledger-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid oklch(91% 0.01 88); font-size: 12px; }
.ledger-row span:first-child { color: oklch(52% 0.018 165); }
.ledger-row b { font-size: 12px; font-weight: 550; }
.ledger-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; }
.ledger-total small { color: oklch(52% 0.018 165); font-size: 12px; }
.ledger-total strong { display: block; margin-top: 1px; font-size: 24px; font-weight: 650; letter-spacing: -.04em; }
.ledger-total .paid { color: oklch(43% 0.075 170); font-size: 12px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.ledger-stamp { position: absolute; right: 18px; bottom: 54px; display: grid; place-items: center; width: 47px; height: 47px; color: oklch(52% 0.11 32 / 0.72); border: 2px solid oklch(52% 0.11 32 / 0.55); border-radius: 50%; font-size: 12px; font-weight: 600; letter-spacing: .08em; line-height: 1.35; transform: rotate(-12deg); }
.login-proof { position: relative; z-index: 1; display: flex; gap: clamp(24px, 4vw, 52px); margin-top: auto; padding-top: 28px; border-top: 1px solid oklch(100% 0 0 / 0.12); }
.login-proof b { display: block; color: oklch(96% 0.008 92); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.login-proof span { display: block; margin-top: 2px; color: oklch(68% 0.02 165); font-size: 12px; }
.login-form-panel { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 26px 42px 22px; background: var(--surface); }
.login-form-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.login-form-top .badge { color: var(--primary-strong); background: var(--primary-soft); }
.login-form-wrap { width: min(364px, 100%); margin: auto; padding: 32px 0; }
.login-heading h2 { font-size: 24px; font-weight: 650; line-height: 1.25; letter-spacing: -.035em; }
.login-heading p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 15px; margin-top: 27px; }
.login-form .field > label { font-size: 12px; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input > .i { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); }
.login-input .input { height: 44px; padding-left: 36px; padding-right: 42px; background: var(--surface); }
.login-input .icon-btn { position: absolute; right: 4px; width: 32px; height: 32px; color: var(--muted); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.login-check { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--muted); font-size: 12px; cursor: pointer; }
.login-check .checkbox { width: 24px; height: 24px; }
.login-row a { display: inline-flex; align-items: center; min-height: 32px; color: var(--primary); font-size: 12px; }
.login-row a:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-submit { width: 100%; height: 45px; margin-top: 3px; font-size: 14px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--faint); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fingerprint-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 43px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; }
.fingerprint-btn:hover { background: var(--surface-2); }
.fingerprint-btn .i { color: var(--primary); }
.demo-login { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px; padding: 11px 13px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 7px; font-size: 12px; text-align: left; }
.demo-login:hover { border-color: var(--primary); color: var(--primary-strong); }
.demo-login span { display: flex; flex-direction: column; gap: 2px; }
.demo-login small { color: var(--muted); font-size: 12px; }
.demo-login .i { width: 15px; height: 15px; }
.login-terms { margin-top: 18px; color: var(--faint); font-size: 12px; line-height: 1.7; text-align: center; }
.login-terms a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.login-form-foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--faint); font-size: 12px; }
.login-form-foot .i { width: 12px; height: 12px; }

@media (max-width: 1100px) {
  .login-page { grid-template-columns: minmax(0, 1fr) minmax(390px, .86fr); }
  .login-brand-panel { padding: 28px 34px; }
  .login-story h1 { font-size: 42px; }
  .ledger-visual { width: 92%; }
  .login-form-panel { padding: 24px 32px 20px; }
}
@media (max-width: 900px) {
  .login-page { display: block; min-height: 100vh; }
  .login-brand-panel { min-height: 0; padding: 18px 22px; }
  .login-brand-top .brand-mark { width: 28px; height: 28px; }
  .login-story, .ledger-visual, .login-proof { display: none; }
  .login-brand-panel::before { width: 300px; height: 300px; right: -150px; top: -150px; }
  .login-form-panel { min-height: calc(100vh - 64px); padding: 16px 22px 18px; }
  .login-form-wrap { margin: 0 auto; padding: 34px 0 20px; }
  .login-heading h2 { font-size: 24px; }
  .login-form { margin-top: 24px; gap: 14px; }
  .login-form-foot { padding-top: 8px; }
}
@media (max-width: 480px) {
  .login-brand-panel { padding: 15px 18px; }
  .login-brand-name { font-size: 14px; }
  .login-edition { display: none; }
  .login-form-panel { padding: 12px 18px 16px; }
  .login-form-wrap { padding-top: 24px; }
  .login-heading h2 { font-size: 24px; }
  .login-form-top .badge { display: none; }
  .login-form-top { position: absolute; right: 10px; top: 10px; }
}
@media (max-height: 820px) and (min-width: 901px) {
  .login-story { margin-top: 30px; }
  .login-story h1 { font-size: 44px; }
  .login-story p { margin-top: 12px; }
  .ledger-visual { margin-top: 20px; }
  .login-proof { padding-top: 18px; }
  .login-form-wrap { padding: 18px 0; }
}
/* ============================================================
   工作台
   ============================================================ */
.dash-head { align-items: flex-end; }
.dash-head .greeting-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-head .greeting-note a { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 0; color: var(--primary); font-weight: 500; }
.dash-head .greeting-note a:hover { text-decoration: underline; text-underline-offset: 3px; }
.period-switch { display: flex; align-items: center; gap: 8px; }
.dash-kpis { display: grid; grid-template-columns: 1.16fr 1fr 1fr 1fr; gap: 12px; }
.dash-kpis .kpi { min-height: 132px; display: flex; flex-direction: column; }
.dash-kpis .kpi-value { font-size: 28px; }
.dash-kpis .kpi-feature .kpi-value { font-size: 34px; }
.kpi-spark { position: absolute; right: 16px; top: 18px; width: 94px; height: 34px; opacity: .85; }
.kpi-feature .kpi-foot { margin-top: auto; padding-top: 12px; }
.kpi-feature .kpi-foot .dot-sep { color: oklch(58% 0.02 165); }
.kpi-feature .delta-up { color: oklch(80% 0.11 150); }
.kpi-spark path.line { fill: none; stroke: currentColor; stroke-width: 1.5; }
.kpi-spark path.area { fill: currentColor; opacity: .1; stroke: none; }
.kpi-feature .kpi-spark { color: oklch(76% 0.075 75); }
.kpi .kpi-spark { color: var(--primary); }
.dash-main { margin-top: 12px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(290px, 1fr); gap: 12px; align-items: stretch; }
.chart-card .card-head { padding-bottom: 2px; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--primary); }
.legend-dot.expense { background: var(--accent); }
.chart-area { position: relative; padding: 2px 12px 0; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-svg .axis-text { fill: var(--muted); font-family: var(--font-sans); font-size: 12px; }
.chart-svg .income-line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .expense-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; }
.chart-svg .income-area { fill: var(--chart-fill); }
.chart-svg .dot-income { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-svg .dot-expense { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 16px; color: var(--faint); font-size: 12px; }
.chart-foot strong { color: var(--text-2); font-weight: 550; }
.todo-card { display: flex; flex-direction: column; }
.todo-card .card-body { display: flex; flex-direction: column; flex: 1; padding-top: 10px; }
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover .todo-title { color: var(--primary); }
.todo-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--muted); background: var(--surface-2); border-radius: 8px; }
.todo-icon .i { width: 16px; height: 16px; }
.todo-icon.is-warning { color: var(--warning); background: var(--warning-soft); }
.todo-icon.is-danger { color: var(--danger); background: var(--danger-soft); }
.todo-icon.is-primary { color: var(--primary); background: var(--primary-soft); }
.todo-copy { min-width: 0; flex: 1; }
.todo-title { font-size: 12px; font-weight: 550; transition: color var(--dur) var(--ease); }
.todo-sub { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.todo-arrow { color: var(--faint); }
.todo-arrow .i { width: 15px; height: 15px; }
.todo-foot { margin-top: auto; padding-top: 12px; }
.todo-foot a { display: flex; align-items: center; justify-content: center; min-height: 34px; color: var(--primary); background: var(--primary-soft); border-radius: 6px; font-size: 12px; font-weight: 500; }
.todo-foot a:hover { background: var(--primary-soft-2); }
.recent-card { min-width: 0; }
.recent-card .table td { height: 51px; }
.recent-cat { display: flex; align-items: center; gap: 9px; min-width: 0; }
.recent-cat .type-mark { width: 30px; height: 30px; border-radius: 7px; }
.recent-cat .type-mark .i { width: 15px; height: 15px; }
.recent-cat b { font-weight: 500; }
.recent-cat small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.recent-tag { display: inline-block; margin-left: 4px; color: var(--primary); font-size: 12px; }
.recent-note { max-width: 230px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent-right { display: flex; flex-direction: column; gap: 12px; }
.account-mini { display: flex; flex-direction: column; }
.account-mini-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-mini-row:last-child { border-bottom: 0; padding-bottom: 0; }
.account-mini-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; color: var(--primary); background: var(--primary-soft); border-radius: 7px; }
.account-mini-icon .i { width: 14px; height: 14px; }
.account-mini-name { flex: 1; min-width: 0; font-size: 12px; }
.account-mini-name small { display: block; color: var(--muted); font-size: 12px; }
.account-mini-value { font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.account-mini-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-mini-total span { color: var(--muted); font-size: 12px; }
.account-mini-total b { font-size: 16px; font-weight: 620; letter-spacing: -.02em; }
.budget-mini-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.budget-mini-head b { font-size: 24px; font-weight: 620; letter-spacing: -.03em; }
.budget-mini-head span { color: var(--muted); font-size: 12px; }
.budget-mini .progress { margin-top: 10px; height: 8px; }
.budget-mini-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 12px; }
.budget-mini-meta .text-warning { font-weight: 550; }
.budget-mini-note { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.budget-mini-note a { color: var(--warning); }

@media (max-width: 1180px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .recent-right { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .dash-kpis .kpi { min-height: 118px; }
  .recent-right { grid-template-columns: 1fr; }
  .recent-card .table { min-width: 620px; }
  .chart-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .period-switch { width: 100%; }
  .period-switch .segmented { flex: 1; }
  .period-switch .segmented button { flex: 1; }
  .chart-card .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chart-card .card-head > div { min-width: 0; }
  .chart-card .card-head .row { width: 100%; justify-content: space-between; }
  .chart-card .card-head .sub { white-space: nowrap; }
}
/* ============================================================
   账单流水
   ============================================================ */
.bill-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.bill-stat { padding: 14px 18px; border-right: 1px solid var(--line); }
.bill-stat:last-child { border-right: 0; }
.bill-stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.bill-stat-label .i { width: 14px; height: 14px; }
.bill-stat-value { margin-top: 3px; font-size: 24px; font-weight: 620; line-height: 1.3; letter-spacing: -.03em; white-space: nowrap; }
.bill-stat-sub { margin-top: 1px; color: var(--faint); font-size: 12px; }
.bill-filter { margin-bottom: 12px; padding: 13px 16px; }
.filter-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-main .search-input { width: 238px; }
.filter-main .search-input .input { height: 34px; }
.filter-main .select { width: auto; min-width: 112px; height: 34px; font-size: 12px; }
.date-range { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; }
.date-range input { width: 110px; padding: 0; color: var(--text-2); background: transparent; border: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.date-range input:focus { outline: none; }
.date-range span { color: var(--faint); font-size: 12px; }
.filter-main .segmented { height: 34px; }
.filter-main .segmented button { height: 28px; }
.filter-main .btn { height: 34px; }
.filter-main .btn .i { width: 14px; height: 14px; }
.filter-main .btn.is-active { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.filter-extra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.filter-extra .select { width: auto; min-width: 126px; height: 32px; font-size: 12px; }
.filter-extra .input { width: 176px; height: 32px; font-size: 12px; }
.filter-extra .check-label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--muted); font-size: 12px; cursor: pointer; }
.filter-extra .check-label .checkbox { width: 24px; height: 24px; }
.active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.active-filters .chip { background: var(--primary-soft); border-color: transparent; color: var(--primary-strong); }
.active-filters .chip .i { color: var(--primary); }
.filter-summary { margin-left: auto; color: var(--muted); font-size: 12px; }
.bill-table { min-width: 990px; }
.bill-table th:first-child { width: 46px; }
.bill-table td { height: 58px; }
.bill-table .col-check { width: 46px; }
.bill-table .col-no { width: 138px; }
.bill-table .col-cat { width: 112px; }
.bill-table .col-account { width: 108px; }
.bill-table .col-amount { width: 112px; }
.bill-table .col-audit { width: 112px; }
.bill-table .col-attach { width: 58px; }
.bill-table .col-actions { width: 62px; }
.bill-no { display: block; color: var(--text-2); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: -.02em; }
.bill-time { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.cat-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.cat-inline i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--primary); }
.cat-inline.out i { background: var(--accent); }
.bill-note { max-width: 280px; overflow: hidden; color: var(--text); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.bill-tags { display: flex; gap: 5px; margin-top: 2px; overflow: hidden; white-space: nowrap; }
.bill-tags span { color: var(--primary); font-size: 12px; }
.bill-tags span + span { color: var(--muted); }
.audit-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.audit-person { color: var(--faint); font-size: 12px; }
.attach-btn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 38px; height: 28px; padding: 0 5px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-size: 12px; }
.attach-btn:hover { color: var(--primary); background: var(--primary-soft); }
.attach-btn .i { width: 14px; height: 14px; }
.no-attach { color: var(--line-strong); font-size: 12px; }
.bill-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.bill-actions .icon-btn { width: 28px; height: 28px; }
.bill-actions .icon-btn .i { width: 16px; height: 16px; }
.table-select-all { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.bill-table th .checkbox, .bill-table .checkbox { width: 24px; height: 24px; }
.batch-bar { position: fixed; left: calc(50% + var(--sidebar-w) / 2); bottom: 24px; z-index: 75; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; color: oklch(94% 0.008 92); background: var(--sidebar); border: 1px solid oklch(100% 0 0 / 0.1); border-radius: 9px; box-shadow: var(--shadow-lg); transform: translateX(-50%); }
.batch-bar[hidden] { display: none; }
.batch-count { margin-right: 6px; font-size: 12px; white-space: nowrap; }
.batch-count b { color: oklch(84% 0.08 75); font-weight: 650; }
.batch-bar .btn { height: 30px; padding: 0 9px; color: oklch(91% 0.01 92); background: oklch(100% 0 0 / 0.08); border-color: transparent; font-size: 12px; }
.batch-bar .btn:hover { background: oklch(100% 0 0 / 0.15); }
.batch-bar .btn-danger { color: oklch(80% 0.11 28); }
.batch-bar .btn .i { width: 13px; height: 13px; }
.bill-empty { padding: 56px 24px; }
.bill-empty .empty-icon { background: var(--surface-2); }

/* 单据详情抽屉 */
.drawer-bill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-bill-no { margin-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.drawer-amount { margin-top: 18px; font-size: 32px; font-weight: 650; line-height: 1.2; letter-spacing: -.045em; }
.drawer-amount.amount-in, .drawer-amount.amount-out { color: var(--text); }
.drawer-category { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.drawer-category::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.detail-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-title { margin-bottom: 11px; color: var(--muted); font-size: 12px; font-weight: 550; letter-spacing: .04em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.detail-item span { display: block; color: var(--faint); font-size: 12px; }
.detail-item b { display: block; margin-top: 2px; color: var(--text); font-size: 12px; font-weight: 500; }
.detail-note { color: var(--text-2); font-size: 12px; line-height: 1.7; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.attachment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.attach-card { overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.attach-card:hover { border-color: var(--line-strong); }
.attach-preview { position: relative; display: flex; flex-direction: column; gap: 3px; height: 74px; padding: 12px; background: oklch(97.5% 0.008 92); }
.attach-preview::after { content: ""; position: absolute; right: 10px; bottom: 8px; width: 24px; height: 24px; border: 1px solid oklch(78% 0.03 32 / 0.55); border-radius: 50%; transform: rotate(-12deg); }
.attach-preview i { display: block; width: 62%; height: 4px; background: oklch(86% 0.01 92); border-radius: 2px; }
.attach-preview i:nth-child(2) { width: 78%; }
.attach-preview i:nth-child(3) { width: 45%; }
.attach-preview i:nth-child(4) { width: 58%; margin-top: 5px; }
.attach-meta { display: flex; align-items: center; gap: 6px; padding: 7px 9px; color: var(--text-2); font-size: 12px; }
.attach-meta .i { width: 13px; height: 13px; color: var(--muted); }
.attach-meta span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.audit-timeline { position: relative; padding-left: 17px; }
.audit-timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 7px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 50%; }
.timeline-item.is-done::before { background: var(--primary); border-color: var(--primary); }
.timeline-item.is-waiting::before { border-style: dashed; }
.timeline-title { font-size: 12px; font-weight: 550; }
.timeline-title span { margin-left: 6px; color: var(--faint); font-size: 12px; font-weight: 400; }
.timeline-desc { margin-top: 2px; color: var(--muted); font-size: 12px; }
.drawer-permission { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; padding: 10px 11px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 12px; line-height: 1.55; }
.drawer-permission .i { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.drawer-bill-actions { display: flex; align-items: center; gap: 8px; }
.drawer-bill-actions .btn { flex: 1; }
.drawer-bill-actions .icon-btn { border: 1px solid var(--line-strong); }

@media (max-width: 920px) {
  .bill-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill-stat:nth-child(2) { border-right: 0; }
  .bill-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-main .search-input { width: 100%; }
  .filter-main .segmented { width: 100%; }
  .filter-main .segmented button { flex: 1; }
  .filter-main .select { flex: 1; }
  .date-range { width: 100%; justify-content: space-between; }
  .date-range input { width: 42%; }
  .filter-summary { margin-left: 0; }
  .filter-extra { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-extra .select, .filter-extra .input { width: 100%; min-width: 0; }
  .batch-bar { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); transform: none; justify-content: space-between; overflow-x: auto; }
  .batch-bar .btn span { display: none; }
  .batch-bar .btn { width: 34px; padding: 0; }
  .batch-bar .btn .i { width: 16px; height: 16px; }
}
@media (max-width: 600px) {
  .bill-stat { padding: 12px 14px; }
  .bill-stat-value { font-size: 20px; }
  .bill-filter { padding: 11px 12px; }
  .filter-extra { grid-template-columns: 1fr; }
  .attachment-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; gap: 10px; }
}
/* ============================================================
   单据录入
   ============================================================ */
[data-page="bill-new"] .mobile-bottom-nav { display: none !important; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 12px; align-items: start; }
.entry-form { overflow: hidden; }
.entry-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.entry-form-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; }
.entry-section { padding: 20px; border-bottom: 1px solid var(--line); }
.entry-section:last-child { border-bottom: 0; }
.entry-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.entry-section-title { font-size: 12px; font-weight: 600; }
.entry-section-title span { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.entry-section-sub { color: var(--muted); font-size: 12px; }
.type-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.type-tab { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 14px; font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.type-tab .i { width: 16px; height: 16px; }
.type-tab:hover { color: var(--text); }
.type-tab.is-active { background: var(--surface); box-shadow: var(--shadow-sm); }
.type-tab[data-bill-type="out"].is-active { color: var(--danger); }
.type-tab[data-bill-type="in"].is-active { color: var(--success); }
.amount-block { position: relative; margin-top: 14px; padding: 18px 20px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.amount-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.amount-label .currency { padding: 2px 6px; color: var(--faint); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; letter-spacing: .05em; }
.amount-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.amount-symbol { color: var(--text-2); font-size: 24px; font-weight: 450; }
.amount-input { width: 100%; height: 50px; padding: 0; color: var(--text); background: transparent; border: 0; font-size: 42px; font-weight: 620; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.amount-input:focus { outline: none; }
.amount-input::placeholder { color: var(--line-strong); }
.amount-input.is-income { color: var(--success); }
.amount-words { margin-top: 5px; min-height: 19px; color: var(--faint); font-size: 12px; }
.quick-amounts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.quick-amount-label { margin-right: 2px; color: var(--faint); font-size: 12px; }
.quick-amount { height: 26px; padding: 0 9px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.quick-amount:hover { border-color: var(--primary); color: var(--primary); }
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cat-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 8px 4px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.3; text-align: center; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease); }
.cat-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.cat-item.is-active { color: var(--primary-strong); background: var(--primary-soft); border-color: color-mix(in oklch, var(--primary) 48%, var(--line)); font-weight: 550; }
.cat-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); background: var(--surface-2); border-radius: 7px; }
.cat-icon .i { width: 16px; height: 16px; }
.cat-item.is-active .cat-icon { color: var(--primary); background: var(--surface); }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry-grid .field > label { font-size: 12px; }
.entry-grid .input, .entry-grid .select { height: 38px; font-size: 12px; }
.date-quick { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.date-quick button { height: 24px; padding: 0 7px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.date-quick button:hover, .date-quick button.is-active { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.tag-editor { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-height: 39px; padding: 5px 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; }
.tag-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 13%, transparent); }
.tag-editor input { flex: 1; min-width: 100px; height: 26px; padding: 0; background: transparent; border: 0; font-size: 12px; outline: none; }
.tag-chip { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 5px 0 8px; color: var(--primary-strong); background: var(--primary-soft); border-radius: 4px; font-size: 12px; }
.tag-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; color: var(--primary); background: transparent; border: 0; border-radius: 3px; }
.tag-chip button:hover { background: var(--primary-soft-2); }
.tag-chip .i { width: 11px; height: 11px; }
.suggest-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 6px; color: var(--faint); font-size: 12px; }
.suggest-tag { height: 22px; padding: 0 6px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.suggest-tag:hover { color: var(--primary); border-color: var(--primary); }
.upload-zone { display: flex; align-items: center; gap: 11px; padding: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; cursor: pointer; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; color: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.upload-icon .i { width: 17px; height: 17px; }
.upload-copy b { display: block; font-size: 12px; font-weight: 550; }
.upload-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.attachment-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.attach-thumb { display: grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--danger); background: var(--danger-soft); border-radius: 5px; }
.attach-thumb .i { width: 15px; height: 15px; }
.attach-meta { flex: 1; min-width: 0; }
.attach-meta b { display: block; overflow: hidden; color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.attach-meta small { display: block; color: var(--faint); font-size: 12px; }
.attach-item .icon-link { width: 26px; height: 26px; }
.attach-item .icon-link .i { width: 13px; height: 13px; }
.entry-actions { position: sticky; bottom: 14px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 11px 14px; background: color-mix(in oklch, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); backdrop-filter: blur(12px); }
.entry-actions-left, .entry-actions-right { display: flex; align-items: center; gap: 8px; }
.entry-actions .btn { height: 36px; }
.entry-actions .btn-primary { min-width: 134px; }
.entry-tip { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12px; }
.entry-tip .i { width: 13px; height: 13px; }
.entry-aside { position: sticky; top: 84px; }
.preview-card { overflow: hidden; }
.preview-card .card-head { padding-bottom: 12px; }
.preview-paper { position: relative; margin: 0 16px 16px; padding: 18px 16px 16px; background: var(--surface-2); border-radius: 7px; }
.preview-paper::before { content: ""; position: absolute; top: -1px; left: 14px; right: 14px; border-top: 1px dashed var(--line-strong); }
.preview-type { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.preview-amount { margin-top: 5px; font-size: 28px; font-weight: 650; line-height: 1.2; letter-spacing: -.04em; }
.preview-amount.amount-in { color: var(--success); }
.preview-amount.amount-out { color: var(--danger); }
.preview-cat { margin-top: 3px; color: var(--muted); font-size: 12px; }
.preview-divider { height: 1px; margin: 14px 0 5px; background: var(--line); }
.preview-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12px; }
.preview-row > span:first-child { flex: none; color: var(--faint); }
.preview-row > span:last-child, .preview-row > div { max-width: 68%; color: var(--text-2); text-align: right; word-break: break-all; }
.preview-tags { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.preview-tags .chip { height: 20px; font-size: 12px; }
.preview-note { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.preview-audit { padding: 0 20px 18px; }
.preview-audit-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 550; }
.audit-flow { display: flex; align-items: flex-start; gap: 4px; }
.audit-step { flex: 1; min-width: 0; }
.audit-step-dot { display: grid; place-items: center; width: 21px; height: 21px; margin-bottom: 4px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.audit-step.is-done .audit-step-dot { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.audit-step.is-waiting .audit-step-dot { border-style: dashed; }
.audit-step b { display: block; font-size: 12px; font-weight: 500; }
.audit-step span { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.audit-connector { flex: 0 0 12px; height: 1px; margin-top: 10px; background: var(--line); }
.preview-permission { display: flex; align-items: flex-start; gap: 7px; margin: 0 20px 18px; padding: 9px 10px; color: var(--muted); background: var(--surface-2); border-radius: 6px; font-size: 12px; line-height: 1.55; }
.preview-permission .i { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.category-manage-list { display: flex; flex-direction: column; }
.category-manage-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.category-manage-row:last-child { border-bottom: 0; }
.category-manage-row .cat-icon { width: 28px; height: 28px; }
.category-manage-name { flex: 1; font-size: 12px; }
.category-manage-type { color: var(--faint); font-size: 12px; }

@media (max-width: 1180px) {
  .entry-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  [data-page="bill-new"] .content { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .entry-layout { grid-template-columns: 1fr; }
  .entry-aside { display: none; }
  .entry-section { padding: 16px; }
  .entry-form-head { padding: 13px 16px; }
  .entry-grid { grid-template-columns: 1fr; gap: 12px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .amount-input { font-size: 38px; }
  .entry-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; margin: 0; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: 0 -4px 18px oklch(20% 0.02 165 / 0.08); }
  .entry-actions .btn-primary { min-width: 0; flex: 1; }
  .entry-actions-left .btn span { display: none; }
  .entry-actions-left .btn { width: 38px; padding: 0; }
  .entry-actions .entry-tip { display: none; }
}
@media (max-width: 600px) {
  .entry-section { padding: 14px 12px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cat-item { min-height: 68px; padding: 7px 2px; font-size: 12px; }
  .amount-block { padding: 15px 14px 12px; }
  .amount-input { font-size: 35px; }
  .entry-actions-right { flex: 1; }
  .entry-actions-right .btn:nth-child(2) { display: none; }
}

/* 交互尺寸补丁 */
.date-range input { height: 32px; }
.link-btn { display: inline-flex; align-items: center; min-height: 28px; }
.page-eyebrow a { display: inline-flex; align-items: center; min-height: 28px; }
.tag-chip { height: 30px; padding-right: 4px; }
.tag-chip button { width: 24px; height: 24px; }
.suggest-tag { height: 28px; padding: 0 8px; }
.attach-meta small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (min-width: 921px) {
  .entry-actions { position: static; }
}

/* ============================================================
   资金账户
   ============================================================ */
.asset-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 24px;
  align-items: center;
  min-height: 156px;
  margin-bottom: 12px;
  padding: 22px 26px;
  overflow: hidden;
  color: oklch(96% 0.008 92);
  background: repeating-linear-gradient(90deg, transparent 0 31px, oklch(100% 0 0 / 0.018) 31px 32px), var(--sidebar);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.asset-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: 22%; top: -170px; border: 1px solid oklch(100% 0 0 / 0.08); border-radius: 50%; box-shadow: 0 0 0 48px oklch(100% 0 0 / 0.014); pointer-events: none; }
.asset-kicker { display: flex; align-items: center; gap: 7px; color: oklch(73% 0.02 165); font-size: 12px; }
.asset-kicker .i { width: 14px; height: 14px; }
.asset-value { margin-top: 5px; color: oklch(99% 0 0); font-size: 38px; font-weight: 650; line-height: 1.15; letter-spacing: -.045em; }
.asset-value .unit { margin-right: 3px; color: oklch(73% 0.02 165); font-size: 16px; font-weight: 450; letter-spacing: 0; }
.asset-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; color: oklch(72% 0.02 165); font-size: 12px; }
.asset-meta .delta { color: oklch(81% 0.1 150); }
.asset-meta .dot-sep { color: oklch(52% 0.02 165); }
.asset-flow { display: flex; gap: 28px; margin-top: 18px; padding-top: 14px; border-top: 1px solid oklch(100% 0 0 / 0.1); }
.asset-flow span { display: block; color: oklch(66% 0.02 165); font-size: 12px; }
.asset-flow b { display: block; margin-top: 1px; color: oklch(95% 0.01 92); font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.asset-chart-wrap { position: relative; z-index: 1; padding-left: 16px; border-left: 1px solid oklch(100% 0 0 / 0.1); }
.asset-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: oklch(70% 0.02 165); font-size: 12px; }
.asset-chart-head b { color: oklch(88% 0.04 150); font-weight: 550; }
.asset-chart { width: 100%; height: 78px; margin-top: 6px; }
.asset-chart .line { fill: none; stroke: oklch(76% 0.075 75); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.asset-chart .area { fill: oklch(76% 0.075 75 / 0.1); }
.asset-chart .dot { fill: oklch(84% 0.07 75); stroke: var(--sidebar); stroke-width: 2; }
.asset-chart text { fill: oklch(63% 0.018 165); font-size: 12px; font-family: var(--font-sans); }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-card { padding: 17px 18px 14px; }
.account-card.is-disabled { opacity: .68; }
.account-card-head { display: flex; align-items: flex-start; gap: 10px; }
.account-card-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }
.account-card-icon .i { width: 18px; height: 18px; }
.account-card-icon[data-tone="copper"] { color: var(--accent); background: var(--accent-soft); }
.account-card-icon[data-tone="blue"] { color: var(--info); background: var(--info-soft); }
.account-card-icon[data-tone="neutral"] { color: var(--muted); background: var(--surface-2); }
.account-card-title { min-width: 0; flex: 1; }
.account-card-title h3 { overflow: hidden; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.account-card-title p { margin-top: 1px; color: var(--muted); font-size: 12px; }
.account-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin-left: 5px; color: var(--muted); background: var(--surface-2); border-radius: 4px; font-size: 12px; font-weight: 400; vertical-align: 1px; }
.account-card-balance { margin-top: 15px; font-size: 24px; font-weight: 630; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.account-card-balance .unit { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.account-card-sub { margin-top: 2px; color: var(--faint); font-size: 12px; }
.account-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.account-flow-mini { display: flex; gap: 14px; font-size: 12px; color: var(--faint); }
.account-flow-mini b { display: block; margin-top: 1px; color: var(--text-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.account-flow-mini .in b { color: var(--success); }
.account-flow-mini .out b { color: var(--danger); }
.account-card-more { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; color: var(--muted); font-size: 12px; }
.account-card-more:hover { color: var(--primary); }
.account-card-more .i { width: 14px; height: 14px; }
.account-disabled-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 14px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 12px; }
.account-disabled-note button { color: var(--primary); background: none; border: 0; font-size: 12px; }
.transfer-table td { height: 54px; }
.transfer-route { display: flex; align-items: center; gap: 7px; min-width: 0; }
.transfer-route span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.transfer-route .i { width: 14px; height: 14px; flex: none; color: var(--faint); }
.transfer-kind { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; color: var(--info); background: var(--info-soft); border-radius: 5px; font-size: 12px; white-space: nowrap; }
.fund-dist { display: flex; flex-direction: column; gap: 11px; }
.fund-dist-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 74px; align-items: center; gap: 9px; font-size: 12px; }
.fund-dist-row > span:first-child { color: var(--muted); }
.fund-dist-bar { height: 6px; overflow: hidden; background: var(--surface-3); border-radius: 6px; }
.fund-dist-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.fund-dist-row:nth-child(2) .fund-dist-bar span { background: var(--accent); }
.fund-dist-row:nth-child(3) .fund-dist-bar span { background: var(--info); }
.fund-dist-row:nth-child(4) .fund-dist-bar span { background: var(--chart-5); }
.fund-dist-row b { color: var(--text-2); font-size: 12px; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.reconcile-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.reconcile-note .i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--success); }
.transfer-swap { display: grid; place-items: center; width: 32px; height: 32px; margin: -2px auto; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--line); border-radius: 50%; }
.transfer-swap .i { width: 15px; height: 15px; }

@media (max-width: 1180px) {
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .asset-hero { grid-template-columns: 1fr; min-height: 0; padding: 18px; }
  .asset-chart-wrap { display: none; }
  .asset-value { font-size: 32px; }
  .account-grid { grid-template-columns: 1fr; }
  .asset-flow { gap: 24px; }
}

/* 资金页补丁 */
.layout-main > *, .layout-main-wide > * { min-width: 0; }
.asset-kicker .icon-link { width: 28px !important; height: 28px !important; }
.account-disabled-note button { display: inline-flex; align-items: center; min-height: 28px; white-space: nowrap; }
.fund-dist-row { grid-template-columns: 78px minmax(0, 1fr) 70px; }
.fund-dist-row > span:first-child { white-space: nowrap; }
.transfer-table { min-width: 740px; }
.transfer-table td:first-child { white-space: nowrap; }
.transfer-table td.muted { max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .account-disabled-note { align-items: flex-start; flex-wrap: wrap; }
}

/* ============================================================
   统计报表
   ============================================================ */
.analysis-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.analysis-kpi { padding: 15px 17px; }
.analysis-kpi .kpi-label { justify-content: space-between; }
.analysis-kpi .kpi-label .i { color: var(--faint); }
.analysis-kpi .kpi-value { margin-top: 5px; font-size: 24px; }
.analysis-kpi .kpi-value .unit { font-size: 12px; }
.analysis-kpi .kpi-foot { margin-top: 4px; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(310px, 1fr); gap: 12px; align-items: stretch; }
.trend-card { min-width: 0; }
.trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.trend-tools { display: flex; align-items: center; gap: 12px; }
.trend-chart-wrap { padding: 0 16px 0 12px; }
.trend-chart { width: 100%; height: auto; overflow: visible; }
.trend-chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.trend-chart .axis-text { fill: var(--muted); font-family: var(--font-sans); font-size: 12px; }
.trend-chart .income-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart .expense-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; }
.trend-chart .income-area { fill: var(--chart-fill); }
.trend-chart .expense-area { fill: oklch(59% 0.105 55 / 0.06); }
.trend-chart .dot-income { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.trend-chart .dot-expense { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.trend-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 0 20px 16px; color: var(--faint); font-size: 12px; }
.trend-foot b { color: var(--text-2); font-weight: 550; }
.donut-card { display: flex; flex-direction: column; }
.donut-card .card-body { display: flex; flex-direction: column; flex: 1; }
.donut-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 18px; }
.donut { position: relative; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--chart-2) 0 35.5%, var(--chart-3) 35.5% 57.2%, var(--chart-1) 57.2% 73.4%, var(--chart-4) 73.4% 80.2%, var(--chart-5) 80.2% 85%, var(--chart-6) 85% 100%); }
.donut::before { content: ""; position: absolute; inset: 26px; background: var(--surface); border-radius: 50%; }
.donut-center { position: absolute; inset: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center span { color: var(--muted); font-size: 12px; }
.donut-center b { margin-top: 2px; font-size: 20px; font-weight: 620; letter-spacing: -.03em; }
.donut-center small { margin-top: 2px; color: var(--faint); font-size: 12px; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; }
.donut-legend a { display: flex; align-items: center; gap: 7px; min-height: 26px; color: var(--text-2); font-size: 12px; border-radius: 4px; }
.donut-legend a:hover { color: var(--primary); background: var(--surface-2); }
.donut-legend i { width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--chart-1); }
.donut-legend a:nth-child(1) i { background: var(--chart-2); }
.donut-legend a:nth-child(2) i { background: var(--chart-3); }
.donut-legend a:nth-child(3) i { background: var(--chart-1); }
.donut-legend a:nth-child(4) i { background: var(--chart-4); }
.donut-legend a:nth-child(5) i { background: var(--chart-5); }
.donut-legend a:nth-child(6) i { background: var(--chart-6); }
.donut-legend em { margin-left: auto; color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }
.donut-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.donut-foot .i { width: 13px; height: 13px; }
.rank-card .card-body { padding-top: 8px; }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 24px 96px minmax(120px, 1fr) 104px 58px; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { color: var(--faint); font-family: var(--font-mono); font-size: 12px; text-align: center; }
.rank-row:first-child .rank-no { color: var(--accent); font-weight: 650; }
.rank-cat { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; }
.rank-cat i { width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--chart-2); }
.rank-row:nth-child(2) .rank-cat i { background: var(--chart-3); }
.rank-row:nth-child(3) .rank-cat i { background: var(--chart-1); }
.rank-row:nth-child(4) .rank-cat i { background: var(--chart-4); }
.rank-row:nth-child(5) .rank-cat i { background: var(--chart-5); }
.rank-row:nth-child(6) .rank-cat i { background: var(--chart-6); }
.rank-bar { height: 6px; overflow: hidden; background: var(--surface-3); border-radius: 6px; }
.rank-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.rank-row:nth-child(1) .rank-bar span { background: var(--accent); }
.rank-amount { color: var(--text-2); font-size: 12px; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.rank-share { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.rank-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.rank-foot a { color: var(--primary); }
.tag-card .card-body { padding-top: 10px; }
.tag-stat-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tag-stat-row:last-child { border-bottom: 0; }
.tag-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tag-stat-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.tag-stat-name .tag-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--primary); }
.tag-stat-row:nth-child(2) .tag-dot { background: var(--accent); }
.tag-stat-row:nth-child(3) .tag-dot { background: var(--info); }
.tag-stat-name span { color: var(--faint); font-size: 12px; font-weight: 400; }
.tag-stat-balance { font-size: 12px; font-weight: 550; color: var(--primary); }
.tag-stat-balance.is-negative { color: var(--danger); }
.tag-stat-bars { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.tag-bar { display: flex; align-items: center; gap: 6px; }
.tag-bar-label { width: 22px; flex: none; color: var(--faint); font-size: 12px; }
.tag-bar-track { flex: 1; height: 5px; overflow: hidden; background: var(--surface-3); border-radius: 4px; }
.tag-bar-track span { display: block; height: 100%; background: var(--success); border-radius: inherit; }
.tag-bar.out .tag-bar-track span { background: var(--accent); }
.tag-bar-value { width: 72px; flex: none; color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.tag-foot { margin-top: 8px; color: var(--faint); font-size: 12px; }
.export-strip { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, .8fr); gap: 12px; margin-top: 12px; }
.export-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; }
.export-copy h3 { font-size: 14px; font-weight: 600; }
.export-copy p { max-width: 46em; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.export-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.export-note { display: flex; align-items: flex-start; gap: 8px; padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--muted); font-size: 12px; line-height: 1.6; }
.export-note .i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--primary); }
.export-note b { display: block; margin-bottom: 2px; color: var(--text-2); font-weight: 550; }

@media (max-width: 1180px) {
  .analysis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 170px minmax(0, 1fr); }
  .donut { width: 170px; height: 170px; }
  .donut::before, .donut-center { inset: 30px; }
  .export-strip { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .analysis-kpis { grid-template-columns: 1fr; }
  .trend-head { flex-direction: column; gap: 8px; }
  .trend-tools { width: 100%; justify-content: space-between; }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .donut-legend { width: 100%; }
  .rank-row { grid-template-columns: 20px 84px minmax(50px, 1fr) 88px; }
  .rank-share { display: none; }
  .export-card { flex-direction: column; align-items: flex-start; }
  .export-actions { width: 100%; }
  .export-actions .btn { flex: 1; }
}

/* ============================================================
   经营预算
   ============================================================ */
.budget-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) 260px; gap: 24px; align-items: center; margin-bottom: 12px; padding: 22px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.budget-kicker { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.budget-kicker .i { width: 15px; height: 15px; }
.budget-value { margin-top: 4px; font-size: 36px; font-weight: 650; line-height: 1.15; letter-spacing: -.045em; }
.budget-value .unit { margin-right: 3px; color: var(--muted); font-size: 14px; font-weight: 450; letter-spacing: 0; }
.budget-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 12px; }
.budget-meta .dot-sep { color: var(--line-strong); }
.budget-progress-line { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.budget-progress-line .progress { flex: 1; height: 9px; }
.budget-progress-num { flex: none; color: var(--warning); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.budget-progress-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--faint); font-size: 12px; }
.budget-progress-legend b { color: var(--text-2); font-weight: 550; }
.budget-ring-wrap { display: flex; align-items: center; justify-content: center; gap: 16px; padding-left: 20px; border-left: 1px solid var(--line); }
.budget-ring { position: relative; width: 150px; height: 150px; flex: none; border-radius: 50%; background: conic-gradient(var(--warning) 0 88.1%, var(--surface-3) 88.1% 100%); }
.budget-ring::before { content: ""; position: absolute; inset: 16px; background: var(--surface); border-radius: 50%; }
.budget-ring-center { position: absolute; inset: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.budget-ring-center b { font-size: 24px; font-weight: 650; letter-spacing: -.04em; }
.budget-ring-center span { margin-top: 1px; color: var(--muted); font-size: 12px; }
.budget-ring-copy { display: flex; flex-direction: column; gap: 7px; }
.budget-ring-copy span { color: var(--faint); font-size: 12px; }
.budget-ring-copy b { color: var(--text-2); font-size: 12px; font-weight: 550; }
.budget-insight { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 10px 14px; color: var(--text-2); background: var(--warning-soft); border: 1px solid transparent; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.budget-insight .i { width: 15px; height: 15px; flex: none; color: var(--warning); }
.budget-insight a { margin-left: auto; color: var(--warning); white-space: nowrap; font-weight: 500; }
.budget-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.budget-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.budget-section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.budget-section-title .badge { font-weight: 500; }
.budget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.budget-card { padding: 16px 17px 14px; border-left: 3px solid var(--primary); }
.budget-card.is-warning { border-left-color: var(--warning); }
.budget-card.is-danger { border-left-color: var(--danger); background: color-mix(in oklch, var(--danger-soft) 22%, var(--surface)); }
.budget-card-head { display: flex; align-items: flex-start; gap: 9px; }
.budget-card-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--primary); background: var(--primary-soft); border-radius: 7px; }
.budget-card-icon .i { width: 16px; height: 16px; }
.budget-card.is-warning .budget-card-icon { color: var(--warning); background: var(--warning-soft); }
.budget-card.is-danger .budget-card-icon { color: var(--danger); background: var(--danger-soft); }
.budget-card-title { min-width: 0; flex: 1; }
.budget-card-title h3 { font-size: 12px; font-weight: 600; }
.budget-card-title p { margin-top: 1px; color: var(--muted); font-size: 12px; }
.budget-numbers { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 13px; }
.budget-used { font-size: 24px; font-weight: 630; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.budget-used small { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.budget-total { color: var(--muted); font-size: 12px; text-align: right; }
.budget-total b { display: block; color: var(--text-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.budget-card .progress { height: 7px; margin-top: 10px; }
.budget-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--faint); font-size: 12px; }
.budget-card-foot b { font-weight: 550; }
.budget-card-foot .over { color: var(--danger); }
.budget-card-foot .near { color: var(--warning); }
.budget-card-foot a { display: inline-flex; align-items: center; min-height: 24px; color: var(--primary); }
.budget-side { display: flex; flex-direction: column; gap: 12px; }
.settings-card .card-body { padding-top: 8px; }
.cycle-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.cycle-line span { color: var(--muted); font-size: 12px; }
.cycle-line b { font-size: 12px; font-weight: 550; text-align: right; }
.switch-title-row { display: flex; align-items: center; gap: 6px; }
.switch-title-row .badge { height: 18px; font-size: 12px; }
.budget-rule { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 12px; line-height: 1.55; }
.budget-rule .i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--primary); }
.budget-history { display: flex; flex-direction: column; }
.budget-history-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.budget-history-row:last-child { border-bottom: 0; padding-bottom: 0; }
.budget-history-dot { width: 6px; height: 6px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--line-strong); }
.budget-history-row:first-child .budget-history-dot { background: var(--primary); }
.budget-history-copy { flex: 1; min-width: 0; font-size: 12px; }
.budget-history-copy b { display: block; font-weight: 500; }
.budget-history-copy span { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.budget-history-amount { flex: none; color: var(--text-2); font-size: 12px; font-weight: 550; }

@media (max-width: 1180px) {
  .budget-layout { grid-template-columns: 1fr; }
  .budget-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .budget-side > :last-child { grid-column: span 2; }
}
@media (max-width: 920px) {
  .budget-hero { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .budget-ring-wrap { justify-content: flex-start; padding-left: 0; padding-top: 14px; border-left: 0; border-top: 1px solid var(--line); }
  .budget-ring { width: 116px; height: 116px; }
  .budget-ring::before, .budget-ring-center { inset: 13px; }
  .budget-value { font-size: 32px; }
}
@media (max-width: 700px) {
  .budget-grid { grid-template-columns: 1fr; }
  .budget-side { grid-template-columns: 1fr; }
  .budget-side > :last-child { grid-column: auto; }
  .budget-insight { align-items: flex-start; flex-wrap: wrap; }
  .budget-insight a { margin-left: 24px; }
  .budget-card { padding: 14px; }
}

.budget-insight a { display: inline-flex; align-items: center; min-height: 28px; }
.budget-ring-copy span { white-space: nowrap; }

/* ============================================================
   应收应付
   ============================================================ */
.ar-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ar-summary-card { padding: 15px 17px; }
.ar-summary-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.ar-summary-label .i { width: 14px; height: 14px; color: var(--faint); }
.ar-summary-value { margin-top: 5px; font-size: 24px; font-weight: 630; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.ar-summary-value .unit { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.ar-summary-sub { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--faint); font-size: 12px; }
.ar-summary-sub .text-danger { font-weight: 550; }
.ar-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ar-toolbar .search-input { width: 230px; }
.ar-toolbar .search-input .input { height: 34px; }
.ar-toolbar .select { width: auto; min-width: 106px; height: 34px; font-size: 12px; }
.ar-toolbar .segmented { height: 34px; }
.ar-toolbar .segmented button { height: 28px; }
.ar-toolbar .btn { height: 34px; }
.ar-table { min-width: 1010px; }
.ar-table td { height: 61px; }
.ar-party { display: flex; align-items: center; gap: 8px; }
.ar-party .avatar { width: 30px; height: 30px; font-size: 12px; }
.ar-party b { display: block; max-width: 120px; overflow: hidden; font-size: 12px; font-weight: 550; white-space: nowrap; text-overflow: ellipsis; }
.ar-party small { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.ar-type { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 6px; color: var(--success); background: var(--success-soft); border-radius: 5px; font-size: 12px; white-space: nowrap; }
.ar-type.is-payable { color: var(--accent); background: var(--accent-soft); }
.ar-amount { font-variant-numeric: tabular-nums; }
.ar-remaining { color: var(--text); font-size: 12px; font-weight: 570; font-variant-numeric: tabular-nums; }
.ar-progress { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.ar-progress .progress { width: 52px; height: 4px; }
.ar-progress span { color: var(--faint); font-size: 12px; white-space: nowrap; }
.ar-due { white-space: nowrap; }
.ar-due small { display: block; color: var(--faint); font-size: 12px; }
.ar-due.is-overdue { color: var(--danger); font-weight: 550; }
.ar-status { white-space: nowrap; }
.ar-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.ar-actions .btn { height: 28px; padding: 0 8px; font-size: 12px; }
.ar-actions .icon-btn { width: 28px; height: 28px; }
.ar-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.due-list { display: flex; flex-direction: column; }
.due-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.due-row:last-child { border-bottom: 0; padding-bottom: 0; }
.due-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; background: var(--surface-2); border-radius: 7px; }
.due-date b { font-size: 12px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.due-date span { color: var(--faint); font-size: 12px; }
.due-copy { flex: 1; min-width: 0; }
.due-copy b { display: block; overflow: hidden; font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.due-copy span { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.due-amount { flex: none; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.reminder-list { display: flex; flex-direction: column; }
.reminder-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.reminder-row:last-child { border-bottom: 0; padding-bottom: 0; }
.reminder-check { width: 20px; height: 20px; }
.reminder-copy { flex: 1; min-width: 0; }
.reminder-copy b { display: block; font-size: 12px; font-weight: 500; }
.reminder-copy span { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.reminder-row .btn { height: 27px; padding: 0 8px; font-size: 12px; }
.writeoff-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.writeoff-summary div { padding: 10px; background: var(--surface-2); border-radius: 7px; }
.writeoff-summary span { display: block; color: var(--faint); font-size: 12px; }
.writeoff-summary b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.writeoff-party { display: flex; align-items: center; gap: 9px; padding: 12px 14px; margin-bottom: 16px; background: var(--primary-soft); border-radius: 8px; }
.writeoff-party .avatar { background: var(--surface); }
.writeoff-party b { display: block; font-size: 12px; font-weight: 600; }
.writeoff-party span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.writeoff-party .badge { margin-left: auto; }

@media (max-width: 1180px) {
  .ar-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .ar-toolbar .search-input { width: 100%; }
  .ar-toolbar .segmented { width: 100%; overflow-x: auto; }
  .ar-toolbar .segmented button { flex: 1; }
  .ar-toolbar .select { flex: 1; }
}
@media (max-width: 600px) {
  .ar-summary { grid-template-columns: 1fr; }
  .ar-summary-card { padding: 13px 14px; }
  .ar-summary-value { font-size: 24px; }
  .writeoff-summary { grid-template-columns: 1fr; }
}

/* 往来表格列宽 */
.ar-table { min-width: 1060px; }
.ar-table th:nth-child(1) { width: 166px; }
.ar-table th:nth-child(2) { width: 64px; }
.ar-table th:nth-child(3) { width: 150px; }
.ar-table th:nth-child(4) { width: 94px; }
.ar-table th:nth-child(5) { width: 150px; }
.ar-table th:nth-child(6) { width: 92px; }
.ar-table th:nth-child(7) { width: 88px; }
.ar-table th:nth-child(8) { width: 86px; }
.ar-table th:nth-child(9) { width: 112px; }
.ar-table td { white-space: nowrap; }
.ar-party b, .ar-party small { white-space: nowrap; }
.ar-table .cell-sub { white-space: nowrap; }
.reminder-check { width: 24px; height: 24px; }

/* ============================================================
   账套管理
   ============================================================ */
.books-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.books-summary-card { padding: 14px 17px; }
.books-summary-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.books-summary-label .i { width: 14px; height: 14px; color: var(--faint); }
.books-summary-value { margin-top: 4px; font-size: 24px; font-weight: 620; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.books-summary-value .unit { margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.books-summary-sub { margin-top: 2px; color: var(--faint); font-size: 12px; }
.books-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.books-toolbar .search-input { width: 240px; }
.books-toolbar .search-input .input { height: 34px; }
.books-toolbar .select { width: auto; min-width: 112px; height: 34px; font-size: 12px; }
.books-toolbar .btn { height: 34px; }
.books-toolbar .filter-summary { margin-left: auto; color: var(--muted); font-size: 12px; }
.books-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.book-card { overflow: hidden; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.book-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.book-card.is-archived { opacity: .82; }
.book-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 94px;
  padding: 15px 18px;
  overflow: hidden;
  color: oklch(96% 0.008 92);
  background: repeating-linear-gradient(90deg, transparent 0 23px, oklch(100% 0 0 / 0.03) 23px 24px), var(--sidebar);
}
.book-cover[data-cover="store"] { background: repeating-linear-gradient(90deg, transparent 0 23px, oklch(100% 0 0 / 0.03) 23px 24px), oklch(49% 0.09 55); }
.book-cover[data-cover="project"] { background: repeating-linear-gradient(90deg, transparent 0 23px, oklch(100% 0 0 / 0.03) 23px 24px), oklch(39% 0.075 235); }
.book-cover[data-cover="agency"] { background: repeating-linear-gradient(90deg, transparent 0 23px, oklch(100% 0 0 / 0.03) 23px 24px), oklch(42% 0.06 130); }
.book-cover[data-cover="archived"] { background: repeating-linear-gradient(90deg, transparent 0 23px, oklch(100% 0 0 / 0.025) 23px 24px), oklch(44% 0.015 165); }
.book-cover::after { content: ""; position: absolute; right: -36px; top: -86px; width: 210px; height: 210px; border: 1px solid oklch(100% 0 0 / 0.11); border-radius: 50%; box-shadow: 0 0 0 32px oklch(100% 0 0 / 0.025), 0 0 0 64px oklch(100% 0 0 / 0.018); pointer-events: none; }
.book-cover-char { position: absolute; right: 76px; bottom: 12px; color: oklch(100% 0 0 / 0.09); font-size: 58px; font-weight: 700; line-height: 1; pointer-events: none; }
.book-cover-meta { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.book-cover-type { display: inline-flex; align-items: center; gap: 4px; width: fit-content; height: 21px; padding: 0 7px; color: oklch(94% 0.01 92); background: oklch(100% 0 0 / 0.14); border: 1px solid oklch(100% 0 0 / 0.14); border-radius: 4px; font-size: 12px; backdrop-filter: blur(2px); }
.book-cover-period { color: oklch(82% 0.015 92); font-size: 12px; }
.book-cover-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 2px; align-self: flex-start; }
.book-cover-actions .icon-btn { width: 30px; height: 30px; color: oklch(86% 0.01 92); }
.book-cover-actions .icon-btn:hover { color: #fff; background: oklch(100% 0 0 / 0.14); }
.book-cover-actions .is-active { color: oklch(86% 0.08 75); }
.book-cover-actions .i { width: 15px; height: 15px; }
.book-archived-label { position: absolute; right: 16px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; color: oklch(93% 0.01 92); background: oklch(20% 0.01 165 / 0.6); border: 1px solid oklch(100% 0 0 / 0.15); border-radius: 4px; font-size: 12px; }
.book-body { padding: 15px 18px 14px; }
.book-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book-title { font-size: 14px; font-weight: 620; letter-spacing: -.015em; }
.book-title-row .book-role { margin-top: 3px; color: var(--muted); font-size: 12px; }
.book-company { margin-top: 3px; color: var(--faint); font-size: 12px; }
.book-members { display: flex; align-items: center; gap: 6px; flex: none; }
.book-members .avatar { width: 24px; height: 24px; font-size: 12px; }
.book-members .avatar-more { background: var(--surface-2); color: var(--muted); }
.book-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.book-metric span { display: block; color: var(--faint); font-size: 12px; }
.book-metric b { display: block; margin-top: 1px; color: var(--text-2); font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.book-metric b.in { color: var(--success); }
.book-metric b.out { color: var(--danger); }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; }
.book-foot-note { color: var(--faint); font-size: 12px; }
.book-foot-actions { display: flex; align-items: center; gap: 6px; }
.book-foot-actions .btn { height: 30px; padding: 0 10px; font-size: 12px; }
.book-foot-actions .icon-btn { width: 30px; height: 30px; }
.book-card.is-archived .book-metrics { opacity: .8; }
.book-card.is-archived .book-cover-char { right: 142px; }
.book-security { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; margin-top: 12px; padding: 18px 20px; }
.book-security-main h2 { font-size: 14px; font-weight: 600; }
.book-security-main p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.book-security-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-top: 10px; }
.book-security-side { display: flex; flex-direction: column; gap: 8px; padding-left: 24px; border-left: 1px solid var(--line); }
.book-security-side .btn { justify-content: flex-start; }
.book-security-side .field-hint { line-height: 1.6; }
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template-card { display: flex; flex-direction: column; gap: 3px; padding: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.template-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.template-card.is-selected { background: var(--primary-soft); border-color: color-mix(in oklch, var(--primary) 50%, var(--line)); }
.template-card .template-head { display: flex; align-items: center; gap: 7px; }
.template-card .type-mark { width: 28px; height: 28px; border-radius: 6px; }
.template-card .type-mark .i { width: 14px; height: 14px; }
.template-card b { font-size: 12px; font-weight: 600; }
.template-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.template-card small { color: var(--faint); font-size: 12px; }
.archive-visual { display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-bottom: 14px; background: var(--warning-soft); border-radius: 8px; }
.archive-visual .type-mark { background: var(--surface); color: var(--warning); }
.archive-visual b { display: block; font-size: 12px; font-weight: 600; }
.archive-visual span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }

@media (max-width: 1180px) {
  .books-grid { grid-template-columns: 1fr; }
  .book-security { grid-template-columns: 1fr; }
  .book-security-side { padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 920px) {
  .books-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-toolbar .search-input { width: 100%; }
  .books-toolbar .select { flex: 1; }
  .book-security-switches { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .books-summary { grid-template-columns: 1fr; }
  .book-cover { height: 84px; padding: 13px 14px; }
  .book-cover-char { font-size: 54px; right: 56px; bottom: 8px; }
  .book-card.is-archived .book-cover-char { right: 118px; }
  .book-body { padding: 13px 14px; }
  .book-metrics { grid-template-columns: 1fr 1fr; }
  .book-metric:last-child { grid-column: span 2; }
  .book-security { padding: 15px 14px; }
  .template-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   成员与权限
   ============================================================ */
.member-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.member-layout > * { min-width: 0; }
.member-table th:nth-child(1) { width: 190px; }
.member-table th:nth-child(2) { width: 118px; }
.member-table th:nth-child(3) { width: 170px; }
.member-table th:nth-child(4) { width: 96px; }
.member-table th:nth-child(5) { width: 80px; }
.member-table th:nth-child(6) { width: 46px; }
.member-table td:nth-child(4) { white-space: nowrap; }
.member-table { min-width: 700px; }
.member-table td { height: 62px; }
.member-person { display: flex; align-items: center; gap: 9px; }
.member-person b { display: block; font-size: 12px; font-weight: 550; }
.member-person small { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.member-role-select { width: 112px; height: 31px; padding-left: 9px; font-size: 12px; }
.member-cat { display: flex; gap: 4px; flex-wrap: wrap; }
.member-cat .chip { height: 21px; font-size: 12px; }
.member-status { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--success); font-size: 12px; }
.member-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.member-status.is-offline { color: var(--faint); }
.member-status.is-invited { color: var(--warning); }
.member-actions { display: flex; gap: 2px; justify-content: flex-end; }
.member-actions .icon-btn { width: 28px; height: 28px; }
.member-side { display: flex; flex-direction: column; gap: 12px; }
.seat-usage { padding: 12px; background: var(--surface-2); border-radius: 8px; }
.seat-usage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.seat-usage-head b { font-size: 12px; font-weight: 600; }
.seat-usage .progress { margin-top: 7px; height: 6px; }
.seat-usage-foot { margin-top: 5px; color: var(--faint); font-size: 12px; }
.member-side .card-body { padding-top: 8px; }
.role-matrix-card { margin-top: 12px; overflow: hidden; }
.role-matrix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.role-matrix-head h2 { font-size: 14px; font-weight: 600; }
.role-matrix-head p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.permission-matrix { min-width: 760px; }
.permission-matrix th { text-align: center; }
.permission-matrix th:first-child, .permission-matrix td:first-child { width: 190px; text-align: left; }
.permission-matrix td { height: 43px; text-align: center; font-size: 12px; }
.permission-matrix td:first-child { color: var(--text-2); font-weight: 500; }
.permission-matrix .col-admin { background: color-mix(in oklch, var(--primary-soft) 65%, transparent); }
.permission-matrix th.col-admin { color: var(--primary-strong); }
.matrix-yes { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 auto; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.matrix-yes .i { width: 12px; height: 12px; }
.matrix-no { color: var(--line-strong); }
.matrix-text { color: var(--muted); font-size: 12px; }
.role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-option { display: flex; align-items: flex-start; gap: 8px; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.role-option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.role-option.is-selected { background: var(--primary-soft); border-color: color-mix(in oklch, var(--primary) 42%, var(--line)); }
.role-option .radio-mark { display: grid; place-items: center; width: 16px; height: 16px; flex: none; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 50%; }
.role-option.is-selected .radio-mark { border: 5px solid var(--primary); }
.role-option b { display: block; font-size: 12px; font-weight: 600; }
.role-option span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.role-option .badge { margin-left: 4px; }
.change-password-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.change-password-card span { color: var(--muted); font-size: 12px; }
.change-password-card .btn { height: 30px; font-size: 12px; }

@media (max-width: 1320px) {
  .member-layout { grid-template-columns: 1fr; }
  .member-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 920px) {
  .member-side { grid-template-columns: 1fr; }
  .member-table { min-width: 820px; }
  .member-layout .table-wrap { max-width: 100%; }
}
@media (max-width: 600px) {
  .role-cards { grid-template-columns: 1fr; }
}

.role-option:has(input:checked) { background: var(--primary-soft); border-color: color-mix(in oklch, var(--primary) 42%, var(--line)); }
.role-option:has(input:checked) .radio-mark { border: 5px solid var(--primary); }
.member-side .section-link { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; }

/* ============================================================
   操作日志
   ============================================================ */
.log-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.log-toolbar .search-input { width: 240px; }
.log-toolbar .search-input .input { height: 34px; }
.log-toolbar .select { width: auto; min-width: 108px; height: 34px; font-size: 12px; }
.log-toolbar .date-range { height: 34px; }
.log-toolbar .segmented { height: 34px; }
.log-toolbar .segmented button { height: 28px; }
.log-toolbar .btn { height: 34px; }
.log-table { min-width: 980px; }
.log-table td { height: 56px; }
.log-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-time b { display: block; color: var(--text-2); font-size: 12px; font-weight: 500; }
.log-time span { display: block; color: var(--faint); font-size: 12px; }
.log-person { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.log-person .avatar { width: 26px; height: 26px; font-size: 12px; }
.log-person span { font-size: 12px; }
.log-action { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.log-action.create { color: var(--success); background: var(--success-soft); }
.log-action.edit { color: var(--info); background: var(--info-soft); }
.log-action.delete { color: var(--danger); background: var(--danger-soft); }
.log-action.audit { color: var(--primary-strong); background: var(--primary-soft); }
.log-action.archive { color: var(--warning); background: var(--warning-soft); }
.log-action.export { color: var(--muted); background: var(--surface-2); }
.log-object { display: flex; flex-direction: column; white-space: nowrap; }
.log-object b { font-size: 12px; font-weight: 500; }
.log-object small { margin-top: 1px; color: var(--faint); font-size: 12px; }
.log-summary { max-width: 280px; overflow: hidden; color: var(--text-2); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.log-ip { color: var(--faint); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.log-detail { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; color: var(--primary); font-size: 12px; white-space: nowrap; }
.log-detail .i { width: 13px; height: 13px; }
.log-foot-note { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12px; }
.log-foot-note .i { width: 13px; height: 13px; }
.diff-intro { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin-bottom: 14px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 12px; line-height: 1.55; }
.diff-intro .i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--primary); }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-panel { overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; }
.diff-panel-head { padding: 7px 10px; color: var(--muted); background: var(--surface-3); font-size: 12px; font-weight: 550; }
.diff-panel pre { margin: 0; padding: 10px; overflow-x: auto; color: var(--text-2); font-family: var(--font-mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-all; }
.diff-panel.after pre { color: var(--success); background: var(--success-soft); }
.diff-panel.before pre { color: var(--danger); background: var(--danger-soft); }
.log-meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.log-meta-list div { padding: 9px 10px; background: var(--surface-2); border-radius: 6px; }
.log-meta-list span { display: block; color: var(--faint); font-size: 12px; }
.log-meta-list b { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; }

@media (max-width: 1180px) {
  .log-toolbar .search-input { width: 100%; }
}
@media (max-width: 600px) {
  .diff-grid { grid-template-columns: 1fr; }
  .log-meta-list { grid-template-columns: 1fr; }
}

/* ============================================================
   单据打印
   ============================================================ */
.print-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 24px auto 0; }
.print-toolbar .btn { height: 36px; }
.print-page { max-width: 760px; margin: 14px auto 40px; padding: 42px 46px 38px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: #1f2724; }
.print-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #1f3d35; }
.print-brand-left { display: flex; align-items: center; gap: 9px; }
.print-brand-left .brand-mark { width: 30px; height: 30px; background: #1f3d35; color: #fff; }
.print-brand-left b { font-size: 14px; }
.print-brand-left span { display: block; color: #6b7671; font-size: 12px; }
.print-doc-title { text-align: right; }
.print-doc-title b { display: block; font-size: 20px; letter-spacing: .05em; }
.print-doc-title span { display: block; margin-top: 1px; color: #6b7671; font-family: var(--font-mono); font-size: 12px; }
.print-company { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 20px 0 12px; }
.print-company h2 { font-size: 16px; font-weight: 600; }
.print-company p { margin-top: 3px; color: #6b7671; font-size: 12px; line-height: 1.6; }
.print-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; min-width: 300px; font-size: 12px; }
.print-meta-grid div { display: flex; justify-content: space-between; gap: 10px; }
.print-meta-grid span { color: #6b7671; }
.print-meta-grid b { font-weight: 500; text-align: right; }
.print-amount-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 14px 0 18px; padding: 14px 16px; background: #f5f3ee; border-radius: 5px; }
.print-amount-box span { color: #6b7671; font-size: 12px; }
.print-amount-box b { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.print-amount-box b.out { color: #a33d34; }
.print-amount-box b.in { color: #276b53; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th { padding: 8px 10px; color: #6b7671; background: #f1efe9; border-top: 1px solid #dcd8ce; border-bottom: 1px solid #dcd8ce; font-size: 12px; font-weight: 550; text-align: left; }
.print-table td { padding: 11px 10px; border-bottom: 1px solid #e6e2d8; font-size: 12px; vertical-align: top; }
.print-table .align-right { text-align: right; }
.print-note { margin-top: 16px; padding: 10px 12px; color: #4c5752; background: #f8f6f1; border: 1px solid #e6e2d8; border-radius: 4px; font-size: 12px; line-height: 1.7; }
.print-audit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #dcd8ce; }
.print-audit span { display: block; color: #6b7671; font-size: 12px; }
.print-audit b { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; }
.print-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 34px; }
.print-sign div { padding-top: 26px; border-top: 1px solid #9aa39f; color: #6b7671; font-size: 12px; }
.print-stamp { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-left: auto; color: #a33d34; border: 2px solid #a33d34; border-radius: 50%; font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center; transform: rotate(-9deg); }
.print-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 10px; color: #8a938f; border-top: 1px dashed #dcd8ce; font-size: 12px; }
.print-code { font-family: var(--font-mono); letter-spacing: .04em; }
@media (max-width: 760px) {
  .print-toolbar { padding: 0 14px; margin-top: 14px; }
  .print-page { margin: 10px; padding: 24px 18px; }
  .print-company { flex-direction: column; }
  .print-meta-grid { min-width: 0; width: 100%; }
  .print-audit, .print-sign { grid-template-columns: 1fr; gap: 12px; }
  .print-stamp { margin: 8px 0 0; }
}
@media print {
  .print-toolbar { display: none !important; }
  .print-page { margin: 0; border: 0; box-shadow: none; max-width: none; padding: 18mm 16mm; }
  body { background: #fff; }
}

.rank-foot a { display: inline-flex; align-items: center; min-height: 28px; }
.print-doc-title span { white-space: nowrap; }
.print-foot { color: #59635f; }
.print-amount-box span { color: #59635f; }
.print-table th { color: #59635f; }
.print-table td:nth-child(2) { white-space: nowrap; }
@media (max-width: 600px) {
  .print-table th:nth-child(1), .print-table td:nth-child(1),
  .print-table th:nth-child(2), .print-table td:nth-child(2) { display: none; }
  .print-table th { white-space: nowrap; }
  .print-table th:nth-child(3) { width: auto; }
  .print-table th:nth-child(4) { width: 92px; }
}

.print-cat-inline { display: none; }
@media (max-width: 600px) { .print-cat-inline { display: inline; font-weight: 500; } }
.print-doc-title { flex: none; }
.print-doc-title b { white-space: nowrap; }

/* ============================================================
   周期记账
   ============================================================ */
.cycle-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
.cycle-layout > * { min-width: 0; }
.cycle-table { min-width: 620px; }
.cycle-table td { height: 60px; }
.cycle-table th:nth-child(1) { width: 222px; }
.cycle-table th:nth-child(2) { width: 90px; }
.cycle-table th:nth-child(3) { width: 190px; }
.cycle-table th:nth-child(4) { width: 84px; }
.cycle-name { display: flex; align-items: center; gap: 9px; }
.cycle-name .type-mark { width: 30px; height: 30px; border-radius: 7px; }
.cycle-name .type-mark .i { width: 15px; height: 15px; }
.cycle-name b { display: block; font-size: 12px; font-weight: 550; }
.cycle-name small { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.cycle-schedule b { display: block; font-size: 12px; font-weight: 500; }
.cycle-schedule small { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; }
.cycle-next { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.cycle-next .i { width: 13px; height: 13px; color: var(--faint); }
.cycle-next.is-paused { color: var(--faint); }
.cycle-actions { display: flex; justify-content: flex-end; gap: 3px; }
.cycle-actions .btn { height: 28px; padding: 0 8px; font-size: 12px; }
.cycle-actions .icon-btn { width: 28px; height: 28px; }
.pending-cycle { display: flex; flex-direction: column; }
.pending-cycle-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pending-cycle-item:last-child { border-bottom: 0; padding-bottom: 0; }
.pending-cycle-head { display: flex; align-items: flex-start; gap: 9px; }
.pending-cycle-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; color: var(--warning); background: var(--warning-soft); border-radius: 7px; }
.pending-cycle-date b { font-size: 14px; font-weight: 650; line-height: 1.1; }
.pending-cycle-date span { font-size: 12px; }
.pending-cycle-copy { flex: 1; min-width: 0; }
.pending-cycle-copy b { display: block; font-size: 12px; font-weight: 550; }
.pending-cycle-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.pending-cycle-amount { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pending-cycle-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-left: 49px; }
.pending-cycle-foot span { color: var(--faint); font-size: 12px; }
.pending-cycle-foot .row { gap: 5px; }
.pending-cycle-foot .btn { height: 28px; padding: 0 9px; font-size: 12px; }
.cycle-rules { display: flex; flex-direction: column; gap: 0; }
.cycle-rule-step { position: relative; display: flex; align-items: flex-start; gap: 10px; padding-bottom: 14px; }
.cycle-rule-step:last-child { padding-bottom: 0; }
.cycle-rule-step::before { content: ""; position: absolute; left: 10px; top: 23px; bottom: 0; width: 1px; background: var(--line); }
.cycle-rule-step:last-child::before { display: none; }
.cycle-rule-dot { display: grid; place-items: center; width: 21px; height: 21px; flex: none; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.cycle-rule-step.is-done .cycle-rule-dot { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.cycle-rule-copy b { display: block; font-size: 12px; font-weight: 550; }
.cycle-rule-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.cycle-rule-note { margin-top: 12px; padding: 10px 11px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 12px; line-height: 1.55; }
.cycle-rule-note b { color: var(--text-2); font-weight: 550; }
.cycle-confirm-box { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 14px; background: var(--warning-soft); border-radius: 8px; }
.cycle-confirm-box .type-mark { background: var(--surface); color: var(--warning); }
.cycle-confirm-box b { display: block; font-size: 13px; font-weight: 600; }
.cycle-confirm-box span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .cycle-layout { grid-template-columns: 1fr; }
  .cycle-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 720px) {
  .cycle-side { grid-template-columns: 1fr; }
  .cycle-layout { grid-template-columns: 1fr; }
  .pending-cycle-foot { padding-left: 0; flex-wrap: wrap; }
}

.cycle-table .cycle-schedule small { white-space: nowrap; }

/* ============================================================
   拍照识图记账
   ============================================================ */
.ocr-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; align-items: start; }
.ocr-capture { min-width: 0; }
.ocr-preview-wrap { position: relative; display: flex; align-items: center; justify-content: center; height: 250px; overflow: hidden; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; }
.ocr-preview-wrap iframe { border-radius: 0; }
.ocr-preview-wrap img, .ocr-preview-wrap video { width: 100%; height: 100%; object-fit: contain; background: #111; }
.ocr-preview-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.ocr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 20px; color: var(--muted); text-align: center; }
.ocr-placeholder .i { width: 30px; height: 30px; margin-bottom: 3px; color: var(--primary); }
.ocr-placeholder b { font-size: 13px; font-weight: 550; color: var(--text-2); }
.ocr-placeholder span { max-width: 260px; font-size: 12px; line-height: 1.55; }
.ocr-capture-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ocr-capture-actions .btn { height: 34px; }
.ocr-hint { margin-top: 8px; color: var(--faint); font-size: 12px; line-height: 1.55; }
.ocr-result { min-height: 250px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.ocr-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 220px; color: var(--muted); text-align: center; }
.ocr-empty .i { width: 28px; height: 28px; color: var(--faint); }
.ocr-empty b { font-size: 13px; font-weight: 550; color: var(--text-2); }
.ocr-empty span { max-width: 240px; font-size: 12px; line-height: 1.6; }
.ocr-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ocr-confidence { color: var(--faint); font-size: 12px; }
.ocr-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ocr-fields div { min-width: 0; padding: 8px 9px; background: var(--surface); border-radius: 6px; }
.ocr-fields span { display: block; color: var(--faint); font-size: 12px; }
.ocr-fields b { display: block; margin-top: 2px; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.ocr-fields .span-2 { grid-column: span 2; }
.ocr-raw { margin-top: 12px; padding: 9px 11px; background: var(--surface-2); border-radius: 7px; }
.ocr-raw summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.ocr-raw pre { max-height: 150px; margin: 8px 0 0; overflow: auto; color: var(--text-2); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 760px) {
  .ocr-layout { grid-template-columns: 1fr; }
  .ocr-preview-wrap { height: 220px; }
  .ocr-fields { grid-template-columns: 1fr; }
  .ocr-fields .span-2 { grid-column: auto; }
}
.attach-thumb.is-pdf { color: #9c3b2e; background: #f7e7e2; font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.attach-pdf { display: grid; place-items: center; height: 74px; color: #9c3b2e; background: oklch(97.5% 0.018 32); font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.attach-card.is-pdf .attach-meta { border-top: 1px solid var(--line); }

/* 套餐与用量 */
.billing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.billing-plan { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.billing-plan.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.billing-plan h3 { margin: 0; font-size: 15px; }
.billing-plan .billing-price { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
.billing-plan .billing-price small { color: var(--muted); font-family: var(--font-sans); font-size: 11px; font-weight: 400; }
.billing-plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; color: var(--text-2); font-size: 12px; }
.billing-plan li::before { content: "·"; margin-right: 5px; color: var(--primary); }
.billing-plan .btn { margin-top: auto; }
.billing-plan-note { color: var(--faint); font-size: 11px; line-height: 1.5; }
.billing-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.billing-usage .progress { margin-top: 5px; }
@media (max-width: 900px) { .billing-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .billing-grid, .billing-usage { grid-template-columns: 1fr; } }

/* 注册 */
.signup-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(circle at 15% 10%, var(--primary-soft), transparent 35%), var(--bg); }
.signup-card { width: min(520px, 100%); padding: 28px 30px 24px; }
.signup-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.signup-brand > span:nth-child(2) { display: grid; gap: 2px; }
.signup-brand b { font-family: var(--font-display); font-size: 15px; }
.signup-brand small { color: var(--muted); font-size: 11px; }
.signup-brand .section-link { margin-left: auto; font-size: 12px; }
.signup-card .login-form { gap: 10px; }
.signup-card .login-submit { margin-top: 6px; }
@media (max-width: 560px) { .signup-card { padding: 22px 18px; } .signup-brand { flex-wrap: wrap; } .signup-brand .section-link { width: 100%; margin-left: 42px; } }
