:root {
  color-scheme: light;
  --bg: #f4f1e9;
  --surface: #fffdf8;
  --soft: #f7f4ed;
  --line: #ded7c8;
  --ink: #1b2a33;
  --mute: #61707a;
  --accent: #164b6b;
  --accent-ink: #0d3448;
  --accent-soft: #e3eef3;
  --gold: #a56a12;
  --gold-soft: #f7ead4;
  --danger: #9c3b2e;
  --danger-soft: #f9e4de;
  --ok: #2f6b4f;
  --hero: #132f44;
  --hero-2: #1c4f63;
  --shadow: 0 8px 26px #17324712;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1a20;
  --surface: #17262e;
  --soft: #1d2f38;
  --line: #30444e;
  --ink: #eef5f4;
  --mute: #a9bcc1;
  --accent: #8fc7dd;
  --accent-ink: #c8e8f4;
  --accent-soft: #1c3946;
  --gold: #e2b263;
  --gold-soft: #3d2f1c;
  --danger: #ffa694;
  --danger-soft: #432a26;
  --ok: #8fd2ae;
  --hero: #102b3c;
  --hero-2: #1b4757;
  --shadow: 0 8px 26px #00000038;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
p, h1, h2, h3, ul, figure { margin: 0; }
p { line-height: 1.65; }
ul { padding-left: 1.15rem; }
h1 { font-size: clamp(1.65rem, 3.2vw, 2.3rem); line-height: 1.18; letter-spacing: -0.035em; }
h2 { font-size: 1.20rem; line-height: 1.3; letter-spacing: -0.02em; }
h3 { font-size: 1rem; }
small { color: var(--mute); }
:focus-visible { outline: 3px solid #7fb7c9; outline-offset: 2px; }

.skip {
  position: fixed; top: -80px; left: 12px; z-index: 30;
  background: var(--surface); color: var(--ink); padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--line);
}
.skip:focus { top: 12px; }

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 66px 1fr;
}

.sidebar {
  grid-row: 1 / -1;
  position: sticky; top: 0;
  height: 100dvh;
  display: flex; flex-direction: column;
  padding: 24px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
  z-index: 4;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 9px; margin-bottom: 26px; color: var(--ink);
}
.brand img { border-radius: 12px; width: 42px; height: 42px; }
.brand strong { display: block; font-size: 1.16rem; letter-spacing: -0.03em; }
.brand small { display: block; color: var(--mute); font-size: 0.67rem; letter-spacing: 0.10em; margin-top: 3px; }

.nav-group { display: grid; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  min-height: 44px; padding: 8px 11px;
  border-radius: 10px; color: var(--mute); font-weight: 600; font-size: 0.93rem;
}
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 760; }
.nav-item .icon { width: 22px; }
.icon { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; flex: none; font-family: system-ui, sans-serif; line-height: 1; }

.sidebar-foot {
  margin-top: auto; padding: 14px 9px 2px; border-top: 1px solid var(--line);
  display: grid; gap: 7px; color: var(--mute); font-size: 0.76rem;
}

.top {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 3vw, 38px);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; color: var(--mute); }
.crumb strong { color: var(--ink); }
.crumb .icon { font-size: 0.85em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button {
  display: inline-grid; place-items: center; min-width: 40px; min-height: 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--ink);
}
.icon-button:hover { border-color: var(--accent); }

.workspace {
  width: 100%; max-width: 1320px; margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 38px) 54px;
}

