/* 差旅账本 V3.0 — 素净账簿风格 */
:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --card-2: #f0efea;
  --text: #1b1d23;
  --muted: #62656d;
  --faint: #9a9ca3;
  --line: #e3e1da;
  --line-strong: #cfccc3;
  --brand: #1d2366;
  --brand-ink: #ffffff;
  --brand-soft: #eceefa;
  --accent: #1d2366;
  --accent-soft: #eceefa;
  --warn: #b44343;
  --warn-bg: #fbf0ef;
  --warn-line: #ebd2d0;
  --info: #9a6712;
  --info-bg: #fcf5e3;
  --info-line: #eadbb4;
  --ok: #296e46;
  --ok-bg: #ecf5ef;
  --ok-line: #cbe2d3;
  --mute: #64676f;
  --mute-bg: #f1f0ec;
  --mute-line: #dcdad2;
  --danger: #b4322a;
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --card: #1b1c21;
    --card-2: #23252b;
    --text: #e7e7ea;
    --muted: #a3a5ac;
    --faint: #6f727a;
    --line: #2b2d33;
    --line-strong: #3a3d44;
    --brand: #a9b2f2;
    --brand-ink: #121317;
    --brand-soft: #252943;
    --accent: #a9b2f2;
    --accent-soft: #252943;
    --warn: #e89595;
    --warn-bg: #2b1c1d;
    --warn-line: #4a2d2f;
    --info: #e2b764;
    --info-bg: #2c2415;
    --info-line: #493b1f;
    --ok: #7cc498;
    --ok-bg: #182920;
    --ok-line: #284635;
    --mute: #9b9ea6;
    --mute-bg: #23252b;
    --mute-line: #353841;
    --danger: #ec7d74;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button, .row, .chip, .cat, .seg__btn, .set-row, .tab { touch-action: manipulation; }
