/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V3 · genre: modern-minimal · macrostructure: Workbench · theme: studied-DNA (source: user reference image) · accent: warm-orange · contrast: pass (40–41) · nav: N3 · footer: none · honest: pass (46) · chrome: pass (47) · tokens: pass (dark-theme delta) · responsive: pass (34, 49, 50–57) · designed-as-app */
@font-face {
  font-family: "HarmonyOS Sans Embedded";
  src: url("assets/fonts/HarmonyOS_Sans_SC_Regular.woff2") format("woff2"), url("assets/fonts/HarmonyOS_Sans_SC_Regular.ttf") format("truetype");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans Embedded";
  src: url("assets/fonts/HarmonyOS_Sans_SC_Bold.woff2") format("woff2"), url("assets/fonts/HarmonyOS_Sans_SC_Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --primary: #3B5BFD;
  --primary-deep: #2F4BD8;
  --primary-light: #E8EDFF;
  --on-primary: #FFFFFF;
  --chart-revenue: #3B5BFD;
  --chart-margin: #18A87A;
  --chart-refund: #F59E0B;
  --chart-roi: #8B5CF6;
  --sidebar: #1E2A4A;
  --sidebar-2: #253158;
  --sidebar-ink: #FFFFFF;
  --sidebar-muted: #C9D2E8;
  --control-bg: #FFFFFF;
  --overlay-bg: #1E2A4A;
  --overlay-border: #586887;
  --sidebar-active-bg: #3B5BFD;
  --sidebar-active-border: transparent;
  --sidebar-active-ink: #FFFFFF;
  --nav-surface: #FFFFFF;
  --nav-surface-2: #F7FAFF;
  --nav-ink: #1B2D4E;
  --nav-muted: #66758F;
  --nav-border: #E4EAF3;
  --nav-hover: #EEF4FF;
  --nav-soft: #F1F5FC;
  --nav-shadow: 8px 0 28px rgba(43, 76, 139, .045);
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --line: #E8ECF3;
  --line-2: #F0F3F9;
  --ink: #1A2233;
  --ink-2: #5A6478;
  --ink-3: #9AA3B5;
  --success: #2BB673;
  --success-light: #E6F7EF;
  --warning: #F5A623;
  --warning-light: #FDF3E2;
  --danger: #E5484D;
  --danger-light: #FDECEC;
  --table-head: #F8FAFD;
  --table-zebra: #FAFBFD;
  --surface: var(--card);
  --surface-muted: var(--table-head);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --border: var(--line-2);
  --primary-strong: var(--primary-deep);
  --primary-soft: var(--primary-light);
  --accent: var(--warning);
  --accent-soft: var(--warning-light);
  --danger-soft: var(--danger-light);
  --success-soft: var(--success-light);
  --shadow: none;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "HarmonyOS Sans Embedded", "HarmonyOS Sans SC", "HarmonyOS Sans", "鸿蒙黑体", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: var(--font-sans);
  font-family: var(--font-sans);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1420;
  --surface: #171F2E;
  --surface-muted: #202A3C;
  --ink: #F4F7FF;
  --muted: #AAB5C8;
  --faint: #7F8BA3;
  --border: #2A3548;
  --primary: #3B5BFD;
  --primary-deep: #5570FF;
  --primary-light: #202C58;
  --on-primary: #FFFFFF;
  --chart-revenue: #6EA8FE;
  --chart-margin: #4DD29A;
  --chart-refund: #F2B94B;
  --chart-roi: #B59CFF;
  --sidebar: #0A1120;
  --sidebar-2: #101A2F;
  --sidebar-ink: #F4F7FF;
  --sidebar-muted: #A8B3C8;
  --control-bg: #111827;
  --overlay-bg: #1A2435;
  --overlay-border: #3B4A63;
  --sidebar-active-bg: #263B7A;
  --sidebar-active-border: #5B74FF;
  --sidebar-active-ink: #FFFFFF;
  --nav-surface: #0A1120;
  --nav-surface-2: #101A2F;
  --nav-ink: #F4F7FF;
  --nav-muted: #A8B3C8;
  --nav-border: #27344A;
  --nav-hover: rgba(255, 255, 255, .06);
  --nav-soft: rgba(255, 255, 255, .08);
  --nav-shadow: none;
  --card: #171F2E;
  --line: #334057;
  --line-2: #263247;
  --ink-2: #AAB5C8;
  --ink-3: #7F8BA3;
  --primary-strong: #6A82FF;
  --primary-soft: #202C58;
  --accent: #F2B94B;
  --accent-soft: #302817;
  --warning: #F2B94B;
  --warning-light: #302817;
  --danger: #FF747C;
  --danger-light: #351D26;
  --danger-soft: #351D26;
  --success: #4DD29A;
  --success-light: #142D25;
  --success-soft: #142D25;
  --table-head: #202A3C;
  --table-zebra: #141C29;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.skip-link { position: fixed; left: 12px; top: 10px; z-index: 20; padding: 8px 12px; color: var(--on-primary); background: var(--primary-strong); border-radius: 7px; transform: translateY(-140%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.app-shell[hidden] { display: none; }
.dashboard-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100dvh; padding: 24px; color: var(--muted); text-align: center; }
.dashboard-loading[hidden] { display: none; }
.dashboard-loading strong { color: var(--ink); font-size: 18px; }
.dashboard-loading > span:last-child { font-size: 13px; }
.dashboard-loading-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; color: var(--on-primary); background: var(--primary); border-radius: 12px; font-weight: 700; }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; height: 100dvh; min-height: 100dvh; overflow-y: auto; padding: 24px 16px 18px; background: var(--surface); border-right: 1px solid var(--border); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 3px 10px 30px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--on-primary); background: var(--primary); border-radius: 11px; font-family: var(--font-sans); font-weight: 700; letter-spacing: -1px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 15px; letter-spacing: .02em; }
.brand-lockup span { margin-top: 1px; color: var(--muted); font-size: 12px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; min-height: 44px; gap: 10px; padding: 0 12px; color: var(--muted); border-radius: 9px; transition: color .18s ease, background .18s ease; }
.nav-item:hover, .nav-item:focus-visible { color: var(--primary); background: var(--primary-soft); }
.nav-item.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-item[hidden] { display: none; }
.nav-dot { width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; }
.nav-item.is-active .nav-dot { background: currentColor; }
.sidebar-foot { margin-top: auto; padding: 14px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.source-label, .sidebar-foot span { display: block; color: var(--muted); font-size: 12px; }
.sidebar-foot strong { display: block; margin: 5px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.main-content { width: min(100%, 1440px); margin: 0 auto; padding: 30px clamp(18px, 3vw, 48px) 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow, .section-kicker { margin: 0; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -.015em; }
h1, h2 { min-width: 0; overflow-wrap: anywhere; }
.page-subtitle { margin: 0; color: var(--muted); }
.topbar-actions, .filters, .legend { display: flex; align-items: center; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 600; white-space: nowrap; transition: transform .15s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px; }
.button-primary { color: var(--on-primary); background: var(--primary); }
.button-primary:hover { background: var(--primary-strong); }
.button-secondary, .button-quiet { color: var(--primary); background: var(--surface); border-color: var(--border); }
.button-secondary:hover, .button-quiet:hover { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.button-filter { align-self: end; color: var(--on-primary); background: var(--primary); }

.notice-strip { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 12px 15px; color: var(--ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--radius-sm); }
.notice-strip > div { display: flex; flex-wrap: wrap; gap: 5px 10px; min-width: 0; }
.notice-strip strong { font-size: 13px; }
.notice-strip span:not(.notice-mark) { color: var(--muted); font-size: 12px; }
.notice-strip a { margin-left: auto; flex: 0 0 auto; color: var(--primary); font-size: 12px; font-weight: 700; }
.notice-mark { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; color: var(--on-primary); background: var(--warning); border-radius: 50%; font-weight: 800; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.toolbar-heading { flex: 0 0 auto; }
.toolbar-heading strong { display: block; margin-top: 5px; font-size: 14px; }
.filters { justify-content: flex-end; flex-wrap: wrap; }
.filters label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
input, select { height: 36px; min-width: 128px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
input::placeholder { color: var(--faint); }
.search-field input { min-width: 165px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card { min-height: 133px; padding: 16px 17px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-card.is-highlight { border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); box-shadow: 0 12px 30px rgba(30, 64, 175, .11); }
.kpi-top, .kpi-meta, .panel-header, .chart-foot, .table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-top { color: var(--muted); font-size: 12px; }
.kpi-tag { padding: 3px 7px; color: var(--primary); background: var(--primary-soft); border-radius: 5px; font-size: 10px; font-weight: 700; }
.kpi-tag.is-warning { color: var(--accent); background: var(--accent-soft); }
.kpi-tag.is-danger { color: var(--danger); background: var(--danger-soft); }
.kpi-card > strong { display: block; margin-top: 15px; font-family: var(--font-sans); font-size: clamp(24px, 3vw, 30px); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.kpi-meta { margin-top: 10px; color: var(--muted); font-size: 11px; }

.content-grid { display: grid; gap: 12px; margin-bottom: 18px; }
.main-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .9fr); }
.secondary-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.panel { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { align-items: flex-start; margin-bottom: 16px; }
.panel-header h2 { margin-top: 4px; }
.panel-note { color: var(--muted); font-size: 12px; }
.legend { color: var(--muted); font-size: 11px; }
.chart-wrap { height: 300px; }
#trendChart { width: 100%; height: 100%; overflow: visible; }
.chart-gridline { stroke: var(--border); stroke-width: 1; }
.chart-zero-line { stroke: color-mix(in srgb, var(--muted) 65%, var(--border)); stroke-width: 1.25; }
.chart-axis-label { fill: var(--faint); font-family: var(--font-sans); font-size: 10px; }
.chart-axis-label.refund { fill: var(--chart-refund); }
.chart-axis-label.roi { fill: var(--chart-roi); }
.chart-axis-title { fill: var(--muted); font-family: var(--font-sans); font-size: 10px; font-weight: 600; }
.chart-axis-title.refund { fill: var(--chart-refund); }
.chart-axis-title.roi { fill: var(--chart-roi); }
.chart-bar { shape-rendering: geometricPrecision; }
.chart-bar.revenue { fill: var(--chart-revenue); }
.chart-bar.margin { fill: var(--chart-margin); }
.chart-path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.chart-path.refund { stroke: var(--chart-refund); }
.chart-path.roi { stroke: var(--chart-roi); stroke-width: 2.5; stroke-dasharray: 7 5; }
.chart-point { stroke: var(--surface); stroke-width: 2; }
.chart-hover-zone { fill: transparent; pointer-events: all; cursor: crosshair; }
.chart-hover-zone:focus-visible { outline: none; stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-foot { margin-top: 3px; color: var(--muted); font-size: 11px; }
.chart-source { display: inline-flex; align-items: center; gap: 16px; color: var(--faint); white-space: nowrap; }
.chart-unit { color: var(--muted); }

.quality-score { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 18px; }
.quality-score strong { display: block; font-family: var(--font-sans); font-size: 32px; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.quality-score span { color: var(--muted); font-size: 11px; }
.quality-ring { display: grid; place-items: center; width: 74px; height: 74px; background: conic-gradient(var(--primary) 0deg, var(--primary) var(--ring-progress, 0deg), var(--surface-muted) var(--ring-progress, 0deg), var(--surface-muted) 360deg); border-radius: 50%; }
.quality-ring span { width: 56px; height: 56px; background: var(--surface); border-radius: 50%; }
.quality-list { display: grid; gap: 12px; padding-top: 15px; border-top: 1px solid var(--border); }
.quality-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.quality-row-label { color: var(--muted); font-size: 12px; }
.quality-row-value { font-family: var(--font-sans); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quality-row-track { grid-column: 1 / -1; height: 5px; overflow: hidden; background: var(--surface-muted); border-radius: 5px; }
.quality-row-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.status-warning { color: var(--accent); background: var(--accent-soft); }
.status-success { color: var(--success); background: var(--success-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.text-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 17px; color: var(--primary); font-size: 12px; font-weight: 700; }

.ranking-list, .exception-list { display: grid; gap: 13px; }
.ranking-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.ranking-index { display: grid; place-items: center; width: 24px; height: 24px; color: var(--primary); background: var(--primary-soft); border-radius: 6px; font-family: var(--font-sans); font-size: 11px; font-weight: 700; }
.ranking-copy { min-width: 0; }
.ranking-copy strong, .ranking-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-copy strong { font-size: 12px; }
.ranking-copy span { color: var(--muted); font-size: 11px; }
.ranking-bar { height: 5px; margin-top: 5px; overflow: hidden; background: var(--surface-muted); border-radius: 5px; }
.ranking-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.ranking-value { font-family: var(--font-sans); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exception-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.exception-row:last-child { padding-bottom: 0; border-bottom: 0; }
.exception-row strong, .exception-row span { display: block; }
.exception-row strong { font-size: 12px; }
.exception-row span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.exception-row .exception-count { display: inline-flex; justify-content: flex-end; min-width: 92px; margin-top: 0; color: var(--muted); font-family: var(--font-sans); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }

.table-panel { margin-bottom: 18px; padding-bottom: 12px; }
.table-heading { align-items: center; }
.table-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.export-actions .button[hidden] { display: none; }
.export-status { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 700; }
td { font-size: 12px; }
tbody tr { cursor: pointer; transition: background .16s ease; }
tbody tr:hover, tbody tr:focus-within { background: var(--primary-soft); }
td:first-child { color: var(--muted); font-family: var(--font-sans); font-size: 11px; font-variant-numeric: tabular-nums; }
.link-cell strong, .link-cell span { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-cell strong { font-size: 12px; }
.link-cell span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.numeric { text-align: right; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.profit-positive { color: var(--success); font-weight: 700; }
.profit-negative { color: var(--danger); font-weight: 700; }
.table-footer { padding: 12px 10px 0; color: var(--muted); font-size: 11px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 11px; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .filters { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 10; width: auto; height: auto; min-height: auto; overflow: visible; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-lockup { padding: 0; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .side-nav { display: flex; overflow-x: auto; gap: 4px; margin: 9px -3px 0; }
  .nav-item { flex: 0 0 auto; min-height: 38px; padding: 0 10px; font-size: 12px; }
  .sidebar-foot { display: none; }
  .main-content { padding: 22px 14px 22px; }
  .topbar { flex-direction: column; gap: 14px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .main-grid, .secondary-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .notice-strip { align-items: flex-start; }
  .notice-strip a { display: none; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .filters label, .filters input, .filters select, .search-field { min-width: 0; width: 100%; }
  .search-field { grid-column: 1 / -1; }
  .button-filter { width: 100%; }
  .panel { padding: 15px; }
  .panel-header { align-items: flex-start; }
  .legend { flex-direction: column; align-items: flex-start; gap: 3px; }
  .chart-wrap { height: 235px; }
  .table-heading { align-items: stretch; flex-direction: column; }
  .table-heading .button { width: 100%; }
  .page-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* 独立登录页与账号管理 */
.auth-body { min-height: 100dvh; background: #eef2f8; }
[data-theme="dark"] .auth-body { background: var(--bg); }
.auth-view { min-height: 100dvh; display: grid; place-items: center; padding: clamp(20px, 4vw, 56px); }
.auth-shell { width: min(980px, 100%); min-height: 610px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 28px 80px rgba(20, 39, 73, .14); }
.auth-intro { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 42px; color: #fff; background: #14213a; }
.auth-intro::after { content: ""; position: absolute; right: -110px; bottom: -145px; width: 340px; height: 340px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 54px rgba(255,255,255,.035), 0 0 0 108px rgba(255,255,255,.025); pointer-events: none; }
.auth-intro .brand-lockup { position: relative; z-index: 1; padding: 0; }
.auth-intro .brand-lockup span { color: #a9b6cc; }
.auth-intro-copy { position: relative; z-index: 1; margin-top: 80px; max-width: 420px; }
.auth-eyebrow { color: #9db5ff; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.auth-intro h2 { margin: 14px 0; max-width: 390px; color: #fff; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.04em; }
.auth-intro-copy p { margin: 0; max-width: 390px; color: #b9c5d8; font-size: 15px; line-height: 1.75; }
.auth-permission-list { position: relative; z-index: 1; display: grid; gap: 18px; margin: auto 0 0; padding: 48px 0 0; list-style: none; }
.auth-permission-list li { display: flex; align-items: center; gap: 13px; }
.auth-permission-list li > span { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; color: #9db5ff; background: rgba(111,144,255,.12); border: 1px solid rgba(157,181,255,.18); border-radius: 9px; font: 700 11px/1 var(--font-sans); }
.auth-permission-list strong, .auth-permission-list small { display: block; }
.auth-permission-list strong { color: #f7f9ff; font-size: 14px; }
.auth-permission-list small { margin-top: 2px; color: #9eacc2; font-size: 12px; }
.auth-card { align-self: center; width: 100%; padding: clamp(34px, 5vw, 62px); background: var(--surface); }
.auth-card-heading { margin-bottom: 28px; }
.auth-entry-tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: 12px; font-weight: 700; }
.auth-card h1 { margin: 18px 0 8px; font-size: clamp(30px, 4vw, 40px); }
.auth-subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.auth-card form, .account-form { display: grid; gap: 18px; }
.auth-card label, .account-form label { display: grid; gap: 7px; font-weight: 650; }
.auth-card input, .account-form input, .account-form select { min-height: 48px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); }
.auth-card input, .auth-card input::placeholder { font-weight: 400; }
.auth-card input:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); }
.button-wide { width: 100%; min-height: 48px; }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.form-error { padding: 10px 12px; color: var(--danger); background: var(--danger-soft); border-radius: 8px; margin: 0; font-size: 13px; }
.form-error:empty { display: none; }
.auth-security-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.auth-security-note span { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px var(--success-soft); }
.account-badge { padding: 8px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; }
.admin-panel { margin-bottom: 24px; }
.collection-card { margin: 8px 0 26px; padding: 18px; border: 1px solid var(--border, #dce4ee); border-radius: 12px; background: var(--surface-muted, #edf2f7); }
.collection-card h3 { margin: 4px 0 6px; }
.collection-card p { margin: 0; color: var(--muted, #68758c); }
.admin-toolbar, .form-actions { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.inline-status { color: var(--muted, #64748b); }
.account-form { margin-top: 24px; padding: 20px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; }
.account-form h3 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.division-checks { display: flex; flex-wrap: wrap; gap: 14px; }
.division-checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.button-small { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
@media (max-width: 820px) { .auth-shell { min-height: auto; grid-template-columns: 1fr; } .auth-intro { padding: 28px; } .auth-intro-copy { margin-top: 42px; } .auth-permission-list { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 32px; } .auth-permission-list li { align-items: flex-start; } .auth-permission-list small { display: none; } }
@media (max-width: 560px) { .auth-view { padding: 0; place-items: stretch; } .auth-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; } .auth-intro { padding: 24px 22px; } .auth-intro-copy { margin-top: 34px; } .auth-intro h2 { font-size: 28px; } .auth-intro-copy p { font-size: 14px; } .auth-permission-list { display: none; } .auth-card { padding: 34px 22px 42px; } }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .account-badge { display: none; } }

/* 单链接 B 端设计规范 v1.0 覆盖层：克制、紧凑、变量化 */
body {
  background: var(--bg);
  font-family: var(--font-sans);
}

.app-shell { grid-template-columns: 172px minmax(0, 1fr); }
.sidebar {
  width: 172px;
  padding: 20px 12px;
  color: var(--nav-ink);
  background: linear-gradient(180deg, var(--nav-surface), var(--nav-surface-2));
  border-right: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
}
.sidebar-toggle { display:grid; place-items:center; width:28px; height:28px; margin:0 0 12px auto; border:1px solid var(--nav-border); border-radius:7px; color:var(--nav-muted); background:var(--nav-soft); cursor:pointer; font-size:20px; line-height:1; }
.sidebar-toggle:hover,.sidebar-toggle:focus-visible { color:var(--primary); background:var(--nav-hover); border-color:color-mix(in srgb, var(--primary) 30%, var(--nav-border)); }
.nav-short {
  display:grid;
  place-items:center;
  width:26px;
  height:24px;
  flex:0 0 26px;
  color:inherit;
  background:var(--nav-soft);
  border-radius:6px;
  font-size:11px;
  font-weight:600;
  line-height:1;
}
.app-shell.is-sidebar-collapsed { grid-template-columns:64px minmax(0,1fr); }
.app-shell.is-sidebar-collapsed .sidebar { width:64px; padding:20px 8px; }
.app-shell.is-sidebar-collapsed .brand-lockup { padding:0 0 24px; justify-content:center; }
.app-shell.is-sidebar-collapsed .brand-lockup > div:not(.brand-mark),
.app-shell.is-sidebar-collapsed .nav-group-title,
.app-shell.is-sidebar-collapsed .nav-label,
.app-shell.is-sidebar-collapsed .sidebar-foot { display:none; }
.app-shell.is-sidebar-collapsed .side-nav { gap:12px; }
.app-shell.is-sidebar-collapsed .nav-item { justify-content:center; padding:0; }
.app-shell.is-sidebar-collapsed .nav-short { display:grid; font-size:11px; }
.brand-lockup { padding: 0 8px 24px; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary);
}
.brand-lockup strong { color: var(--nav-ink); font-size: 15px; font-weight: 700; }
.brand-lockup span { color: var(--nav-muted); font-size: 12px; }
.auth-intro .brand-lockup strong { color: #fff; }
.side-nav { display: grid; gap: 16px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-title {
  padding: 14px 12px 6px;
  color: var(--nav-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.nav-item {
  min-height: 40px;
  padding: 0 12px;
  color: var(--nav-muted);
  border-radius: var(--radius-sm);
  font-weight: 400;
}
.nav-label { white-space: nowrap; }
.nav-item:hover,
.nav-item:focus-visible { color: var(--primary); background: var(--nav-hover); }
.nav-item.is-active {
  color: var(--sidebar-active-ink);
  background: var(--sidebar-active-bg);
  border: 1px solid var(--sidebar-active-border);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
  font-weight: 500;
}
.nav-item.is-active .nav-short { color: var(--primary); background: rgba(255,255,255,.94); }
.nav-dot { display: none; }
.sidebar-foot {
  padding: 12px;
  background: var(--nav-soft);
  border: 1px solid var(--nav-border);
  border-radius: 10px;
}
.source-label,
.sidebar-foot span { color: var(--nav-muted); }
.sidebar-foot strong,
.sidebar-foot-link { color: var(--nav-ink); }
.sidebar-foot-link {
  display: inline-flex;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.main-content { width: 100%; max-width: none; min-width: 0; margin: 0; padding: 24px; background: #EFF6FF; }
.topbar { margin-bottom: 16px; }
.eyebrow, .section-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .08em;
}
h1 { margin-bottom: 4px; color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
h2 { color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.page-subtitle,
.panel-note,
.chart-foot,
.table-footer { color: var(--ink-2); }

.button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  transform: none;
}
.button:hover { transform: none; }
.button-primary,
.button-filter {
  color: var(--on-primary);
  background: var(--primary);
}
.button-primary:hover,
.button-filter:hover { background: var(--primary-deep); }
.button-secondary,
.button-quiet {
  color: var(--ink-2);
  background: var(--card);
  border-color: var(--line);
}
.button-secondary:hover,
.button-quiet:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--line);
}

.notice-strip {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--warning-light);
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  border-radius: var(--radius);
}
.notice-mark {
  width: 24px;
  height: 24px;
  background: var(--warning);
}
.notice-strip strong { font-weight: 600; }
.notice-strip span:not(.notice-mark),
.notice-strip a { font-size: 12px; font-weight: 500; }

.toolbar,
.kpi-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: none;
}
.toolbar {
  position: relative;
  display: block;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 18px 20px;
}
.analysis-range { margin: 0 0 4px; font-size: 14px; font-weight: 400; white-space: nowrap; }
.page-subtitle { font-size:12px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: end;
  gap: 20px 16px;
  width: 100%;
}
.filters > label,
.filter-search-row > label {
  flex: 0 0 200px;
  width: 200px;
  min-width: 0;
}
.filters > label,
.filter-search-row > label,
.overview-date-fields label,
.overview-division-filter {
  gap: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}
.filters label input,
.filters label select { box-sizing: border-box; min-width: 0; width: 200px; }
.clearable-filter { position: relative; display: block; width: 100%; }
.filters label .clearable-filter input { width: 100%; padding-right: 38px; }
.clearable-filter input[type="search"]::-webkit-search-cancel-button { display: none; }
.filter-clear-button {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transform: translateY(-50%);
}
.filter-clear-button:hover { color: var(--primary); background: var(--primary-light); }
.filter-clear-button:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 0; }
.filter-clear-button:disabled { cursor: not-allowed; opacity: .45; }
.filter-clear-button[hidden] { display: none; }
.filter-clear-button span { font-size: 20px; font-weight: 500; line-height: 1; }
.filter-search-row { display: flex; align-items: end; gap: 16px; width: max-content; }
.filter-actions { display: flex; align-items: center; gap: 8px; width: max-content; align-self: end; }
.filter-actions .button { min-height:36px; width:auto; padding:0 14px; white-space:nowrap; }
.filter-status {
  display: flex;
  align-items: center;
  min-height: 22px;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 12px;
}
.filter-status::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--ink-3);
}
.filter-status[data-status="dirty"] { color: var(--warning); }
.filter-status[data-status="dirty"]::before { background: var(--warning); }
.filter-status[data-status="loading"] { color: var(--primary); }
.filter-status[data-status="loading"]::before { background: var(--primary); animation: filter-pulse 900ms ease-in-out infinite alternate; }
.filter-status[data-status="success"]::before { background: var(--success); }
.filter-status[data-status="error"] { color: var(--danger); }
.filter-status[data-status="error"]::before { background: var(--danger); }
.is-data-loading .toolbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 42%, var(--primary) 58%, transparent 100%);
  transform: translateX(-70%);
  animation: dashboard-query-progress 1.1s ease-in-out infinite;
}
@keyframes dashboard-query-progress {
  from { transform: translateX(-70%); }
  to { transform: translateX(70%); }
}
@keyframes filter-pulse { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
input, select {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
input:focus,
select:focus {
  border-color: var(--primary);
}

.kpi-grid { gap: 14px; margin-bottom: 16px; }
.kpi-card {
  box-sizing: border-box;
  height: 100px;
  min-height: 100px;
  padding: 12px 16px;
  border-top: 4px solid #2F74E8;
}
.kpi-card.is-highlight { border-color: var(--line-2); box-shadow: none; }
.kpi-top { color: var(--ink-2); font-size: 12px; }
.kpi-tag,
.status-badge {
  min-height: 22px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}
.kpi-card > strong {
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.kpi-meta { margin-top: 5px; }
.kpi-meta { color: var(--ink-2); font-size: 11.5px; }

.content-grid { gap: 16px; margin-bottom: 16px; }
.link-detail-page .content-grid { margin-bottom: 10px; }
.link-detail-page .content-grid > .table-panel { margin-bottom: 0; }
.main-grid,
.secondary-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, .78fr); }
.panel { padding: 18px 20px; }
.panel-header { margin-bottom: 12px; }
.quality-score strong { font-size: 26px; font-weight: 800; }
.quality-ring { width: 74px; height: 74px; }
.quality-ring span { width: 54px; height: 54px; }
.status-warning { color: var(--warning); background: var(--warning-light); }
.status-success { color: var(--success); background: var(--success-light); }
.status-danger { color: var(--danger); background: var(--danger-light); }

.ranking-index {
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 6px;
}
.ranking-copy strong,
.exception-row strong,
.link-cell strong { font-weight: 500; }
.link-cell .link-primary-id { color: var(--ink); font-weight: 600; }
.link-cell .link-business-info { color: var(--ink-2); font-weight: 400; }
.ranking-value,
.exception-count,
.numeric {
  font-family: var(--font-sans);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

table { min-width: 0; width:100%; table-layout:fixed; }
th, td {
  height: 40px;
  padding: 0 5px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
}
th {
  color: var(--ink-3);
  background: var(--table-head);
  font-size: 12px;
  font-weight: 500;
}
td { color: var(--ink); }
tbody tr:nth-child(even) { background: var(--table-zebra); }
tbody tr:hover,
tbody tr:focus-within { background: var(--primary-light); }
tbody tr[data-link-key] { cursor: pointer; }
tbody tr[data-link-key]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
tbody tr.is-selected-link { background: var(--primary-light); box-shadow: inset 3px 0 var(--primary); }
td:first-child { color: var(--ink-2); }
.table-panel { padding-bottom: 12px; }
.table-panel .table-scroll { overflow-x:hidden; }
.table-panel th,.table-panel td { overflow:hidden; text-overflow:ellipsis; }
.table-panel th { white-space:normal; overflow-wrap:anywhere; line-height:1.25; }
.table-panel td.numeric { white-space:nowrap; }
.amount-value { display:inline-block; cursor:help; font-variant-numeric:tabular-nums; text-decoration:underline dotted color-mix(in srgb, currentColor 38%, transparent); text-underline-offset:3px; }
.amount-value:focus-visible { border-radius:4px; outline:2px solid var(--primary); outline-offset:2px; }
.amount-tooltip { white-space:nowrap; }
.overview-promotion-cost { color:var(--primary) !important; cursor:help; font-weight:600; text-decoration:underline dotted color-mix(in srgb,var(--primary) 38%,transparent); text-underline-offset:3px; }
.overview-promotion-cost:focus-visible { border-radius:4px; outline:2px solid var(--primary); outline-offset:2px; }
.table-panel .link-cell .link-primary-id,
.table-panel .link-cell .link-business-info { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.table-panel .object-cell strong,
.table-panel .object-cell span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.table-panel .object-cell strong { color:var(--ink); font-size:12px; font-weight:500; }
.table-panel .object-cell span { margin-top:2px; color:var(--ink-2); font-size:11px; }
.table-panel .link-primary-row { display:flex; align-items:center; min-width:0; max-width:280px; gap:5px; overflow:hidden; }
.table-panel .link-primary-row .link-primary-id { flex:0 1 auto; min-width:0; }
.table-panel .link-cell .link-role-badge { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; min-width:18px; height:16px; margin:0; padding:0 4px; overflow:visible; border:1px solid var(--line); border-radius:4px; font-size:10px; font-weight:600; line-height:1; text-overflow:clip; white-space:nowrap; }
.table-panel .link-cell .link-role-badge.is-main { color:var(--primary); background:var(--primary-light); border-color:color-mix(in srgb, var(--primary) 28%, var(--line)); }
.table-panel .link-cell .link-role-badge.is-attached { color:var(--ink-2); background:var(--surface-muted); }
.link-tooltip {
  position: fixed;
  z-index: 50;
  box-sizing: border-box;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  max-height: min(320px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(20, 35, 70, .18);
  font: 400 12px/1.55 var(--font-sans);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.link-tooltip[hidden] { display: none; }
.chart-tooltip {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 11px 13px;
  color: #f8fbff;
  background: color-mix(in srgb, var(--overlay-bg) 96%, transparent);
  border: 1px solid var(--overlay-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(20, 35, 70, .26);
  font: 400 12px/1.5 var(--font-sans);
  pointer-events: none;
}
.chart-tooltip strong { margin-bottom: 3px; color: #fff; font-size: 13px; }
.chart-tooltip span { display: block; white-space: nowrap; }
.chart-tooltip[hidden] { display: none; }
.table-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.pagination-controls { display:flex; align-items:center; gap:6px; font-size:12px; }
.pagination-controls select { width:70px; min-height:28px; height:28px; padding:0 4px; font-size:12px; }
.pagination-controls button { min-height:28px; padding:0 7px; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:var(--card); cursor:pointer; font:400 12px var(--font-sans); }
.pagination-controls button:disabled { opacity:.4; cursor:not-allowed; }
.table-footnote { margin-top:6px; color:var(--ink-2); font-size:11px; }
.overview-page { overflow-x: clip; }
.overview-topbar { align-items: center; }
.overview-toolbar { margin-bottom: 14px; }
.overview-filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; }
.overview-date-fields { display: flex; align-items: end; gap: 14px; min-width: 0; }
.overview-division-filter > span { margin-bottom: 0; }
.overview-date-fields label,
.overview-division-filter { display: grid; }
.overview-date-fields input { width: 178px; height: 36px; min-height: 36px; }
.overview-division-filter select { width: 210px; height: 36px; min-height: 36px; }
.overview-division-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.overview-division-summary article { position: relative; min-width: 0; min-height: 104px; padding: 15px 17px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #2F74E8; border-radius: 12px; box-shadow: var(--shadow-soft); }
.overview-division-summary > article > span { display: block; color: var(--ink-2); font-size: 11px; }
.overview-division-summary .overview-metric-title { display: flex; align-items: center; gap: 3px; }
.overview-formula-help { position: relative; z-index: 4; display: inline-grid; flex: 0 0 20px; width: 20px; height: 20px; margin: -3px 0; padding: 3px; place-items: center; color: var(--ink-3); background: transparent; border: 0; border-radius: 6px; cursor: help; transition: color .16s ease, background .16s ease; }
.overview-formula-help:hover,
.overview-formula-help:focus-visible { color: var(--ink-2); background: color-mix(in srgb, var(--primary) 7%, transparent); outline: none; }
.overview-formula-help:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent); }
.overview-formula-help svg { display: block; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.overview-formula-help svg .is-filled { fill: currentColor; stroke: none; }
.overview-formula-tooltip { position: absolute; top: calc(100% + 7px); left: 50%; z-index: 30; width: max-content; max-width: min(280px, calc(100vw - 32px)); padding: 8px 10px; color: #fff; font-size: 11px; font-weight: 400; line-height: 1.55; text-align: left; white-space: normal; background: color-mix(in srgb, var(--overlay-bg) 96%, transparent); border: 1px solid var(--overlay-border); border-radius: 7px; box-shadow: 0 8px 22px rgba(18, 31, 58, .18); opacity: 0; visibility: hidden; transform: translate(-44%, -3px); transition: opacity .14s ease, transform .14s ease, visibility .14s ease; pointer-events: none; }
.overview-formula-help.is-start .overview-formula-tooltip { left: 0; transform: translate(0, -3px); }
.overview-formula-help:hover .overview-formula-tooltip,
.overview-formula-help:focus-visible .overview-formula-tooltip { opacity: 1; visibility: visible; transform: translate(-44%, 0); }
.overview-formula-help.is-start:hover .overview-formula-tooltip,
.overview-formula-help.is-start:focus-visible .overview-formula-tooltip { transform: translate(0, 0); }
.overview-division-summary article:has(.overview-formula-help:hover),
.overview-division-summary article:has(.overview-formula-help:focus-visible) { z-index: 20; }
.overview-division-summary strong { display: block; margin-top: 8px; overflow: hidden; color: var(--ink); font-size: 22px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.overview-division-summary small { display: block; margin-top: 7px; overflow: hidden; color: var(--ink-2); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.overview-division-summary strong.profit-negative { color: var(--danger); }
.overview-division-summary strong.profit-positive { color: var(--success); }
.overview-shop-tabbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; max-width: 100%; margin-bottom: 14px; }
.overview-shop-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; gap: 9px; overflow: hidden; }
.overview-shop-tab { min-width: 0; min-height: 48px; padding: 0 16px; overflow: hidden; color: var(--ink-2); text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.overview-shop-tab strong { display: block; overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.overview-shop-tab:hover { border-color: var(--primary); }
.overview-shop-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 2px; }
.overview-shop-tab.is-active { color: #fff; background: var(--sidebar); border-color: var(--sidebar); box-shadow: 0 7px 16px rgba(20, 35, 70, .14); }
.overview-shop-tabs-empty { flex: 1; padding: 13px 16px; color: var(--ink-2); text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; }
.overview-shop-more { min-width: 100px; min-height: 48px; padding: 0 18px; color: var(--primary); background: var(--card); border: 1px solid var(--primary); border-radius: 10px; cursor: pointer; font: 500 12px var(--font-sans); white-space: nowrap; }
.overview-shop-more:hover,
.overview-shop-more[aria-expanded="true"],
.overview-shop-more.is-active { color: #fff; background: var(--primary); }
.overview-shop-popover { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(560px, calc(100vw - 40px)); max-height: 320px; padding: 10px; gap: 8px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(15, 28, 58, .18); }
.overview-shop-popover[hidden] { display: none; }
.overview-shop-popover .overview-shop-tab { width: 100%; min-height: 42px; }
.overview-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .9fr); gap: 14px; align-items: stretch; }
.overview-trend-panel,
.overview-total-panel { min-width: 0; padding: 18px; }
.overview-panel-head,
.overview-total-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.overview-panel-head h2,
.overview-total-head h2 { margin: 0; color: var(--ink); font-size: 18px; }
.overview-total-head > span { color: var(--ink-3); font-size: 10px; white-space: nowrap; }
.overview-type-tabs { display: inline-flex; flex: 0 0 auto; padding: 3px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 9px; }
.overview-type-tabs button { min-height: 30px; padding: 0 12px; color: var(--ink-2); background: transparent; border: 0; border-radius: 7px; cursor: pointer; font: 500 11px var(--font-sans); }
.overview-type-tabs button.is-active { color: #fff; background: var(--sidebar); }
.overview-chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin: 15px 0 4px; color: var(--ink-2); font-size: 10px; }
.overview-chart-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.overview-chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.overview-chart-legend .is-revenue { background: var(--primary); }
.overview-chart-legend .is-profit { background: var(--success); }
.overview-chart-legend .overview-profit-legend { display: inline-flex; align-items: center; gap: 2px; }
.overview-chart-legend .overview-profit-legend i { width: 5px; height: 11px; border-radius: 2px; }
.overview-chart-legend .is-profit-negative { background: var(--danger); }
.overview-chart-legend .is-refund { background: #F59E0B; border-radius: 50%; }
.overview-chart-legend .is-roi { background: #8B5CF6; transform: rotate(45deg); border-radius: 1px; }
.overview-svg-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.overview-svg-chart { display: block; width: 100%; min-height: 320px; overflow: visible; }
.overview-store-trend { min-width: 100%; }
.overview-chart-axis { stroke: var(--line); stroke-width: 1; }
.overview-chart-axis.is-zero { stroke: color-mix(in srgb, var(--ink-3) 42%, var(--line)); stroke-width: 1.25; }
.overview-chart-gridline { stroke: color-mix(in srgb, var(--line-2) 88%, transparent); stroke-width: 1; }
.overview-chart-axis-title { fill: var(--ink-2); font-family: var(--font-sans); font-size: 9px; font-weight: 600; }
.overview-chart-axis-label,
.overview-chart-label { fill: var(--ink-2); font-family: var(--font-sans); font-size: 9px; font-variant-numeric: tabular-nums; }
.overview-chart-empty { fill: var(--ink-2); font: 12px var(--font-sans); }
.overview-gradient-revenue-start { stop-color: color-mix(in srgb, var(--chart-revenue) 72%, var(--card)); }
.overview-gradient-revenue-end { stop-color: color-mix(in srgb, var(--chart-revenue) 46%, var(--card)); }
.overview-gradient-profit-start { stop-color: color-mix(in srgb, var(--success) 68%, var(--card)); }
.overview-gradient-profit-end { stop-color: color-mix(in srgb, var(--success) 42%, var(--card)); }
.overview-gradient-loss-start { stop-color: color-mix(in srgb, var(--danger) 68%, var(--card)); }
.overview-gradient-loss-end { stop-color: color-mix(in srgb, var(--danger) 44%, var(--card)); }
.overview-bar-revenue { fill: url(#overviewRevenueGradient); }
.overview-bar-profit { fill: url(#overviewProfitGradient); }
.overview-bar-profit.is-negative { fill: url(#overviewLossGradient); }
.overview-trend-day rect { shape-rendering: geometricPrecision; transition: opacity .15s ease; }
.overview-trend-day:hover rect,
.overview-trend-day:focus-visible rect { opacity: .82; }
.overview-chart-value-label { font: 600 8px var(--font-sans); font-variant-numeric: tabular-nums; paint-order: stroke; pointer-events: none; stroke: var(--card); stroke-linejoin: round; stroke-width: 2.5px; }
.overview-chart-value-label.is-revenue { fill: color-mix(in srgb, var(--chart-revenue) 82%, var(--ink)); }
.overview-chart-value-label.is-profit { fill: color-mix(in srgb, var(--success) 82%, var(--ink)); }
.overview-chart-value-label.is-profit.is-negative { fill: color-mix(in srgb, var(--danger) 84%, var(--ink)); }
.overview-chart-value-label.is-profit.is-missing { fill: var(--ink-3); font-weight: 500; }
.overview-chart-value-label.is-refund { fill: color-mix(in srgb, var(--chart-refund) 72%, var(--ink)); }
.overview-chart-value-label.is-roi { fill: color-mix(in srgb, var(--chart-roi) 80%, var(--ink)); }
.overview-line-refund { fill: none; stroke: var(--chart-refund); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.overview-line-roi { fill: none; stroke: var(--chart-roi); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 7 5; }
.overview-point-refund { fill: var(--chart-refund); stroke: var(--card); stroke-width: 1.75; }
.overview-point-roi { fill: var(--chart-roi); stroke: var(--card); stroke-width: 1.75; }
.overview-trend-day:focus-visible,
.overview-point-refund:focus-visible,
.overview-point-roi:focus-visible { outline: none; filter: drop-shadow(0 0 3px var(--primary)); }
.overview-daily-loss-chart { display: block; min-width: 100%; margin-top: 8px; border-top: 1px solid var(--line); }
.overview-loss-row-label { fill: var(--ink); font: 500 10px var(--font-sans); }
.overview-loss-row-total { fill: var(--ink-3); font: 9px var(--font-sans); }
.overview-loss-daily-value { fill: var(--ink); font: 500 9px var(--font-sans); font-variant-numeric: tabular-nums; }
.overview-loss-daily-point:focus-visible { outline: none; filter: drop-shadow(0 0 3px var(--primary)); }
.overview-total-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.overview-total-card { --card-accent: var(--primary); position: relative; min-width: 0; min-height: 98px; padding: 13px; overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--card-accent) 12%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--card-accent) 18%, var(--line)); border-radius: 11px; box-shadow: 0 6px 18px color-mix(in srgb, var(--card-accent) 7%, transparent); }
.overview-total-card::after { position: absolute; right: -22px; bottom: -29px; width: 76px; height: 76px; background: color-mix(in srgb, var(--card-accent) 7%, transparent); border-radius: 24px; content: ""; transform: rotate(18deg); pointer-events: none; }
.overview-total-card.is-profit { --card-accent: var(--success); }
.overview-total-card.is-refund { --card-accent: var(--warning); }
.overview-total-card.is-roi { --card-accent: var(--chart-roi); }
.overview-total-card-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.overview-total-card-head > span { display: block; min-width: 0; color: var(--ink-2); font-size: 10px; }
.overview-total-card-icon { position: relative; display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: var(--card-accent); background: linear-gradient(145deg, color-mix(in srgb, var(--card-accent) 18%, var(--card)), color-mix(in srgb, var(--card-accent) 8%, var(--card))); border: 1px solid color-mix(in srgb, var(--card-accent) 20%, transparent); border-radius: 9px; box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent), 0 3px 8px color-mix(in srgb, var(--card-accent) 10%, transparent); }
.overview-total-card-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.overview-total-grid strong { display: block; margin: 9px 0 4px; overflow: hidden; color: var(--ink); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.overview-total-card > small { position: relative; z-index: 1; display: block; overflow: hidden; color: var(--ink-3); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.overview-total-grid strong.profit-negative { color: var(--danger); }
.overview-total-grid strong.profit-positive { color: var(--success); }
.overview-link-totals { display: grid; gap: 10px; margin-top: 14px; }
.overview-link-totals section,
.overview-finance-summary { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.overview-link-totals section { --link-accent: var(--primary); background: linear-gradient(110deg, color-mix(in srgb, var(--link-accent) 7%, var(--card)), var(--card) 58%); border-left: 3px solid color-mix(in srgb, var(--link-accent) 70%, var(--line)); }
.overview-link-totals section.is-attached { --link-accent: var(--chart-roi); }
.overview-link-total-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.overview-link-total-head i { display: grid; width: 25px; height: 25px; place-items: center; color: var(--link-accent); background: color-mix(in srgb, var(--link-accent) 11%, var(--card)); border-radius: 8px; }
.overview-link-total-head svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.overview-link-totals h3,
.overview-finance-summary h3 { margin: 0 0 10px; color: var(--ink); font-size: 12px; }
.overview-link-total-head h3 { margin: 0; }
.overview-link-totals dl,
.overview-finance-summary dl { display: grid; gap: 7px; margin: 0; }
.overview-link-totals dl > div,
.overview-finance-summary dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.overview-link-totals dt,
.overview-finance-summary dt { color: var(--ink-2); font-size: 11px; }
.overview-link-totals dd,
.overview-finance-summary dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 500; text-align: right; }
.overview-finance-summary { margin-top: 14px; background: color-mix(in srgb, #8B5CF6 7%, var(--card)); }
.overview-total-note { margin: 14px 0 0; color: var(--ink-3); font-size: 10px; line-height: 1.6; }
.overview-chart-tooltip { z-index: 90; }
.table-heading p,
.link-cell span,
.exception-row span { color: var(--ink-2); }

.account-badge {
  min-height: 28px;
  padding: 0 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.form-error:empty { display: none; }

.priority-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.tab-result-status {
  align-self: center;
  margin-left: auto;
  color: #9AA3B5;
  font-size: 12px;
}
.priority-tab:disabled { cursor: wait; opacity: .6; }
.priority-tab {
  min-height: 36px;
  padding: 0 14px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
}
.priority-tab span {
  margin-left: 5px;
  color: var(--ink-3);
}
.priority-tab.is-active {
  color: var(--sidebar-ink);
  background: var(--sidebar);
  border-color: var(--sidebar);
}
.priority-tab.is-active span { color: rgba(255,255,255,.82); }
.sortable-column { padding: 0; }
.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  gap: 4px;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.table-sort-button:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; border-radius: 6px; }
.sort-icon { width: 10px; height: 14px; flex: 0 0 auto; overflow: visible; }
.sort-arrow { fill: none; stroke: var(--ink-2); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; opacity: .82; }
.table-sort-button:hover .sort-arrow { opacity: .96; }
.table-sort-button[data-direction="asc"] .sort-arrow,
.table-sort-button[data-direction="desc"] .sort-arrow { opacity: .62; }
.table-sort-button[data-direction="asc"] .sort-arrow-up,
.table-sort-button[data-direction="desc"] .sort-arrow-down { opacity: 1; stroke: var(--primary); }
.unmatched-page { display:flex; min-height:100dvh; flex-direction:column; }
.unmatched-toolbar { margin-bottom:16px; }
.unmatched-toolbar .filters { justify-content:flex-start; }
.unmatched-toolbar label { display:grid; gap:6px; color:var(--ink-2); font-size:12px; font-weight:500; }
.unmatched-toolbar input,.unmatched-toolbar select { width:220px; height:36px; }
.unmatched-toolbar .button { align-self:end; }
.unmatched-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.unmatched-card { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:112px; padding:16px; color:var(--ink); text-align:left; background:linear-gradient(145deg,var(--card),var(--surface-muted)); border:1px solid var(--line); border-radius:var(--radius); cursor:pointer; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.unmatched-card:hover,.unmatched-card:focus-visible { transform:translateY(-1px); border-color:color-mix(in srgb,var(--primary) 38%,var(--line)); box-shadow:var(--shadow-soft); }
.unmatched-card.is-active { border-color:color-mix(in srgb,var(--primary) 58%,var(--line)); box-shadow:inset 3px 0 var(--primary),var(--shadow-soft); }
.unmatched-card-index { display:grid; place-items:center; width:34px; height:34px; color:var(--primary); background:var(--primary-light); border-radius:10px; font-size:12px; font-weight:700; }
.unmatched-card strong,.unmatched-card small { display:block; }
.unmatched-card strong { margin-bottom:6px; font-size:15px; }
.unmatched-card small { color:var(--ink-2); font-size:11px; line-height:1.55; }
.unmatched-card b { color:var(--primary); font-size:24px; font-variant-numeric:tabular-nums; text-align:right; }
.unmatched-card em { display:block; margin-top:4px; color:var(--ink-3); font-size:10px; font-style:normal; font-weight:500; }
.unmatched-detail-panel { margin-bottom:16px; }
.unmatched-location { display:flex; gap:10px; margin:-2px 0 12px; padding:10px 12px; color:var(--ink-2); background:var(--surface-muted); border-radius:8px; font-size:12px; }
.unmatched-location strong { color:var(--ink); }
.unmatched-table td .unmatched-cell-primary,.unmatched-table td small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.unmatched-table td .unmatched-cell-primary { font-weight:400; }
.unmatched-table td small { margin-top:2px; color:var(--ink-3); font-size:10px; }
.unmatched-reason-list { display:flex; flex-wrap:wrap; align-items:center; gap:4px; min-width:150px; }
.unmatched-reason-tag { display:inline-flex; align-items:center; min-height:22px; padding:3px 7px; color:var(--danger); background:var(--danger-light); border:1px solid color-mix(in srgb,var(--danger) 18%,var(--line)); border-radius:6px; font-size:11px; font-weight:500; line-height:1.35; white-space:normal; }
.finance-daily-page { min-width:0; overflow-x:clip; }
.finance-daily-notice { margin-bottom:16px; }
.finance-daily-toolbar .filters { align-items:end; }
.finance-daily-toolbar .filters > label { flex:1 1 190px; }
.finance-daily-toolbar .filters select,
.finance-daily-toolbar .filters input { width:100%; }
.finance-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.finance-summary-grid article {
  min-width:0;
  padding:16px 20px 14px;
  background:linear-gradient(145deg,var(--card),color-mix(in srgb,var(--primary-light) 24%,var(--card)));
  border:1px solid var(--line);
  border-top:4px solid #2F74E8;
  border-radius:16px;
  box-shadow:var(--shadow);
}
.finance-summary-card h2 { margin:0 0 10px; color:var(--ink); font-size:18px; font-weight:700; }
.finance-summary-card h2 span { color:var(--ink-2); font-size:13px; font-weight:500; }
.finance-summary-breakdown { display:grid; gap:6px; margin:0; }
.finance-summary-breakdown > div { display:grid; grid-template-columns:minmax(112px,auto) minmax(0,1fr); align-items:baseline; gap:14px; }
.finance-summary-breakdown > .is-subtotal { --finance-row-accent:#2456b5; }
.finance-summary-breakdown > .is-daily { --finance-row-accent:#08736e; }
.finance-summary-breakdown > .is-difference { --finance-row-accent:#a04b0b; }
.finance-summary-breakdown dt { color:var(--ink-2); font-size:13px; line-height:1.35; }
.finance-summary-breakdown dd { min-width:0; margin:0; text-align:right; }
.finance-summary-grid strong { display:block; overflow:hidden; color:var(--finance-row-accent); font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }
.finance-summary-breakdown > .is-difference { margin:0 -8px -2px; padding:5px 8px 2px; background:color-mix(in srgb,var(--warning-light) 38%,transparent); border-radius:8px; }
[data-theme="dark"] .finance-summary-breakdown > .is-subtotal { --finance-row-accent:#9ebdff; }
[data-theme="dark"] .finance-summary-breakdown > .is-daily { --finance-row-accent:#7edaca; }
[data-theme="dark"] .finance-summary-breakdown > .is-difference { --finance-row-accent:#f6c084; }
.finance-comparison-panel { min-width:0; }
.finance-list-title { display:flex; align-items:baseline; gap:12px; min-width:0; }
.finance-list-title h2 { margin:0; }
.finance-list-title .panel-note { flex:none; white-space:nowrap; }
.finance-list-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.finance-export-status { max-width:260px; overflow:hidden; color:var(--ink-3); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.finance-table-scroll { width:100%; overflow:visible; border:1px solid var(--line); border-radius:12px; }
.finance-comparison-table { width:100%; min-width:0; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.finance-comparison-table col:nth-child(1) { width:8%; }
.finance-comparison-table col:nth-child(2) { width:16%; }
.finance-comparison-table col:nth-child(3) { width:12%; }
.finance-comparison-table col:nth-child(4) { width:8%; }
.finance-comparison-table col:nth-child(5) { width:9%; }
.finance-comparison-table col:nth-child(6) { width:6%; }
.finance-comparison-table col:nth-child(7) { width:9%; }
.finance-comparison-table col:nth-child(8) { width:10%; }
.finance-comparison-table col:nth-child(9) { width:7%; }
.finance-comparison-table col:nth-child(10) { width:8%; }
.finance-comparison-table col:nth-child(11) { width:7%; }
.finance-comparison-table th,
.finance-comparison-table td { height:48px; padding:10px 12px; overflow:hidden; border-bottom:1px solid var(--line); font-size:12px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }
.finance-comparison-table th { position:sticky; top:0; z-index:1; height:52px; color:var(--ink-3); background:var(--surface-muted); font-weight:500; line-height:1.3; overflow-wrap:anywhere; white-space:normal; }
.finance-comparison-table tbody tr:last-child td { border-bottom:0; }
.finance-comparison-table tbody tr.is-summary { background:color-mix(in srgb,var(--primary-light) 42%,var(--card)); }
.finance-comparison-table tbody tr.is-subtotal { --finance-row-accent:#2456b5; background:#eaf1ff; }
.finance-comparison-table tbody tr.is-daily { --finance-row-accent:#08736e; background:#e7f6f3; }
.finance-comparison-table tbody tr.is-difference { --finance-row-accent:#a04b0b; background:#fff0df; }
.finance-comparison-table tbody tr.is-summary td:nth-child(n+4) { color:var(--finance-row-accent); font-weight:600; }
.finance-comparison-table tbody tr.is-summary td:nth-child(4) { box-shadow:inset 3px 0 var(--finance-row-accent); }
[data-theme="dark"] .finance-comparison-table tbody tr.is-subtotal { --finance-row-accent:#9ebdff; background:#243451; }
[data-theme="dark"] .finance-comparison-table tbody tr.is-daily { --finance-row-accent:#7edaca; background:#1c3939; }
[data-theme="dark"] .finance-comparison-table tbody tr.is-difference { --finance-row-accent:#f6c084; background:#413225; }
.finance-comparison-table tbody tr.is-missing { color:var(--ink-3); }
.finance-comparison-table td:nth-child(4) { padding-left:8px; padding-right:8px; white-space:nowrap; }
.finance-comparison-table td.numeric { padding-right:10px; font-variant-numeric:tabular-nums; }
.finance-comparison-table .finance-amount-value { max-width:100%; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.finance-comparison-table .finance-shop-name,
.finance-comparison-table .finance-product { max-width:0; }
#financeAmountTooltip.is-text-tooltip { max-width:min(420px,calc(100vw - 24px)); white-space:normal; overflow-wrap:anywhere; line-height:1.6; }
.finance-comparison-table td[data-full-text]:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.finance-empty { height:160px; color:var(--ink-2); text-align:center; }
.finance-table-foot { display:flex; justify-content:space-between; gap:16px; padding-top:12px; color:var(--ink-3); font-size:10px; }
.access-denied { width:min(520px,calc(100% - 32px)); margin:18vh auto 0; padding:32px; text-align:center; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.access-denied[hidden] { display:none; }
.access-denied strong { display:block; margin-bottom:8px; font-size:22px; }
.access-denied p { margin:0 0 20px; color:var(--ink-2); }
.exception-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}
.exception-rank {
  width: 28px;
  height: 28px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.exception-row .exception-rank { display: grid; place-items: center; margin: 0; color: var(--primary); font-size: 12px; }
.exception-panel {
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr);
  grid-template-areas:"priority-head priority-head" "priority-list priority-tip";
  align-self:stretch;
  gap:14px 18px;
  width:100%;
  overflow:hidden;
}
.exception-panel .panel-header { grid-area:priority-head; margin-bottom:0; }
.exception-panel .exception-list { grid-area:priority-list; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.priority-core-card {
  min-width:0;
  min-height:104px;
  padding:16px 18px;
  border:1px solid color-mix(in srgb,var(--primary) 18%,var(--line-2));
  border-radius:14px;
  background:linear-gradient(145deg,color-mix(in srgb,var(--primary-light) 52%,var(--card)),var(--card) 72%);
  box-shadow:inset 3px 0 var(--primary);
}
.priority-core-card:nth-child(2) {
  border-color:color-mix(in srgb,var(--warning) 22%,var(--line-2));
  background:linear-gradient(145deg,color-mix(in srgb,var(--warning-light) 58%,var(--card)),var(--card) 72%);
  box-shadow:inset 3px 0 var(--warning);
}
.priority-core-card:last-child { padding-bottom:16px; border-bottom:1px solid color-mix(in srgb,var(--warning) 22%,var(--line-2)); }
.priority-core-card .exception-rank { width:40px; height:28px; border-radius:999px; font-size:11px; letter-spacing:.04em; }
.priority-core-card:nth-child(2) .exception-rank { color:var(--warning); background:var(--warning-light); }
.priority-copy { min-width:0; }
.priority-core-card .priority-copy strong { display:block; color:var(--ink); font-size:15px; font-weight:650; line-height:1.35; }
.priority-core-card .priority-copy span { display:block; margin-top:7px; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.priority-core-card .exception-count { display:grid; justify-items:end; min-width:104px; color:var(--ink); white-space:nowrap; }
.priority-core-card .exception-count strong { color:var(--ink); font-size:22px; font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; }
.priority-core-card .exception-count small { margin-top:5px; color:var(--ink-2); font-size:11px; font-weight:500; }
.exception-detail-trigger {
  width: 100%;
  padding-top: 0;
  padding-right: 0;
  padding-left: 0;
  color: inherit;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.exception-detail-trigger:hover strong,
.exception-detail-trigger:focus-visible strong { color: var(--primary); }
.exception-detail-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.operation-tip {
  grid-area:priority-tip;
  display:flex;
  min-width:0;
  min-height:104px;
  margin-top:0;
  padding:16px 18px;
  flex-direction:column;
  justify-content:center;
  background:linear-gradient(145deg,color-mix(in srgb,var(--primary-light) 70%,var(--card)),var(--card));
  border:1px solid color-mix(in srgb,var(--primary) 14%,var(--line));
  border-radius:14px;
}
.operation-tip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}
.operation-tip p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
}
.anomaly-detail-dialog {
  width: min(1120px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(20, 30, 60, .28);
  overflow: hidden;
}
.anomaly-detail-dialog::backdrop { background: rgba(25, 37, 66, .52); backdrop-filter: blur(2px); }
.anomaly-dialog-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.anomaly-dialog-header,
.anomaly-dialog-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card);
}
.anomaly-dialog-header { border-bottom: 1px solid var(--line-2); }
.anomaly-dialog-header h2 { margin: 0; font-size: 18px; line-height: 1.4; }
.anomaly-dialog-header p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; }
.dialog-close-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink-2);
  background: var(--surface-muted);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.anomaly-dialog-body { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; overflow: hidden; }
.anomaly-guide { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.anomaly-guide > div { min-width: 0; padding: 12px 14px; background: var(--surface-muted); border: 1px solid var(--line-2); border-radius: 10px; }
.anomaly-guide span,
.anomaly-guide strong { display: block; }
.anomaly-guide span { color: var(--ink-3); font-size: 11px; }
.anomaly-guide strong { margin-top: 5px; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.anomaly-table-scroll { min-height: 0; flex: 1 1 auto; overflow: auto; border: 1px solid var(--line-2); border-radius: 10px; }
.anomaly-detail-table { min-width: 920px; table-layout: fixed; }
.anomaly-detail-table th { position: sticky; top: 0; z-index: 1; }
.anomaly-detail-table th:nth-child(1) { width: 110px; }
.anomaly-detail-table th:nth-child(2) { width: 120px; }
.anomaly-detail-table th:nth-child(3) { width: 210px; }
.anomaly-detail-table th:nth-child(4) { width: 240px; }
.anomaly-detail-table th:nth-child(5) { width: 130px; }
.anomaly-detail-table th:nth-child(6) { width: 110px; }
.anomaly-detail-table td { height: auto; min-height: 44px; padding: 9px 8px; vertical-align: top; white-space: normal; }
.anomaly-cell-primary,
.anomaly-cell-secondary { display: block; overflow-wrap: anywhere; }
.anomaly-cell-primary { color: var(--ink); }
.anomaly-cell-secondary { margin-top: 3px; color: var(--ink-2); font-size: 11px; }
.anomaly-detail-status { flex: 0 0 auto; min-height: 18px; color: var(--ink-2); font-size: 12px; }
.anomaly-dialog-footer { border-top: 1px solid var(--line-2); box-shadow: 0 -8px 18px rgba(20, 30, 60, .05); }
.anomaly-dialog-footer > span { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.anomaly-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.link-select-label {
  display: grid;
  gap: 6px;
  flex: 0 1 680px;
  width: min(100%, 680px);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.link-select-label input { width: 100%; min-width: 260px; }
.field-hint { min-height: 18px; color: var(--ink-3); font-size: 11px; font-weight: 400; }
.field-hint.is-error { color: var(--danger); }
#linkTrendSearch[aria-invalid="true"] { border-color: var(--danger); }
.trend-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.trend-metric-card {
  min-width: 0;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}
.trend-metric-card span,
.trend-metric-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-wrap { overflow-x: auto; overflow-y: hidden; }
#trendChart { display: block; }
.chart-gradient-revenue-start { stop-color: color-mix(in srgb, var(--chart-revenue) 72%, var(--card)); }
.chart-gradient-revenue-end { stop-color: color-mix(in srgb, var(--chart-revenue) 46%, var(--card)); }
.chart-gradient-margin-start { stop-color: color-mix(in srgb, var(--success) 68%, var(--card)); }
.chart-gradient-margin-end { stop-color: color-mix(in srgb, var(--success) 42%, var(--card)); }
.chart-gradient-loss-start { stop-color: color-mix(in srgb, var(--danger) 68%, var(--card)); }
.chart-gradient-loss-end { stop-color: color-mix(in srgb, var(--danger) 44%, var(--card)); }
.chart-bar.revenue { fill: url(#linkRevenueGradient); }
.chart-bar.margin { fill: url(#linkMarginGradient); }
.chart-bar.margin.is-negative { fill: url(#linkLossGradient); }
.chart-value-label { font: 600 9px var(--font-sans); font-variant-numeric: tabular-nums; paint-order: stroke; pointer-events: none; stroke: var(--card); stroke-width: 2.5px; stroke-linejoin: round; }
.chart-value-label.revenue { fill: color-mix(in srgb, var(--chart-revenue) 82%, var(--ink)); }
.chart-value-label.margin { fill: color-mix(in srgb, var(--success) 82%, var(--ink)); }
.chart-value-label.margin.is-negative { fill: color-mix(in srgb, var(--danger) 84%, var(--ink)); }
.chart-value-label.margin.is-missing { fill: var(--ink-3); font-weight: 500; }
.chart-value-label.refund { fill: color-mix(in srgb, var(--chart-refund) 72%, var(--ink)); }
.chart-value-label.roi { fill: color-mix(in srgb, var(--chart-roi) 80%, var(--ink)); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-swatch { position: relative; display: inline-block; flex: 0 0 auto; width: 20px; }
.legend-swatch.bar { width: 10px; height: 12px; border-radius: 2px 2px 0 0; }
.legend-swatch.bar.revenue { background: var(--chart-revenue); }
.legend-swatch.bar.margin { background: var(--chart-margin); }
.legend-margin-pair { display: inline-flex; align-items: center; gap: 2px; }
.legend-margin-pair .legend-swatch.bar { width: 5px; }
.legend-swatch.bar.margin-negative { background: var(--danger); }
.legend-swatch.line { height: 0; border-top: 3px solid currentColor; }
.legend-swatch.line::after { content: ""; position: absolute; left: 7px; top: -5px; width: 6px; height: 6px; background: currentColor; border: 1px solid var(--surface); border-radius: 50%; }
.legend-swatch.line.refund { color: var(--chart-refund); }
.legend-swatch.line.roi { color: var(--chart-roi); border-top-style: dashed; }
.legend-swatch.line.roi::after { border-radius: 1px; transform: rotate(45deg); }
.chart-panel.is-link-changing { animation: trend-switch .34s ease-out; }
@keyframes trend-switch { from { box-shadow: inset 0 0 0 2px var(--primary); } to { box-shadow: inset 0 0 0 0 transparent; } }
.trend-metric-card span {
  color: var(--ink-2);
  font-size: 12px;
}
.trend-metric-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

/* 深色模式与浅色共用品牌蓝；深蓝灰表面负责层级，红黄绿仅表达业务状态。 */
[data-theme="dark"] .main-content { background: var(--bg); }
[data-theme="dark"] .button-secondary,
[data-theme="dark"] .button-quiet,
[data-theme="dark"] .priority-tab,
[data-theme="dark"] .pagination-controls button {
  background: var(--control-bg);
}
[data-theme="dark"] .button-secondary:hover,
[data-theme="dark"] .button-quiet:hover,
[data-theme="dark"] .priority-tab:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
}
[data-theme="dark"] .priority-tab.is-active {
  color: var(--ink);
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
  box-shadow: inset 0 -2px var(--primary);
}
[data-theme="dark"] .priority-tab.is-active span { color: var(--muted); }
[data-theme="dark"] .notice-strip {
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}
[data-theme="dark"] .notice-mark { background: var(--primary); }
[data-theme="dark"] .kpi-card.is-highlight {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: inset 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}
[data-theme="dark"] .toolbar,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .panel {
  background: var(--surface);
  border-color: var(--border);
}
.kpi-card,
.kpi-card.is-highlight,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .kpi-card.is-highlight { border-top-color: #2F74E8; }
[data-theme="dark"] .toolbar {
  background: color-mix(in srgb, var(--surface-muted) 38%, var(--surface));
}
[data-theme="dark"] thead,
[data-theme="dark"] .config-tabs {
  border-color: var(--line);
}
[data-theme="dark"] .trend-metric-card,
[data-theme="dark"] .operation-tip,
[data-theme="dark"] .sidebar-foot {
  background: var(--surface-muted);
}
[data-theme="dark"] .nav-item.is-active .nav-short { background: var(--primary-soft); }
[data-theme="dark"] .link-tooltip {
  background: var(--overlay-bg);
  border-color: var(--overlay-border);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .chart-tooltip strong { color: var(--ink); }
[data-theme="dark"] input,
[data-theme="dark"] select {
  background-color: var(--control-bg);
  border-color: var(--border);
}

/* 经营看板与管理后台共用收起态下拉样式；保留原生选项菜单及键盘操作。 */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-left: 14px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4' fill='none' stroke='%235A6478' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4' fill='none' stroke='%23AAB5C8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
}
.pagination-controls select { width: 94px; height: 36px; min-height: 36px; padding-left: 14px; padding-right: 40px; }
#linkTrendSearch {
  padding-left: 14px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4' fill='none' stroke='%235A6478' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}
[data-theme="dark"] #linkTrendSearch {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4' fill='none' stroke='%23AAB5C8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
}
#linkTrendSearch::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
#trendLinkHint[hidden] { display: none; }
.chart-wrap { height: 320px; padding-bottom: 20px; }
@media (max-width: 640px) {
  .chart-wrap { height: 255px; }
  .anomaly-detail-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .anomaly-dialog-header,
  .anomaly-dialog-body,
  .anomaly-dialog-footer { padding-right: 14px; padding-left: 14px; }
  .anomaly-guide { grid-template-columns: 1fr; }
  .anomaly-dialog-footer { align-items: flex-start; flex-direction: column; }
  .anomaly-dialog-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 1120px) {
  .analysis-range { white-space: normal; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-workspace { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr); }
  .finance-summary-grid { gap:12px; }
}
@media (max-width: 900px) { .overview-division-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-content { padding: 20px 14px; }
  .overview-workspace { grid-template-columns: 1fr; }
  .sidebar-toggle { display:none; }
  .app-shell.is-sidebar-collapsed .sidebar { width:auto; padding:20px 12px; }
  .app-shell.is-sidebar-collapsed .brand-lockup > div:not(.brand-mark),.app-shell.is-sidebar-collapsed .nav-label { display:initial; }
  .app-shell.is-sidebar-collapsed .brand-lockup { justify-content:start; }
  .app-shell.is-sidebar-collapsed .nav-short { display:grid; }
  .app-shell.is-sidebar-collapsed .nav-item { padding:0 12px; }
  .sidebar {
    width: auto;
    background: linear-gradient(180deg, var(--nav-surface), var(--nav-surface-2));
  }
  .side-nav { gap: 8px; }
  .nav-group { display: contents; }
  .nav-group-title { display: none; }
}
@media (max-width: 900px) {
  .finance-summary-grid { grid-template-columns:1fr; }
  .unmatched-card-grid { grid-template-columns:1fr; }
  .exception-panel { grid-template-columns:1fr; grid-template-areas:"priority-head" "priority-list" "priority-tip"; }
  .exception-panel .exception-list { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .main-content { padding: 16px; }
  .filters > label,
  .filter-search-row > label { flex: 1 1 100%; width: 100%; }
  .filters label input,
  .filters label select { width: 100%; }
  .filter-search-row { flex: 1 1 100%; flex-wrap: wrap; width: 100%; gap: 20px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .finance-summary-grid article { padding:15px 18px 13px; }
  .finance-summary-breakdown > div { grid-template-columns:minmax(102px,auto) minmax(0,1fr); }
  .finance-list-title { align-items:flex-start; flex-direction:column; gap:4px; }
  .finance-list-actions { align-items:stretch; flex-direction:column; width:100%; }
  .finance-export-status { max-width:none; white-space:normal; }
  .finance-table-foot { flex-direction:column; }
  .overview-filter-row { align-items: stretch; flex-direction: column; }
  .overview-division-summary { grid-template-columns: 1fr; }
  .overview-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-date-fields label { min-width: 0; }
  .overview-date-fields input,
  .overview-division-filter select { width: 100%; }
  .overview-panel-head { flex-direction: column; }
  .overview-type-tabs { width: 100%; }
  .overview-type-tabs button { flex: 1; }
  .overview-total-grid { grid-template-columns: 1fr; }
  .overview-shop-more { min-width: 78px; padding: 0 10px; }
  .overview-shop-popover { grid-template-columns: 1fr; }
  .unmatched-toolbar .filters,.unmatched-toolbar label,.unmatched-toolbar input,.unmatched-toolbar select,.unmatched-toolbar .button { width:100%; }
  .kpi-card { height: 100px; }
  .main-grid,
  .secondary-grid { grid-template-columns: 1fr; }
  .trend-metric-grid { grid-template-columns: 1fr 1fr; }
  .link-select-label input { min-width: 0; width: 100%; }
  .table-panel table,.table-panel tbody,.table-panel tr,.table-panel td { display:block; width:100%; }
  .table-panel thead,.table-panel colgroup { display:none; }
  .table-panel tbody tr { padding:8px; border-bottom:1px solid var(--line-2); }
  .table-panel tbody td { display:flex; justify-content:space-between; align-items:center; min-height:30px; height:auto; overflow:visible; white-space:normal; border:0; }
  .table-panel tbody td::before { content:attr(data-label); flex:0 0 74px; color:var(--ink-2); font-size:11px; }
  .table-panel tbody td.link-cell { display:block; }
  .table-panel tbody td.link-cell::before { display:none; }
  .table-panel tbody td.numeric { white-space:normal; }
}