.env-banner {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 13px; margin-bottom: 20px;
  border: 1px solid #e4cfaa; border-radius: 12px;
  background: var(--gold-soft); color: #6c4708;
  font-size: 0.82rem; line-height: 1.55;
}
:root[data-theme="dark"] .env-banner { border-color: #5c4a2c; color: #f0d8ac; }
.env-banner .icon { margin-top: 2px; }

.page-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.page-heading p { color: var(--mute); margin-top: 8px; max-width: 78ch; }

.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-size: 0.9rem; font-weight: 650; line-height: 1.25; text-align: center;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .button.primary { color: #0b1b23; }
.button.primary:hover { filter: brightness(1.08); color: #fff; }
.button.light { background: #e7f4ee; border-color: #e7f4ee; color: #154b3c; }
.button.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.button.small { min-height: 36px; padding: 6px 11px; font-size: 0.82rem; }
.button:disabled { opacity: 0.55; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--soft);
  color: var(--mute); font-size: 0.72rem; font-weight: 650; white-space: nowrap;
}
.tag.warning { background: var(--gold-soft); border-color: transparent; color: #7a530c; }
:root[data-theme="dark"] .tag.warning { color: #f0d39d; }
.tag.plain { background: transparent; }

.hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 28px clamp(20px, 3vw, 34px);
  border-radius: 20px;
  background: linear-gradient(118deg, var(--hero), var(--hero-2));
  color: #f2fbf8;
}
.hero::after {
  content: ""; position: absolute; right: -70px; bottom: -95px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid #b7e3e033;
  box-shadow: 0 0 0 30px #b7e3e00e, 0 0 0 70px #b7e3e008;
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid #b7e3e044; color: #cdebe6; font-size: 0.74rem;
}
.hero h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); max-width: 34ch; }
.hero p { color: #d5eae7; max-width: 58ch; font-size: 0.92rem; }
.hero .actions { margin-top: 4px; }
.hero .button { border-color: #ffffff45; }
.hero .button.light { background: #f1fbf7; border-color: #f1fbf7; color: #14463c; }

.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin: 16px 0 0;
}
.metric { padding: 16px 17px; min-width: 0; }
.metric-title { display: block; color: var(--mute); font-size: 0.77rem; }
.metric strong { display: block; margin-top: 5px; font-size: 1.36rem; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 4px; font-size: 0.76rem; line-height: 1.45; }
.metric strong[data-state="active"], [data-sw-status][data-state="active"] { color: var(--ok); }
.metric strong[data-state="error"], [data-sw-status][data-state="error"] { color: var(--danger); }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head p { color: var(--mute); font-size: 0.84rem; margin-top: 3px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.two-col > .panel { align-self: start; }
.section-space { margin-top: 15px; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.88rem; line-height: 1.55; }
.check-list li .icon { margin-top: 2px; color: var(--ok); }
.check-list li .tag { margin-top: 1px; }
.muted-list li .icon { color: var(--mute); }

.empty {
  display: grid; place-items: center; gap: 7px;
  text-align: center; padding: 28px 12px; min-height: 150px;
}
.empty-glyph {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
}
.empty p { color: var(--mute); font-size: 0.83rem; max-width: 42ch; }
.empty .button { margin-top: 4px; }

.sample-list { display: grid; }
.list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line); min-width: 0;
}
.list-item:first-child { border-top: 0; }
.item-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink);
}
.list-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-body p { color: var(--mute); font-size: 0.8rem; margin: 2px 0 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--mute); font-size: 0.85rem; }
.sample-summary {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px;
}
.sample-summary span {
  padding: 4px 9px; border-radius: 8px; background: var(--soft);
  border: 1px solid var(--line); color: var(--mute); font-size: 0.75rem;
}

.table-wrap { overflow-x: auto; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th, .table td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table tr:first-child th, .table tr:first-child td { border-top: 0; }
.table th { width: 31%; color: var(--mute); font-weight: 620; }

.form-stack { display: grid; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; font-size: 0.85rem; font-weight: 650; }
.field small { font-weight: 400; line-height: 1.45; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; min-height: 42px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--soft); color: var(--ink);
}
input:disabled, select:disabled { opacity: 0.65; background: var(--soft); }
input::placeholder { color: var(--mute); opacity: 0.75; }