input, textarea, select { min-width: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.app { position: relative; max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
@media (min-width: 600px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.brand__logo { width: 68px; height: auto; padding: 5px 6px; background: #1d2366; border-radius: 5px; flex: none; }
.brand__text { display: flex; flex-direction: row; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; line-height: 1.15; padding-left: 9px; border-left: 1px solid var(--line-strong); }
.brand__name { font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--text); white-space: nowrap; }
.brand__swiss { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.topbar__add {
  display: inline-flex; align-items: center; gap: 4px;
  height: 38px; padding: 0 14px 0 11px;
  border-radius: var(--radius-sm);
  background: var(--brand); color: var(--brand-ink);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.topbar__add:active { opacity: .85; }
.topbar__add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- 视图 ---------- */
.views { padding: 0 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
.view { display: none; }
.view.is-active { display: block; }

/* ---------- 月份切换 ---------- */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 0 10px; }
.monthnav__arrow {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 22px; line-height: 1;
  display: grid; place-items: center; border: 1px solid var(--line); background: var(--card);
}
.monthnav__arrow:active { background: var(--card-2); }
.monthnav__label { font-size: 16px; font-weight: 600; letter-spacing: .02em; padding: 6px 12px; border-radius: var(--radius-sm); }
.monthnav__label:active { background: var(--card-2); }

/* ---------- 本月概览 ---------- */
.hero-shell { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 14px 0; }
.hero-shell .monthnav { padding: 10px 0 4px; }
.hero-shell .monthnav__arrow { width: 36px; height: 36px; border: 0; background: transparent; }
.hero { padding: 4px 0 0; }
.hero__label { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.hero__amount { font-size: 32px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.hero__stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin: 0 -14px; }
.hero__stat {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 10px 14px 12px; min-height: 58px;
}
.hero__stat + .hero__stat { border-left: 1px solid var(--line); }
.hero__stat:active, .hero__stat[aria-pressed="true"] { background: var(--brand-soft); }
.hero__stat-n { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hero__stat-n::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hero__stat--warn .hero__stat-n::before { background: var(--warn); }
.hero__stat--info .hero__stat-n::before { background: var(--info); }
.hero__stat-l { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.hero__stat-l small { font-size: 12px; font-weight: 400; color: var(--faint); margin-left: 4px; }

/* ---------- 明细标题 / 筛选 ---------- */
.ledger-heading { display: flex; align-items: center; gap: 6px; margin-top: 14px; min-height: 40px; }
.ledger-heading strong { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.ledger-heading .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; }

.filters { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filterbar { display: flex; align-items: center; gap: 8px; }
.filterbar__label { flex: none; width: 28px; font-size: 11.5px; color: var(--faint); }
.filters--city { flex: 1; min-width: 0; padding: 4px 0; }

.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px;
  padding: 6px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 13px;
}
.chip__n { font-size: 11px; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.chip.is-active .chip__n { color: var(--brand); opacity: .7; }
.chip--sm { padding: 5px 10px; font-size: 12.5px; }

.bulk-button { width: 100%; margin-top: 8px; justify-content: flex-start; min-height: 44px; color: var(--brand); background: var(--brand-soft); }

/* ---------- 明细列表 ---------- */
.daylist { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.day__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; font-size: 12.5px; color: var(--muted); }
.day__date { font-weight: 600; color: var(--text); }
.day__total { font-variant-numeric: tabular-nums; color: var(--muted); }
.day__card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.row { display: flex; align-items: stretch; width: 100%; }
.row + .row { border-top: 1px solid var(--line); }
.row__main {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px;
  padding: 11px 12px 11px 12px; text-align: left;
}
.row__main:active { background: var(--card-2); }
.row__icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--card-2); color: var(--muted);
}
.row__icon .ic { width: 19px; height: 19px; }
.row__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.row__sub { flex: 0 1 auto; min-width: 0; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row__amount { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row__status { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; border: 1px solid transparent; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.row__status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.row__status--warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.row__status--info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.row__status--ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.row__status--mute { color: var(--mute); background: var(--mute-bg); border-color: var(--mute-line); }

.row[data-status="none"] {
  box-shadow: inset 3px 0 0 #d97706;
  animation: unissuedYellowFlash 1.7s ease-in-out infinite;
}
@keyframes unissuedYellowFlash {
  0%, 100% { background-color: rgba(245, 158, 11, .03); }
  50% { background-color: rgba(245, 158, 11, .14); }
}
@media (prefers-color-scheme: dark) {
  .row[data-status="none"] { box-shadow: inset 3px 0 0 #eab308; animation: unissuedYellowFlashDark 1.7s ease-in-out infinite; }
  @keyframes unissuedYellowFlashDark {
    0%, 100% { background-color: rgba(234, 179, 8, .03); }
    50% { background-color: rgba(234, 179, 8, .12); }
  }
}

.row__act {
  flex: none; width: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-left: 1px dashed var(--line);
  color: var(--brand); font-size: 11.5px; font-weight: 600; line-height: 1.2;
}
.row__act .ic { width: 17px; height: 17px; stroke-width: 2; }
.row__act:active { background: var(--brand-soft); }

.badge { display: inline-block; flex: none; padding: 0 5px; border-radius: 4px; font-size: 10.5px; line-height: 17px; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--muted); }
.badge--takeout { border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.badge--company { border-color: color-mix(in srgb, var(--info) 40%, transparent); color: var(--info); }

/* ---------- 空状态 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px 30px; gap: 6px; }
.empty__icon { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; color: var(--faint); border: 1px dashed var(--line-strong); margin-bottom: 8px; }
.empty__icon .ic { width: 26px; height: 26px; }
.empty__title { font-size: 15.5px; font-weight: 600; margin: 0; }
.empty__text { font-size: 13px; color: var(--muted); margin: 0 0 14px; max-width: 260px; }

/* ---------- 统计 ---------- */
.stats-pro {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  margin: 0 0 12px; padding: 12px 14px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius); color: var(--text);
}
.stats-pro strong { font-size: 14px; font-weight: 600; color: var(--brand); }
.stats-pro span { font-size: 12px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

.stat-hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-hero__label { font-size: 12.5px; color: var(--muted); }
.stat-hero__amount { font-size: 30px; font-weight: 600; margin: 2px 0 2px; font-variant-numeric: tabular-nums; }
.stat-hero__sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sec-title { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .06em; margin: 22px 2px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.sec-title__hint { font-weight: 400; color: var(--faint); font-size: 11.5px; letter-spacing: 0; }

.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.stat-row:first-child { border-top: 0; }
.stat-row__label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--mute { background: var(--faint); }
.dot--info { background: var(--info); }
.dot--accent { background: var(--brand); }
.stat-row__amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.stat-row__n { font-size: 11.5px; color: var(--faint); font-weight: 400; margin-left: 6px; }

.bar { height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; margin: -4px 0 12px; }
.bar__fill { height: 100%; border-radius: 2px; background: var(--brand); }
.bar__fill--ok { background: var(--ok); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--mute { background: var(--faint); }
.bar__fill--info { background: var(--info); }

.stat-block { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.stat-block:first-child { border-top: 0; }
.stat-block .stat-row { padding: 0 0 7px; border-top: 0; }
.stat-block .bar { margin: 0 0 8px; }

.cat-row { padding: 11px 0; border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: 0; }
.cat-row__top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.cat-row__icon { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--card-2); color: var(--muted); flex: none; }
.cat-row__icon .ic { width: 15px; height: 15px; }
.cat-row__name { font-size: 13.5px; font-weight: 500; flex: 1; min-width: 0; }
.cat-row__pct { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.cat-row__amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.lchart { display: block; width: 100%; height: auto; font-family: inherit; }
.lchart__base { stroke: var(--line-strong); }
.lchart__area { fill: var(--brand); fill-opacity: .07; }
.lchart__line { fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.lchart__dot { fill: var(--card); stroke: var(--brand); stroke-width: 1.4; }
.lchart__label { font-size: 9px; font-weight: 600; fill: var(--muted); paint-order: stroke; stroke: var(--card); stroke-width: 2.5px; stroke-linejoin: round; }
.lchart__axis { font-size: 8.5px; fill: var(--faint); }
.chart-empty { padding: 34px 0; text-align: center; color: var(--faint); font-size: 12.5px; }

/* ---------- 设置 ---------- */
.pagehead { padding: 16px 2px 4px; }
.pagehead h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.pagehead p { font-size: 13px; color: var(--muted); margin: 0; }

.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.set-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row:active { background: var(--card-2); }
.set-row__ic { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.set-row__body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-row__t { font-size: 14px; font-weight: 500; }
.set-row__d { font-size: 12px; color: var(--faint); }
.set-row__chev { color: var(--faint); font-size: 18px; line-height: 1; }
.set-row--danger .set-row__t, .set-row--danger .set-row__ic { color: var(--danger); }

.set-input { display: flex; align-items: center; gap: 12px; padding: 12px 14px 8px; }
.set-input__label { flex: none; font-size: 14px; font-weight: 500; }
.set-input input { flex: 1; min-width: 0; padding: 9px 11px; font-size: 14px; }
.set-input__hint { padding: 0 14px 12px; font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.note-card { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 13px 14px; margin-top: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.note-card strong { color: var(--text); font-weight: 600; }
.note-card ul { margin: 6px 0 0; padding-left: 17px; }
.note-card li { margin: 2px 0; }
.version { text-align: center; font-size: 11.5px; color: var(--faint); margin: 24px 0 0; letter-spacing: .04em; }

/* ---------- 导出 Pro ---------- */
.pro-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.pro-summary__n { font-size: 12.5px; color: var(--muted); }
.pro-summary__n strong { font-size: 18px; color: var(--text); font-weight: 600; }
.pro-summary__amt { margin-left: auto; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pro-summary__hint { flex-basis: 100%; font-size: 11.5px; color: var(--faint); }
.pro-month { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 2px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pro-month span { font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.pro-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pro-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; text-align: left; }
.pro-row + .pro-row { border-top: 1px solid var(--line); }
.pro-row:active { background: var(--card-2); }
.pro-check { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: var(--brand-ink); font-size: 12px; font-weight: 700; line-height: 1; }
.pro-check.is-on { background: var(--brand); border-color: var(--brand); }
.pro-row__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pro-row__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-row__meta { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-row__amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pro-empty { padding: 54px 24px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 2; }
.pro-empty span { font-size: 12px; color: var(--faint); }
.pro-batch-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.pro-batch { margin-bottom: 12px; }
.pro-workbook { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.pro-workbook__title { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.pro-workbook table { border-collapse: collapse; width: 100%; font-size: 12px; }
.pro-workbook th, .pro-workbook td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.pro-workbook tr:last-child td { border-bottom: 0; }
.pro-workbook th { background: var(--card-2); color: var(--muted); font-weight: 500; }
.pro-workbook td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.pro-workbook td:last-child { overflow-wrap: anywhere; }
.pro-selection-title { margin: 14px 2px 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); display: flex; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--faint); font-size: 11px; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--brand); font-weight: 600; }
.tab.is-active::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 2px; margin-left: -14px; background: var(--brand); border-radius: 0 0 2px 2px; }

/* ---------- 记账面板 ---------- */
body.is-locked { overflow: hidden; }
.sheet {
  position: fixed; inset: 0; margin: 0 auto; max-width: 560px; z-index: 70;
  display: flex; flex-direction: column; background: var(--bg);
  visibility: hidden; transform: translateY(101%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .28s;
}
.sheet.is-open { visibility: visible; transform: none; transition: transform .28s cubic-bezier(.32, .72, 0, 1), visibility 0s; }
.sheet__head { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.sheet__cancel { color: var(--muted); font-size: 14.5px; text-align: left; padding: 10px 8px; }
.sheet__title { text-align: center; font-size: 15.5px; font-weight: 600; }
.sheet__save { color: var(--brand); font-size: 14.5px; font-weight: 600; text-align: right; padding: 10px 8px; }
.sheet__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 8px; overscroll-behavior: contain; }
.sheet__pad { height: 12px; }
.sheet__foot { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.sheet__foot .btn--ghost { flex: none; }

.quick-copy { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.quick-copy .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; }

.amount-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 12px; }
.amount-card__label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.amount-card__row { display: flex; align-items: baseline; gap: 6px; padding: 2px 0 4px; border-bottom: 1.5px solid var(--line-strong); }
.amount-card__row:focus-within { border-bottom-color: var(--brand); }
.amount-card__sym { font-size: 22px; font-weight: 500; color: var(--faint); }
.amount-card input.amount-card__input {
  flex: 1; width: auto !important; max-width: 100%; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none;
  text-align: left; font-size: 36px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0; color: var(--text);
}
.amount-card input.amount-card__input:focus { border: 0; box-shadow: none; }
.amount-card__input::placeholder { color: var(--faint); opacity: .45; }
.amount-card__error { font-size: 12px; color: var(--danger); padding-top: 6px; }
.amount-card__input.is-error { color: var(--danger); }
.amount-card__sub { margin-top: 10px; }
.amount-card__sub-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.amount-card__sub-row { display: flex; align-items: baseline; gap: 5px; border-bottom: 1px solid var(--line); }
.amount-card__sym--sm { font-size: 17px; }
.amount-card input.amount-card__input--sm { font-size: 22px; }
.amount-card__equation { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.75; font-variant-numeric: tabular-nums; }
.amount-card__equation strong { color: var(--text); font-weight: 600; }
.amount-card__equation .amount-eq__total { color: var(--brand); }
.amount-eq__op { margin: 0 4px; color: var(--faint); }

.field { margin-top: 18px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 2px 8px; letter-spacing: .02em; }
.field__label--sm { margin-top: 12px; font-weight: 500; color: var(--faint); }
.field__hint { font-weight: 400; color: var(--faint); font-size: 11.5px; margin-left: 4px; }
.field__note { font-size: 12px; color: var(--faint); margin: 7px 2px 0; line-height: 1.5; }
.field__note--error { color: var(--danger); }

input[type="text"], input[type="date"], textarea, select {
  width: 100%; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 15px; outline: none; appearance: none; -webkit-appearance: none;
}
input[type="text"]:focus, input[type="date"]:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
textarea { resize: vertical; min-height: 62px; line-height: 1.5; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}

.date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; }
.date-row input[type="date"] { padding: 10px 12px; }
.date-row--two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.date-row .chip { min-height: 42px; padding: 0 11px; }

.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cat {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 0 6px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.cat__icon { display: grid; place-items: center; }
.cat__icon .ic { width: 18px; height: 18px; }
.cat__label { font-size: 13px; white-space: nowrap; }
.cat.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 .5px var(--brand); }

.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.status-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); text-align: left; color: var(--muted);
}
.status-opt__t { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.status-opt__t::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.status-opt[data-status="none"] .status-opt__t::before { background: var(--warn); }
.status-opt[data-status="invoiced"] .status-opt__t::before { background: var(--info); }
.status-opt[data-status="done"] .status-opt__t::before { background: var(--ok); }
.status-opt[data-status="noNeed"] .status-opt__t::before { background: var(--mute); }
.status-opt__d { font-size: 11px; color: var(--faint); padding-left: 12px; }
.status-opt.is-active { border-color: var(--brand); background: var(--brand-soft); }
.status-opt.is-active .status-opt__t { color: var(--brand); font-weight: 600; }
.status-opt.is-active .status-opt__d { color: var(--brand); opacity: .75; }
.status-opt[data-status="none"].is-active { border-color: var(--warn-line); background: var(--warn-bg); }
.status-opt[data-status="none"].is-active .status-opt__t, .status-opt[data-status="none"].is-active .status-opt__d { color: var(--warn); }
.status-opt[data-status="invoiced"].is-active { border-color: var(--info-line); background: var(--info-bg); }
.status-opt[data-status="invoiced"].is-active .status-opt__t, .status-opt[data-status="invoiced"].is-active .status-opt__d { color: var(--info); }
.status-opt[data-status="done"].is-active { border-color: var(--ok-line); background: var(--ok-bg); }
.status-opt[data-status="done"].is-active .status-opt__t, .status-opt[data-status="done"].is-active .status-opt__d { color: var(--ok); }
.status-opt[data-status="noNeed"].is-active { border-color: var(--mute-line); background: var(--mute-bg); }
.status-opt[data-status="noNeed"].is-active .status-opt__t, .status-opt[data-status="noNeed"].is-active .status-opt__d { color: var(--mute); }

.seg { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.seg__btn { flex: 1; padding: 10px 2px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.seg__btn + .seg__btn { border-left: 1px solid var(--line-strong); }
.seg__btn.is-active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

.check-row {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding: 11px 12px;
  border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); cursor: pointer;
}
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check-row__body { display: flex; flex-direction: column; gap: 1px; }
.check-row__label { font-size: 14px; font-weight: 500; color: var(--text); }
.check-row__hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.diners { margin-top: 8px; }
.subfield { padding-top: 2px; }

.editor-more { margin-top: 0; border: 0; background: transparent; padding: 0; border-radius: 0; }
#editorDefaults { display: none; }
.editor-status-action { min-height: 40px; margin-top: 10px; }

.danger-link { width: 100%; margin-top: 22px; padding: 12px; border-radius: var(--radius-sm); color: var(--danger); font-size: 14px; font-weight: 500; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn--lg { width: 100%; padding: 14px; font-size: 16px; }
.btn--sm { padding: 8px 14px; font-size: 13.5px; }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: var(--card); color: var(--text); border: 1px solid var(--line-strong); }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 10px); width: min(calc(100% - 32px), 440px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: #23252c; color: #f2f2f4; font-size: 13.5px;
  opacity: 0; visibility: hidden; z-index: 90;
  transition: opacity .18s, transform .18s, visibility 0s linear .18s;
}
@media (prefers-color-scheme: dark) { .toast { background: #e7e7ea; color: #1b1d23; } }
.toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s, visibility 0s; }
.toast__action { color: #b9c1ff; font-size: 13.5px; font-weight: 600; flex: none; padding: 4px 2px; }
@media (prefers-color-scheme: dark) { .toast__action { color: #1d2366; } }

/* ---------- 确认弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(15, 16, 20, .45); opacity: 0; visibility: hidden; transition: opacity .16s, visibility 0s linear .16s; }
.modal.is-open { opacity: 1; visibility: visible; transition: opacity .16s, visibility 0s; }
.modal__card { width: 100%; max-width: 320px; background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.modal__card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.modal__card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 380px) {
  .row__main { padding: 11px 10px; gap: 9px; }
  .row__act { width: 52px; }
  .row__title { font-size: 14px; }
  .hero__amount { font-size: 29px; }
  .cat { gap: 5px; }
  .cat__label { font-size: 12.5px; }
}
@media (max-width: 340px) {
  .row__sub { display: none; }
  .cat__icon { display: none; }
  .status-opt__d { display: none; }
}

.filter-search { margin-top: 8px; }
.filter-search input[type="text"] { padding: 8px 11px; font-size: 13.5px; }
.vendor-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.vendor-chips[hidden] { display: none !important; }

/* ---------- 实时时钟与 25 日报账闪烁提醒 ---------- */
.clock-bar {
  margin-top: 10px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.clock-bar__time { font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: .02em; }
.clock-bar__sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero-shell { margin-top: 10px; }

.reimb-alert {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--radius);
  background: #fff1f0; border: 1.5px solid #e11d48; color: #9f1239;
  animation: reimbFlash 1.35s ease-in-out infinite;
}
@media (prefers-color-scheme: dark) {
  .reimb-alert { background: #2d1219; border-color: #f43f5e; color: #fecdd3; animation: reimbFlashDark 1.35s ease-in-out infinite; }
}
@keyframes reimbFlash {
  0%, 100% { border-color: #e11d48; box-shadow: 0 0 0 0 rgba(225, 29, 72, .38); background-color: #fff1f0; }
  50% { border-color: #be123c; box-shadow: 0 0 0 5px rgba(225, 29, 72, 0); background-color: #ffe4e6; }
}
@keyframes reimbFlashDark {
  0%, 100% { border-color: #f43f5e; box-shadow: 0 0 0 0 rgba(244, 63, 94, .35); background-color: #2d1219; }
  50% { border-color: #fb7185; box-shadow: 0 0 0 5px rgba(244, 63, 94, 0); background-color: #3f1621; }
}
@keyframes dotBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .25; } }

.reimb-alert__head { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.reimb-alert__dot { width: 8px; height: 8px; border-radius: 50%; background: #e11d48; flex: none; animation: dotBlink .9s steps(2, start) infinite; }
@media (prefers-color-scheme: dark) { .reimb-alert__dot { background: #fb7185; } }
.reimb-alert__desc { margin: 4px 0 0 15px; font-size: 12px; opacity: .9; font-variant-numeric: tabular-nums; }
.reimb-alert__actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 15px; }
.reimb-alert__btn {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid currentColor; font-size: 12px; font-weight: 600;
  color: inherit; background: rgba(255, 255, 255, .6);
}
@media (prefers-color-scheme: dark) { .reimb-alert__btn { background: rgba(0, 0, 0, .25); } }
.reimb-alert__btn:active { opacity: .75; }

/* ---------- 金额随手算式 ---------- */
.amount-card__op {
  flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--card-2); color: var(--brand);
  font-size: 20px; font-weight: 600; display: grid; place-items: center; align-self: center;
}
.amount-card__op:active { background: var(--brand-soft); }
.amount-card__calc { margin-top: 5px; font-size: 12.5px; color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.credits { text-align: center; font-size: 11px; color: var(--faint); margin: 4px 0 0; letter-spacing: .03em; }

/* ---------- 餐饮人均分摊 ---------- */
.amount-card__per { margin-top: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.amount-card__per strong { color: var(--brand); font-weight: 600; }

/* ---------- 设置：粘贴助手与公司花名册 ---------- */
.copy-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.copy-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.copy-row:first-child { border-top: 0; }
.copy-row__label { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-row input.copy-row__input { border: 1px solid transparent; background: transparent; padding: 6px 8px; font-size: 13.5px; color: var(--text); border-radius: 5px; }
.copy-row input.copy-row__input:focus { background: var(--card-2); border-color: var(--line-strong); box-shadow: none; }
.copy-btn { flex: none; padding: 5px 10px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--brand); font-size: 12px; font-weight: 600; white-space: nowrap; }
.copy-btn:active { background: var(--brand-soft); }
.roster-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.roster-card__head { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; background: var(--card-2); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.roster-del { color: var(--danger); font-size: 12px; font-weight: 500; padding: 2px 6px; }
.roster-add { width: 100%; margin-top: 8px; min-height: 40px; }

/* ---------- 统计：每日支出柱状图 ---------- */
.bchart { display: block; width: 100%; height: auto; font-family: inherit; }
.bchart__grid { stroke: var(--line); stroke-dasharray: 2 3; }
.bchart__base { stroke: var(--line-strong); }
.bchart__bar { fill: var(--brand); fill-opacity: .72; }
.bchart__bar--peak { fill: var(--brand); fill-opacity: 1; }
.bchart__label { font-size: 8.5px; font-weight: 600; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bchart__axis { font-size: 8.5px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.sec-title__action { font-size: 12px; font-weight: 500; color: var(--brand); }

/* ---------- 设置：可折叠面板 ---------- */
.fold-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
.fold-panel__sum {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 13px 14px; user-select: none;
}
.fold-panel__sum::-webkit-details-marker { display: none; }
.fold-panel__sum:active { background: var(--card-2); }
.fold-panel__ic { width: 24px; height: 24px; display: grid; place-items: center; color: var(--brand); }
.fold-panel__body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fold-panel__t { font-size: 14.5px; font-weight: 600; color: var(--text); }
.fold-panel__d { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold-panel__chev { color: var(--faint); font-size: 18px; line-height: 1; transition: transform .16s ease; }
.fold-panel[open] > .fold-panel__sum { border-bottom: 1px solid var(--line); background: var(--card-2); }
.fold-panel[open] > .fold-panel__sum .fold-panel__chev { transform: rotate(90deg); color: var(--brand); }
.fold-panel__content { padding: 10px 12px 12px; background: var(--bg); }
.fold-panel__content .copy-list { margin-top: 0; }
.fold-panel__content .filter-search { margin-top: 0; margin-bottom: 8px; }
.fold-panel__bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
