:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e7ebf2;
  --text: #18212f;
  --muted: #667085;
  --navy: #10263f;
  --navy-2: #173b61;
  --blue: #2970ff;
  --blue-soft: #eef4ff;
  --red: #d92d20;
  --red-soft: #fff1f0;
  --green: #079455;
  --green-soft: #ecfdf3;
  --amber: #dc6803;
  --amber-soft: #fffaeb;
  --shadow: 0 12px 34px rgba(16, 38, 63, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1120px; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.splash, .login-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #e8f1ff 0, transparent 35%), linear-gradient(135deg, #f8fafc 0%, #edf3fb 100%); }
.splash-card { text-align: center; color: var(--navy); }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(145deg, var(--navy), var(--blue)); color: white; display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow); }
.spinner { width: 30px; height: 30px; border: 3px solid #d8e2ef; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin: 18px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card { width: 920px; min-height: 560px; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(16, 38, 63, .14); }
.login-brand { background: linear-gradient(145deg, #0f2743, #1e4e7c); color: white; padding: 54px; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 330px; height: 330px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -140px; bottom: -130px; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.login-brand h1 { font-size: 34px; line-height: 1.25; margin: 60px 0 18px; max-width: 330px; letter-spacing: -.02em; }
.login-brand p { color: #c9d8e8; line-height: 1.8; max-width: 350px; }
.login-points { list-style: none; padding: 0; margin: 44px 0 0; display: grid; gap: 16px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: #e8f1fb; }
.check-dot { width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.login-form { padding: 54px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 8px; font-size: 26px; }
.login-form .sub { color: var(--muted); margin-bottom: 30px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { color: #344054; font-size: 13px; font-weight: 650; }
.input, .select, .textarea { width: 100%; border: 1px solid #d7deea; background: #fff; color: var(--text); border-radius: 10px; padding: 11px 13px; outline: none; transition: .2s; }
.input:focus, .select:focus, .textarea:focus { border-color: #7da9ff; box-shadow: 0 0 0 3px #eaf1ff; }
.textarea { min-height: 84px; resize: vertical; }
.otp-row { display: grid; grid-template-columns: 1fr 112px; gap: 10px; }
.btn { border: 0; border-radius: 9px; padding: 10px 15px; color: #344054; background: #edf1f6; font-weight: 650; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--blue); }
.btn-primary:hover { background: #175cd3; }
.btn-dark { color: white; background: var(--navy); }
.btn-outline { background: white; border: 1px solid #d7deea; }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-small { padding: 7px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.login-divider { display: flex; align-items: center; gap: 10px; color: #98a2b3; margin: 20px 0; font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.form-error { min-height: 20px; color: var(--red); font-size: 12px; margin-top: 8px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { background: var(--navy); color: white; position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; z-index: 10; }
.brand { padding: 24px 22px 20px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong { display: block; font-size: 15px; }
.brand small { color: #9fb2c7; }
.nav { padding: 15px 12px; display: grid; gap: 4px; flex: 1; overflow: auto; }
.nav button { border: 0; color: #cbd7e5; background: transparent; display: flex; align-items: center; gap: 12px; border-radius: 9px; padding: 11px 13px; text-align: left; }
.nav button:hover { background: rgba(255,255,255,.07); color: white; }
.nav button.active { background: #285c8c; color: white; box-shadow: inset 3px 0 #7bb5ff; }
.nav-icon { width: 20px; text-align: center; opacity: .95; }
.sidebar-footer { padding: 15px 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #dcecff; color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.user-chip strong { font-size: 13px; display: block; }
.user-chip span { color: #9fb2c7; font-size: 12px; }
.main { grid-column: 2; min-height: 100vh; }
.topbar { height: 68px; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 9; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.period { border: 1px solid var(--line); background: white; padding: 8px 10px; border-radius: 9px; color: #344054; }
.content { padding: 25px 28px 42px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 10px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 14px rgba(16,38,63,.035); }
.metric { padding: 18px 20px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; width: 72px; height: 72px; border-radius: 50%; right: -24px; top: -26px; background: var(--blue-soft); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-size: 26px; font-weight: 780; margin: 9px 0 4px; letter-spacing: -.03em; }
.metric-foot { font-size: 12px; color: #98a2b3; }
.metric.positive .metric-value { color: var(--red); }
.metric.negative .metric-value { color: var(--green); }
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-title { font-size: 15px; font-weight: 760; }
.panel-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.banner { border: 1px solid #bad1fb; background: #f3f7ff; border-radius: 12px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.banner strong { color: #1849a9; font-size: 14px; }
.banner p { color: #475467; margin: 4px 0 0; font-size: 12px; }
.banner.warn { background: var(--amber-soft); border-color: #fedf89; }
.banner.warn strong { color: #93370d; }
.banner.danger { background: var(--red-soft); border-color: #fecdca; }
.banner.danger strong { color: #b42318; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; background: white; font-size: 12.5px; }
th { text-align: left; padding: 11px 13px; color: #475467; background: #f8fafc; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
td { padding: 11px 13px; border-bottom: 1px solid #eef1f5; color: #344054; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fbfcfe; }
tr.row-total td { background: #f8fafc; font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
tr.row-total:hover td { background: #f8fafc; }
.hint { margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-approved, .badge-synced { color: var(--green); background: var(--green-soft); }
.badge-pending { color: var(--amber); background: var(--amber-soft); }
.badge-draft { color: #475467; background: #f2f4f7; }
.badge-rejected { color: var(--red); background: var(--red-soft); }
.tag { display: inline-flex; border-radius: 6px; padding: 3px 7px; background: #f2f4f7; color: #475467; font-size: 11px; }
.tag-source { color: #175cd3; background: #eff8ff; }
.tag.warn { color: #93370d; background: var(--amber-soft); margin-left: 6px; font-weight: 600; }
.actions { display: flex; gap: 6px; align-items: center; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search { width: 260px; position: relative; }
.search .input { padding-left: 34px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 9px; color: #98a2b3; z-index: 1; }
.tabs { display: flex; gap: 4px; background: #eef1f6; padding: 4px; border-radius: 10px; width: fit-content; }
.tabs button { border: 0; background: transparent; color: #667085; padding: 7px 12px; border-radius: 7px; font-size: 12px; }
.tabs button.active { background: white; color: var(--navy); box-shadow: 0 1px 4px rgba(16,38,63,.08); font-weight: 700; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: #344054; margin-bottom: 6px; }
.chart { width: 100%; min-height: 220px; }
.chart-label { fill: #667085; font-size: 10px; }
.chart-grid { stroke: #eef1f5; stroke-width: 1; }
.chart-bar { fill: #4b8df8; }
.chart-bar:hover { fill: #175cd3; }
.progress-row { display: grid; grid-template-columns: 90px 1fr 74px; gap: 12px; align-items: center; margin: 12px 0; font-size: 12px; }
.progress-track { height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2970ff, #77a6ff); border-radius: inherit; }
.pie-wrap { display: grid; grid-template-columns: 168px 1fr; gap: 14px; align-items: center; }
.pie { width: 168px; height: 168px; }
.pie-center-value { fill: #18212f; font-size: 15px; font-weight: 700; }
.pie-center-label { fill: #667085; font-size: 10px; }
.pie-legend { display: grid; gap: 7px; min-width: 0; }
.pie-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px; gap: 8px; align-items: center; font-size: 12px; }
.pie-dot { width: 10px; height: 10px; border-radius: 3px; }
.pie-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pie-legend-row .num { font-size: 12px; }
.pie-legend-row .muted { text-align: right; font-size: 11px; }
.chart-axis-label { fill: #94a3b8; font-size: 9px; }
.chart-legend-inline { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi-list { display: grid; gap: 12px; }
.kpi-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 11px; border-bottom: 1px dashed var(--line); }
.kpi-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kpi-row span { color: var(--muted); font-size: 12px; }
.kpi-row strong { font-size: 14px; }
.warning-text { color: var(--amber); font-size: 11px; }
/* 配送时刻：销售订单列表的 HH:MM，等宽数字避免跳动 */
.moment-text { font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.negative-text { color: var(--green); }
/* 告警语义（非涨跌）：里程填报偏差、质检异常单数 */
.alert-text { color: var(--red); }
.positive-text { color: var(--red); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: grid; place-items: center; z-index: 50; padding: 30px; }
.modal { width: min(680px, 92vw); max-height: 88vh; overflow: auto; background: white; border-radius: 16px; box-shadow: 0 30px 80px rgba(16,38,63,.22); }
.modal-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.icon-btn { border: 0; width: 30px; height: 30px; border-radius: 8px; background: #f2f4f7; color: #667085; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.field.full { grid-column: 1 / -1; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; min-width: 280px; max-width: 420px; padding: 13px 16px; color: white; background: var(--navy); border-radius: 10px; box-shadow: var(--shadow); z-index: 100; animation: rise .2s ease-out; font-size: 13px; }
.toast.error { background: #b42318; }
.toast.success { background: #067647; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.audit-note { background: #f8fafc; border-left: 3px solid #98a2b3; padding: 10px 12px; color: #475467; font-size: 12px; border-radius: 0 8px 8px 0; }
.report-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
.report-menu { padding: 8px; height: fit-content; }
.report-menu button { width: 100%; border: 0; text-align: left; border-radius: 8px; background: transparent; color: #475467; padding: 10px 12px; }
.report-menu button.active { background: var(--blue-soft); color: #1849a9; font-weight: 700; }
.source-stat { display: flex; gap: 22px; align-items: center; }
.source-stat strong { display: block; font-size: 19px; }
.source-stat span { font-size: 11px; color: var(--muted); }
.preview-ribbon { position: fixed; top: 82px; right: 24px; background: #101828; color: white; padding: 8px 12px; border-radius: 8px; z-index: 20; font-size: 12px; box-shadow: var(--shadow); }
@media print {
  body { min-width: auto; background: white; }
  .sidebar, .topbar, .page-actions, .preview-ribbon, .btn { display: none !important; }
  .app-shell { display: block; }
  .main { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
.density-preview { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.density-preview .kpi-row { padding-top: 8px; padding-bottom: 8px; }
.density-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-bottom: 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: #f1f5f9; }
.density-summary .kpi-row { padding-top: 2px; padding-bottom: 2px; }
.badge-mini { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 600; line-height: 1.6; vertical-align: middle; }
.input-readonly { background: #f1f5f9; color: #334155; cursor: not-allowed; border-style: dashed; }
.input-readonly:focus { outline: none; box-shadow: none; }
.density-summary { grid-template-columns: repeat(4, 1fr); }

/* ===== 标准财务报表 ===== */
.stmt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.stmt-title { font-size: 19px; font-weight: 800; letter-spacing: 4px; color: var(--navy); }
.stmt-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.stmt-basis { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.stmt-table th { background: var(--surface-2); font-size: 12px; }
.stmt-table td { border-bottom: 1px solid #f1f4f9; }
.stmt-row.lv1 .stmt-label { color: #475467; }
.stmt-label { font-size: 13px; }
.stmt-note { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-weight: 400; }
tr.stmt-section td { background: var(--blue-soft); font-weight: 700; color: var(--navy); }
tr.stmt-section:hover td { background: var(--blue-soft); }
tr.stmt-item.lv1 td.stmt-label { padding-top: 4px; padding-bottom: 4px; }
tr.stmt-subtotal td { font-weight: 700; background: #f8fafc; border-top: 1px solid var(--line); }
tr.stmt-subtotal:hover td { background: #f8fafc; }
tr.stmt-total td { font-weight: 800; background: #f8fafc; border-top: 2px solid var(--navy); border-bottom: 2px solid var(--navy); }
tr.stmt-total:hover td { background: #f8fafc; }
.stmt-table .negative { color: var(--red); }
.stmt-check { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.stmt-check.ok { background: var(--green-soft); color: var(--green); }
.stmt-check.warn { background: var(--amber-soft); color: var(--amber); }

@media print {
  .stmt-basis, .report-menu, .top-actions { display: none !important; }
}
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--muted); }
.bulk-bar strong { color: var(--text); }
.bulk-bar button[disabled] { opacity: .45; cursor: not-allowed; }
.col-check { width: 38px; text-align: center; }
.col-check input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
tr.row-picked td { background: var(--blue-soft); }

/* ===== 往来查询 / 发票勾稽 ===== */
.party-filter { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr 1fr 1.3fr; gap: 14px; align-items: end; }
.party-filter .field { margin: 0; }
.seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.seg-group .seg { border: 0; background: transparent; padding: 9px 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.seg-group .seg.active { background: var(--blue); color: #fff; }
.input-file { padding: 7px 10px; background: var(--surface-2); }
.check-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.check-item:hover { background: var(--surface-2); }
.check-item input { width: 15px; height: 15px; accent-color: var(--blue); }
.check-main { flex: 1; }
.check-extra { color: var(--muted); font-variant-numeric: tabular-nums; }
.badge-mini.ok { background: var(--green-soft); color: var(--green); }
.badge-mini.warn { background: var(--amber-soft); color: var(--amber); }
.badge-mini.muted { background: #f2f4f7; color: #475467; }
.cell-summary { max-width: 320px; }

/* ===== 会计复核顶部筛选 ===== */
.review-filter-panel { margin-bottom: 12px; }
.review-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.review-filter-grid .field { margin: 0; gap: 5px; }
.review-filter-grid .field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.review-filter-grid .input { padding: 8px 11px; font-size: 13px; }
.filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.filter-chip { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.filter-chip strong { color: var(--text); }

@media (max-width: 1440px) {
  .review-filter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 1200px) {
  body { min-width: 960px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.stmt-section { background: #f2f4f7; font-weight: 700; color: #1f2a37; }
.ob-totals { margin-top: 12px; }
.ob-grid input.ob-input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }

/* 分录拆分块：一笔支出挂多个借方科目 */
.entries-table { margin: 8px 0; }
.entries-table th { font-size: 12px; color: #6b7280; font-weight: 600; padding: 4px 6px; text-align: left; }
.entries-table td { padding: 4px 6px; vertical-align: middle; }
.entries-table .entry-amount { width: 120px; text-align: right; }
.entries-table tfoot td { border-top: 1px solid var(--line, #e5e7eb); font-weight: 600; }
.split-subject { line-height: 1.5; }

/* —— 销售录入列表排版（2026-10-20）：配送时刻列固定两行（日期一行 / 时间一行），产品列窄占位单行显示 —— */
.cell-moment { white-space: nowrap; }
.cell-moment .moment-text { display: inline-block; font-size: 12px; letter-spacing: 0.02em; }
.cell-product { max-width: 8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