.notice {
  padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.83rem; line-height: 1.55;
}
.notice.warning { background: var(--gold-soft); color: #6c4708; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .notice.warning { color: #f0d8ac; }

.migration-steps { display: grid; gap: 7px; }
.migration-steps[data-done="false"] { margin-top: 12px; }
.step {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px;
  padding: 9px 10px; border-radius: 9px; background: var(--soft); border: 1px solid var(--line);
}
.step-mark { font-weight: 800; text-align: center; }
.step-ok .step-mark { color: var(--ok); }
.step-fail { border-color: var(--danger); }
.step-fail .step-mark { color: var(--danger); }
.step strong { display: block; font-size: 0.84rem; }
.step p { color: var(--mute); font-size: 0.78rem; margin-top: 2px; }

dialog {
  width: min(620px, calc(100vw - 28px)); max-height: 88dvh; overflow: auto;
  padding: 18px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 22px 80px #0b1d2a66;
}
dialog::backdrop { background: #0c1c27a6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.dialog-body { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.preview-entry { padding: 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.preview-entry p { color: var(--mute); font-size: 0.84rem; margin: 3px 0 8px; }
.preview-entry .notice { margin-top: 8px; }

#status { position: fixed; right: 16px; bottom: 16px; z-index: 40; max-width: min(460px, calc(100vw - 32px)); }
#status:empty { display: none; }
#status .notice { border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 15px; }

.mobile-nav { display: none; }

.loading { padding: 42px; color: var(--mute); }

@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px 1fr; }
  .sidebar { display: none; }
  .top { padding: 0 14px; }
  .workspace { padding: 18px 14px 92px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    justify-content: space-around; gap: 2px;
    padding: 4px 5px max(4px, env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .mobile-nav .nav-item {
    display: grid; justify-items: center; gap: 2px;
    min-width: 58px; min-height: 48px; padding: 4px; margin: 0;
    font-size: 0.7rem; border-radius: 8px;
  }
  .mobile-nav .nav-item .icon { font-size: 1.05rem; height: 20px; }
  #status { bottom: 70px; }
}

@media (max-width: 680px) {
  .two-col, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 13px; }
  .panel { padding: 14px; }
  .hero { padding: 22px 17px; }
  .crumb .top-label, .top-actions .tag { display: none; }
  input:not([type="checkbox"]), select, textarea { font-size: 16px; }
  .list-item { flex-wrap: wrap; }
  .list-item > .mono { width: 100%; margin-left: 46px; }
  .table th { width: 38%; }
  dialog { padding: 15px; }
}

@media (max-width: 380px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .mobile-nav .nav-item { min-width: 50px; }
}

/* ===== 候选版（DEV-002..007）新增组件 ===== */
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.amount.up { color: var(--danger); }
.amount.down { color: var(--ok); }
.danger-text { color: var(--danger); }
.muted { color: var(--mute); }
.stack { display: grid; gap: 10px; }
.section-space { margin-top: 18px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.inline-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.page-heading-text { max-width: 760px; }
.pill-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; cursor: pointer; }
.pill-button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.nav-section { padding: 14px 14px 4px; font-size: 11px; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-icon { font-size: 20px; color: var(--accent); }
.tile strong { font-size: 15px; }
.tile p { margin: 0; color: var(--mute); font-size: 13px; }
.metric small { color: var(--mute); }
.stat-lines { display: grid; gap: 10px; }
.stat-lines > div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.stat-lines span { color: var(--mute); font-size: 13px; }
.networth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; }
.networth-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.networth-head span { color: var(--mute); }
.networth-head strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.mini-chart { display: flex; align-items: flex-end; gap: 4px; height: 64px; padding-top: 6px; }
.mini-chart span { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-soft)); border-radius: 4px 4px 0 0; min-height: 4px; }
.bar-list { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 1fr) 2fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { background: var(--soft); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar-value { text-align: right; font-size: 12px; }
.bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar.warning span { background: var(--gold); }
.bar.danger span { background: var(--danger); }
.budget-mini { display: grid; gap: 12px; }
.budget-mini-row { display: grid; gap: 5px; }
.budget-mini-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pending-mini { display: grid; gap: 4px; }
.pending-mini-row { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); align-items: center; }
.pending-mini-row small { display: block; color: var(--mute); }
.upcoming { margin-top: 12px; display: grid; gap: 6px; }
.upcoming p { display: flex; justify-content: space-between; margin: 0; font-size: 13px; }
.tx-list { display: grid; gap: 2px; }
.tx-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.tx-row:hover { background: var(--soft); }
.tx-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.tx-main { display: grid; gap: 1px; min-width: 0; }
.tx-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-main small { color: var(--mute); font-size: 12px; }
.tx-note { color: var(--mute); font-size: 12px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-side { display: grid; gap: 3px; justify-items: end; text-align: right; }
.account-groups { display: grid; gap: 14px; }
.account-list { display: grid; gap: 2px; }
.account-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.account-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.account-dot.closed { background: var(--mute); }
.account-main { display: grid; gap: 1px; }
.account-main small { color: var(--mute); font-size: 12px; }
.account-balance { display: grid; gap: 1px; justify-items: end; text-align: right; }
.account-balance small { color: var(--mute); font-size: 11px; }
.type-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.type-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.type-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.split-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.split-head { display: flex; justify-content: space-between; align-items: center; }
.split-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 8px; align-items: center; }
.split-row input, .split-row select { width: 100%; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.filter-bar label { display: grid; gap: 4px; font-size: 12px; color: var(--mute); }
.filter-bar input, .filter-bar select { min-width: 120px; }
.tab-bar { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tab { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--mute); font-size: 13px; white-space: nowrap; }
.tab.active { background: var(--accent); color: #fff; }
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; color: var(--mute); font-size: 13px; }
.breadcrumb .button { padding: 4px 10px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-amount { font-size: 24px; font-variant-numeric: tabular-nums; }
.details { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; }
.details summary { cursor: pointer; color: var(--mute); font-size: 13px; }
.form-stack { display: grid; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field small { color: var(--mute); font-size: 11px; }
.entry-panel { max-width: 980px; }
.taxonomy-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.taxonomy-column { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--soft); }
.taxonomy-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.taxonomy-list { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.taxonomy-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.taxonomy-actions { margin-left: auto; display: flex; gap: 4px; }
.budget-list { display: grid; gap: 14px; }
.budget-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.budget-row-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.budget-row-head small { display: block; color: var(--mute); font-size: 12px; }
.budget-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.budget-numbers { font-size: 12px; color: var(--mute); }
.pending-list { display: grid; gap: 12px; }
.pending-card { border-left: 4px solid var(--accent); }
.pending-card.warning { border-left-color: var(--gold); }
.pending-card.blocking { border-left-color: var(--danger); }
.pending-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pending-title { display: flex; gap: 8px; align-items: center; }
.candidate-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.impact-list { border-top: 1px dashed var(--line); padding-top: 8px; }
.mapping-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.mapping-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; align-items: center; font-size: 12px; }
.import-result { display: grid; gap: 12px; }
.summary-text { white-space: pre-wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 12px; overflow: auto; }
.conflict-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.conflict-head { display: flex; justify-content: space-between; gap: 10px; }
.lock-screen { min-height: 70vh; display: grid; place-items: center; }
.lock-card { width: min(440px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; display: grid; gap: 14px; box-shadow: var(--shadow); text-align: center; }
.lock-card h1 { margin: 0; font-size: 22px; }
.lock-card form { text-align: left; display: grid; gap: 12px; }
.empty-screen { max-width: 560px; margin: 10vh auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.app-footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--mute); font-size: 11px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.section-header h2 { margin: 0; font-size: 16px; }
.section-header p { margin: 2px 0 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; font: inherit; text-decoration: underline; }
.dialog-body { display: grid; gap: 12px; }
dialog.wide { width: min(960px, 94vw); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag.ok { background: #e4f2e8; color: #245c40; }
.tag.warning { background: var(--gold-soft); color: var(--gold); }
.tag.plain { background: var(--soft); color: var(--mute); }
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric strong { font-size: 17px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar label { width: 100%; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .mapping-row { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr 1fr 32px; }
  .tx-side .tag { display: none; }
  .account-balance small { display: none; }
  .app-footer { flex-direction: column; }
  .lock-card { padding: 18px; }
}

/* 动态宽度/高度类（CSP 兼容，避免内联样式） */
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.h-0 { height: 0%; }
.h-1 { height: 1%; }
.h-2 { height: 2%; }
.h-3 { height: 3%; }
.h-4 { height: 4%; }
.h-5 { height: 5%; }
.h-6 { height: 6%; }
.h-7 { height: 7%; }
.h-8 { height: 8%; }
.h-9 { height: 9%; }
.h-10 { height: 10%; }
.h-11 { height: 11%; }
.h-12 { height: 12%; }
.h-13 { height: 13%; }
.h-14 { height: 14%; }
.h-15 { height: 15%; }
.h-16 { height: 16%; }
.h-17 { height: 17%; }
.h-18 { height: 18%; }
.h-19 { height: 19%; }
.h-20 { height: 20%; }
.h-21 { height: 21%; }
.h-22 { height: 22%; }
.h-23 { height: 23%; }
.h-24 { height: 24%; }
.h-25 { height: 25%; }
.h-26 { height: 26%; }
.h-27 { height: 27%; }
.h-28 { height: 28%; }
.h-29 { height: 29%; }
.h-30 { height: 30%; }
.h-31 { height: 31%; }
.h-32 { height: 32%; }
.h-33 { height: 33%; }
.h-34 { height: 34%; }
.h-35 { height: 35%; }
.h-36 { height: 36%; }
.h-37 { height: 37%; }
.h-38 { height: 38%; }
.h-39 { height: 39%; }
.h-40 { height: 40%; }
.h-41 { height: 41%; }
.h-42 { height: 42%; }
.h-43 { height: 43%; }
.h-44 { height: 44%; }
.h-45 { height: 45%; }
.h-46 { height: 46%; }
.h-47 { height: 47%; }
.h-48 { height: 48%; }
.h-49 { height: 49%; }
.h-50 { height: 50%; }
.h-51 { height: 51%; }
.h-52 { height: 52%; }
.h-53 { height: 53%; }
.h-54 { height: 54%; }
.h-55 { height: 55%; }
.h-56 { height: 56%; }
.h-57 { height: 57%; }
.h-58 { height: 58%; }
.h-59 { height: 59%; }
.h-60 { height: 60%; }
.h-61 { height: 61%; }
.h-62 { height: 62%; }
.h-63 { height: 63%; }
.h-64 { height: 64%; }
.h-65 { height: 65%; }
.h-66 { height: 66%; }
.h-67 { height: 67%; }
.h-68 { height: 68%; }
.h-69 { height: 69%; }
.h-70 { height: 70%; }
.h-71 { height: 71%; }
.h-72 { height: 72%; }
.h-73 { height: 73%; }
.h-74 { height: 74%; }
.h-75 { height: 75%; }
.h-76 { height: 76%; }
.h-77 { height: 77%; }
.h-78 { height: 78%; }
.h-79 { height: 79%; }
.h-80 { height: 80%; }
.h-81 { height: 81%; }
.h-82 { height: 82%; }
.h-83 { height: 83%; }
.h-84 { height: 84%; }
.h-85 { height: 85%; }
.h-86 { height: 86%; }
.h-87 { height: 87%; }
.h-88 { height: 88%; }
.h-89 { height: 89%; }
.h-90 { height: 90%; }
.h-91 { height: 91%; }
.h-92 { height: 92%; }
.h-93 { height: 93%; }
.h-94 { height: 94%; }
.h-95 { height: 95%; }
.h-96 { height: 96%; }
.h-97 { height: 97%; }
.h-98 { height: 98%; }
.h-99 { height: 99%; }
.h-100 { height: 100%; }

.order-item { display: grid; grid-template-columns: 1.2fr 1.2fr .7fr .7fr .9fr .7fr 32px; gap: 6px; align-items: center; margin-top: 6px; }
@media (max-width: 760px) { .order-item { grid-template-columns: 1fr 1fr; } .order-item .icon-button { grid-column: span 2; } }


/* DEV-008 图表与生活成本 */
.chart { width: 100%; height: auto; max-height: 240px; display: block; margin: 6px 0 12px; }
.chart-bar { fill: var(--accent); }
.chart-bar.warn { fill: var(--warn, #c47b1a); }
.chart-line { stroke: var(--accent); }
.chart-line.warn { stroke: var(--warn, #c47b1a); }
.chart-seg { opacity: 0.9; }
.chart-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.chart.donut { width: 180px; max-width: 45vw; flex: 0 0 auto; }
.chart-legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch-0 { background: hsl(210 62% 52%); }
.swatch-1 { background: hsl(257 62% 52%); }
.swatch-2 { background: hsl(304 62% 52%); }
.swatch-3 { background: hsl(351 62% 52%); }
.swatch-4 { background: hsl(38 62% 52%); }
.swatch-5 { background: hsl(85 62% 52%); }
.swatch-6 { background: hsl(132 62% 52%); }
.swatch-7 { background: hsl(179 62% 52%); }
.ratio-bar { height: 8px; background: var(--line, #e3e7ee); border-radius: 999px; overflow: hidden; }
.ratio-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ratio-bar.warn > span { background: var(--warn, #c47b1a); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.filter-grid select, .filter-grid input { width: 100%; }
.chart-note { font-size: 12px; color: var(--mute); }
.month-status { font-size: 11px; color: var(--mute); }
.month-status.partial { color: var(--warn, #c47b1a); }
.month-status.no-data { color: var(--mute); opacity: 0.75; }
.travel-days { display: flex; flex-wrap: wrap; gap: 3px; }
.travel-days span { width: 14px; height: 14px; border-radius: 3px; background: var(--line, #e3e7ee); display: inline-block; }
.travel-days span.travel { background: var(--accent); }
.travel-days span.normal { background: var(--ok, #2f8f4e); }
.travel-days span.unassigned { background: var(--warn, #c47b1a); opacity: 0.5; }

/* 报表基准币快速切换 */
.currency-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: .5rem 0 .75rem;
}
.currency-switch.compact { margin: .25rem 0 .5rem; }
.currency-switch-label {
  font-size: .78rem;
  color: var(--mute);
  margin-right: .2rem;
}
.currency-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: .28rem .6rem;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  line-height: 1.2;
}
.currency-chip:hover { border-color: var(--accent); }
.currency-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.currency-chip:focus-visible,
.currency-chip:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 迁移进度条：使用原生 progress，避免 CSP 禁止内联 style。 */
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line progress.progress-fill { flex: 1; height: 10px; accent-color: #163a5f; }
