:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #878fa3;
  --line: #e8ecf3;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --brand-2: #0ea5a4;
  --in: #0f9d6e;
  --in-soft: #e7f7f0;
  --out: #e5484d;
  --out-soft: #fdeeef;
  --warn: #b54708;
  --warn-soft: #fff4e5;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 22px rgba(16, 24, 40, .055);
  --shadow-lg: 0 14px 40px rgba(16, 24, 40, .13);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: #e9edf5;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, textarea, select { outline: none; }
h1, h2, h3, p, ul { margin: 0; }
[hidden] { display: none !important; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 60px rgba(16, 24, 40, .08);
  padding-bottom: calc(78px + var(--safe-bottom));
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  background: rgba(244, 246, 251, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 236, 243, .8);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7c6cf5 55%, var(--brand-2));
  color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.engine-chip {
  font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #dfe2ff;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.engine-chip.ai { color: #0b7f70; background: #e4f7f3; border-color: #c8eee6; }

/* ---------- layout ---------- */
.main { padding: 0 16px 24px; }
.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { padding: 20px 2px 16px; }
.page-head h1 { font-size: 25px; font-weight: 750; letter-spacing: -.4px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-brand { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.dot-green { background: var(--in); box-shadow: 0 0 0 4px var(--in-soft); }
.dot-gray { background: var(--muted); box-shadow: 0 0 0 4px #f0f2f6; }
.card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 14px; }
.card-desc b { color: var(--ink-2); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 24px 20px 22px;
  margin: 16px 0 14px;
  color: #fff;
  background: linear-gradient(120deg, #3f3ac6 0%, #5b52ea 46%, #159d9b 100%);
  box-shadow: 0 12px 28px rgba(79, 70, 229, .22);
}
.hero-glow {
  position: absolute; width: 220px; height: 220px; right: -70px; top: -110px;
  background: radial-gradient(circle, rgba(255,255,255,.25), transparent 68%);
  border-radius: 50%;
}
.hero::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -40px; bottom: -95px;
  border: 24px solid rgba(255,255,255,.09); border-radius: 50%;
}
.hero h1 { font-size: 25px; font-weight: 760; line-height: 1.35; letter-spacing: -.5px; position: relative; }
.hero p { font-size: 12.5px; opacity: .86; margin-top: 10px; line-height: 1.7; position: relative; }

/* ---------- stat strip ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 10px 12px; box-shadow: var(--shadow); min-width: 0;
}
.stat-label { display: block; font-size: 11px; color: var(--muted); }
.stat strong { display: inline-block; font-size: 18px; font-weight: 750; margin-top: 3px; letter-spacing: -.4px; }
.stat-unit { font-size: 11px; color: var(--muted); margin-left: 2px; }
.t-in { color: var(--in); }
.t-out { color: var(--out); }

/* ---------- form ---------- */
textarea#rawInput {
  width: 100%; min-height: 148px; resize: vertical;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 12px 13px;
  font-size: 13px; line-height: 1.75; color: var(--ink-2);
  transition: border-color .18s, box-shadow .18s;
}
textarea#rawInput:focus { border-color: #b8b2fa; box-shadow: 0 0 0 3px rgba(79,70,229,.09); background: #fff; }
textarea#rawInput::placeholder { color: #a9b0c0; }
.inp {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; min-width: 0;
  transition: border-color .18s, box-shadow .18s;
}
.inp:focus { border-color: #b8b2fa; box-shadow: 0 0 0 3px rgba(79,70,229,.09); background: #fff; }
.inp::placeholder { color: #a9b0c0; }

.sample-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; }
.sample-label { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.sample-chip {
  font-size: 11.5px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  transition: .15s;
}
.sample-chip:hover { background: var(--brand-soft); border-color: #d5d1ff; color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px; padding: 10px 16px; font-weight: 650; font-size: 14px;
  transition: transform .12s, box-shadow .18s, opacity .18s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(120deg, #5449ea, #6255f0); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.26); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(79,70,229,.34); }
.btn-primary:disabled { opacity: .55; box-shadow: none; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #eef1f7; }
.btn-danger { background: var(--out); color: #fff; }
.btn-danger-ghost { background: var(--out-soft); color: var(--out); border: 1px solid #f8d5d7; }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }
.btn-icon { font-size: 15px; }
.btn-row { display: flex; gap: 8px; }
.btn-row.wrap { flex-wrap: wrap; }
.link-btn { font-size: 12px; color: var(--brand); font-weight: 600; padding: 2px 0; }
.hint { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }

/* ---------- parse report ---------- */
.parse-report {
  border-radius: 14px; padding: 12px 14px; margin-bottom: 18px;
  background: var(--in-soft); border: 1px solid #cfeee0;
  font-size: 12.5px; color: #0a7353; line-height: 1.7;
}
.parse-report.warn { background: var(--warn-soft); border-color: #f6dfb8; color: var(--warn); }
.parse-report b { font-weight: 750; }
.parse-report .report-title { font-weight: 750; margin-bottom: 2px; }

/* ---------- sections ---------- */
.section { margin-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px 11px; }
.section-head h2 { font-size: 16px; font-weight: 720; }
.section-sub { font-size: 11.5px; color: var(--muted); }
.count-badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px;
  vertical-align: 2px;
}

/* ---------- bulk bar ---------- */
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.check-wrap { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check-wrap input { width: 15px; height: 15px; accent-color: var(--brand); }
.bulk-actions { display: flex; gap: 7px; }

/* ---------- draft card ---------- */
.draft-list { display: flex; flex-direction: column; gap: 12px; }
.draft-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); position: relative;
  transition: border-color .18s, box-shadow .18s;
}
.draft-card.selected { border-color: #b8b2fa; box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.draft-card.low { border-left: 3px solid var(--warn); }
.draft-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.draft-check { margin-right: 2px; }
.draft-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.dir-badge { font-size: 11px; font-weight: 700; border-radius: 7px; padding: 3px 8px; }
.dir-badge.in { color: var(--in); background: var(--in-soft); }
.dir-badge.out { color: var(--out); background: var(--out-soft); }
.pill {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px;
  background: var(--cat-soft, #eef1f7); color: var(--cat-ink, #475467);
  border: 1px solid var(--cat-line, #e3e8f0);
}
.pill.outline { background: transparent; border-style: dashed; color: var(--muted); }
.conf { margin-left: auto; font-size: 11px; font-weight: 650; }
.conf.high { color: var(--in); }
.conf.low { color: var(--warn); }
.draft-amount { font-size: 27px; font-weight: 760; letter-spacing: -.8px; margin: 9px 0 12px; }
.draft-amount.in { color: var(--in); }
.draft-amount.out { color: var(--out); }
.draft-amount span { font-size: 14px; font-weight: 600; margin-right: 3px; }

.draft-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.draft-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.draft-fields label > span { font-size: 10.5px; color: var(--muted); padding-left: 2px; }
.draft-fields .inp { padding: 7px 9px; font-size: 12.5px; border-radius: 9px; }
.draft-fields .full { grid-column: 1 / -1; }

.evidence { margin-top: 11px; border-top: 1px dashed var(--line); padding-top: 9px; }
.evidence summary { font-size: 11.5px; color: var(--muted); cursor: pointer; list-style: none; }
.evidence summary::-webkit-details-marker { display: none; }
.evidence summary::before { content: "▸ "; }
.evidence[open] summary::before { content: "▾ "; }
.evidence blockquote {
  margin: 8px 0 0; padding: 8px 10px; background: var(--surface-2);
  border-left: 2px solid #cfd5e4; border-radius: 0 8px 8px 0;
  font-size: 11.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-all;
  max-height: 130px; overflow: auto;
}
.draft-actions { display: flex; gap: 8px; margin-top: 12px; }
.draft-actions .btn { flex: 1; }

/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-ico { font-size: 30px; display: block; margin-bottom: 10px; opacity: .55; }
.empty strong { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 12px; line-height: 1.7; }

/* ---------- ledger ---------- */
.sum-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.sum-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 13px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.sum-card span { font-size: 11.5px; color: var(--muted); }
.sum-card strong { font-size: 20px; font-weight: 750; letter-spacing: -.5px; }
.sum-card small { font-size: 11px; color: var(--muted); }
.sum-card.wide {
  grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px;
  background: linear-gradient(110deg, #fff, #f7f6ff);
}
.sum-card.wide strong { font-size: 22px; }

.filter-card { padding: 13px; }
.filter-row { display: flex; gap: 8px; margin-top: 9px; }
.filter-row .inp { flex: 1; }
.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; flex-shrink: 0; }
.seg { font-size: 11.5px; color: var(--muted); padding: 6px 9px; border-radius: 8px; }
.seg.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(16,24,40,.09); }
.export-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.export-row .sep { color: #cdd3df; }

.ledger-group-title {
  font-size: 11.5px; color: var(--muted); font-weight: 650;
  padding: 14px 3px 7px; display: flex; justify-content: space-between;
}
.ledger-list { display: flex; flex-direction: column; }
.ledger-item {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 13px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.ledger-amt { min-width: 96px; font-size: 16px; font-weight: 750; letter-spacing: -.4px; }
.ledger-amt.in { color: var(--in); }
.ledger-amt.out { color: var(--out); }
.ledger-body { flex: 1; min-width: 0; }
.ledger-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.ledger-meta .pill { font-size: 10px; padding: 2px 8px; }
.ledger-src { font-size: 10.5px; color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-del { font-size: 11px; color: #b9c0ce; padding: 2px 4px; align-self: flex-start; }
.ledger-del:hover { color: var(--out); }

/* ---------- projects ---------- */
.add-project { display: flex; gap: 8px; align-items: center; padding: 12px; }
.add-project .inp { flex: 1; }
.project-list { display: flex; flex-direction: column; gap: 11px; }
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow);
}
.project-head { display: flex; align-items: center; justify-content: space-between; }
.project-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.project-badge { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.project-count { font-size: 11.5px; color: var(--muted); }
.project-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.project-nums > div { display: flex; flex-direction: column; gap: 1px; }
.project-nums span { font-size: 10.5px; color: var(--muted); }
.project-nums strong { font-size: 14px; font-weight: 720; }
.project-bar { height: 5px; border-radius: 99px; background: var(--in-soft); margin-top: 13px; overflow: hidden; }
.project-bar i { display: block; height: 100%; background: var(--in); border-radius: 99px; }
.project-foot { font-size: 11px; color: var(--muted); margin-top: 8px; }
.project-remove { font-size: 11px; color: #b9c0ce; }
.project-remove:hover { color: var(--out); }

/* ---------- settings ---------- */
.settings-card .field { display: block; margin-bottom: 11px; }
.settings-card .field > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.settings-card .btn-row { margin-top: 4px; }
.conn-status { font-size: 11.5px; color: var(--muted); margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.6; }
.conn-status.ok { color: var(--in); }
.conn-status.err { color: var(--out); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #d8dde8; border-radius: 99px; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.about-card ul { padding-left: 17px; margin: 11px 0 0; }
.about-card li { font-size: 12px; color: var(--ink-2); line-height: 1.8; margin-bottom: 5px; }
.about-card li b { color: var(--ink); }
.about-foot { font-size: 11px; color: var(--muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 7px 4px calc(7px + var(--safe-bottom));
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); position: relative; padding: 3px 0; }
.tab.active { color: var(--brand); font-weight: 700; }
.tab-ico { font-size: 19px; line-height: 1.2; }
.tab-badge {
  position: absolute; top: -2px; right: calc(50% - 22px);
  background: var(--brand); color: #fff; font-size: 9px; font-style: normal;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 99px; text-align: center; padding: 0 4px;
}

/* ---------- toast / modal ---------- */
.toast {
  position: fixed; bottom: calc(84px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 60; max-width: calc(480px - 32px); width: max-content;
  background: #1d2433; color: #fff; border-radius: 12px;
  padding: 11px 14px; font-size: 12.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 14px;
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast button { color: #9c8cff; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(16,24,40,.42);
  display: grid; place-items: center; padding: 24px;
}
.modal { width: 100%; max-width: 340px; background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 16px; font-weight: 720; }
.modal p { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- category colors (design tokens) ---------- */
[data-cat="餐饮"]   { --cat-soft:#fff1e8; --cat-ink:#b54708; --cat-line:#ffdfc7; }
[data-cat="交通"]   { --cat-soft:#eaf2ff; --cat-ink:#175cd3; --cat-line:#d1e2ff; }
[data-cat="物料"]   { --cat-soft:#f3ecff; --cat-ink:#6941c6; --cat-line:#e4d7ff; }
[data-cat="外包"]   { --cat-soft:#e9f7f2; --cat-ink:#067647; --cat-line:#cceee0; }
[data-cat="人工"]   { --cat-soft:#fff0f3; --cat-ink:#c01048; --cat-line:#ffd6e0; }
[data-cat="住宿"]   { --cat-soft:#e8f6fb; --cat-ink:#0b7285; --cat-line:#c9eaf5; }
[data-cat="办公"]   { --cat-soft:#f1f3f8; --cat-ink:#475467; --cat-line:#e1e6ef; }
[data-cat="项目收入"] { --cat-soft:#e7f7f0; --cat-ink:#0f9d6e; --cat-line:#cceee0; }
[data-cat="其他"]   { --cat-soft:#f4f5f8; --cat-ink:#667085; --cat-line:#e8ecf3; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --surface: #1c2029; --surface-2: #232834;
    --ink: #eef1f7; --ink-2: #c9d0dd; --muted: #8b94a7; --line: #2c3340;
    --brand-soft: #272650; --in-soft: #17372e; --out-soft: #3a2226; --warn-soft: #3a2c1a;
    --shadow: 0 6px 22px rgba(0,0,0,.22);
  }
  body { background: #0b0e13; }
  .seg.active { background: #2f3645; }
  .sum-card.wide { background: linear-gradient(110deg, #1c2029, #232244); }
  .engine-chip { border-color: #33315c; }
  .sample-chip, .btn-ghost { color: var(--ink-2); }
  .evidence blockquote { border-left-color: #3a4354; }
}

/* ---------- 进销存 ---------- */
.erp-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.erp-sum > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.erp-sum span { font-size: 10.5px; color: var(--muted); }
.erp-sum strong { font-size: 15px; font-weight: 750; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-tabs {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 13px; box-shadow: var(--shadow);
}
.erp-tab {
  flex: 1; font-size: 12px; color: var(--muted); padding: 8px 2px; border-radius: 9px; font-weight: 600;
}
.erp-tab.active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(79,70,229,.22); }
.erp-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow); margin-bottom: 13px;
}
.erp-card h3 { font-size: 14px; font-weight: 720; margin-bottom: 4px; }
.erp-card .sub { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.erp-line { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; }
.erp-line .inp { flex: 1; padding: 8px 9px; font-size: 12.5px; }
.erp-line .inp.sku { flex: 0 0 74px; }
.erp-line .inp.qty { flex: 0 0 62px; }
.erp-line .inp.price { flex: 1; }
.erp-line .del { font-size: 15px; color: #b9c0ce; padding: 0 3px; flex: 0 0 auto; }
.erp-line .del:hover { color: var(--out); }
.erp-add { font-size: 12px; color: var(--brand); font-weight: 650; padding: 5px 0; }
.erp-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.erp-item-main { flex: 1; min-width: 0; }
.erp-item-title { font-size: 13px; font-weight: 680; }
.erp-item-meta { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.erp-item-amt { font-size: 14px; font-weight: 750; white-space: nowrap; }
.erp-state {
  font-size: 10px; font-weight: 700; border-radius: 6px; padding: 2px 7px; margin-left: 5px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.erp-state.approved { background: var(--in-soft); color: var(--in); border-color: #cceee0; }
.erp-state.draft { background: var(--warn-soft); color: var(--warn); border-color: #f6dfb8; }
.erp-approve { margin-top: 7px; }
.erp-foot { font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0 14px; line-height: 1.6; }

@media (max-width: 360px) {
  .draft-fields { gap: 7px; }
  .stat strong { font-size: 16px; }
  .hero h1 { font-size: 22px; }
  .erp-tab { font-size: 11px; }
  .erp-sum strong { font-size: 13px; }
}

/* ===== CashLens 独立版：极简记账 + AI 助手 ===== */
.dir-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px; font-weight: 750; font-size: 13px;
  border: 1px solid transparent; transition: all .18s ease;
}
.dir-toggle.out { background: var(--out-soft); color: var(--out); border-color: #f7cdd0; }
.dir-toggle.in  { background: var(--in-soft);  color: var(--in);  border-color: #c7ecdd; }
.dir-arrow { font-size: 15px; line-height: 1; }

.amount-display {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  padding: 18px 0 10px; font-size: 42px; font-weight: 800; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.amount-display .cur { font-size: 20px; font-weight: 650; color: var(--muted); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.keypad button {
  height: 52px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 20px; font-weight: 650;
  transition: transform .08s ease, background .15s ease;
}
.keypad button:active { transform: scale(.96); background: var(--brand-soft); }
.keypad button.key-fn { font-size: 15px; color: var(--ink-2); }
.keypad-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 11px; color: var(--muted);
}
.quick-note {
  width: 100%; margin-top: 10px; padding: 11px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 14px; line-height: 1.5;
}
.quick-note:focus { border-color: var(--brand); background: #fff; }

.dot-purple { background: #8b5cf6; }
.ai-card { margin-top: 14px; }
.ai-model { font-size: 11px; color: var(--muted); }
.ai-quick { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.ai-quick button {
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: #f3f0ff; color: #6d4ae0; border: 1px solid #e2dcff;
}
.ai-chat {
  max-height: 320px; overflow-y: auto; padding: 10px; margin: 10px 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.ai-msg {
  padding: 9px 11px; border-radius: 12px; font-size: 13px; line-height: 1.6;
  margin-bottom: 8px; word-break: break-word;
}
.ai-msg.bot { background: #fff; border: 1px solid var(--line); }
.ai-msg.me { background: var(--brand); color: #fff; margin-left: 32px; }
.ai-input {
  width: 100%; padding: 11px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 14px; line-height: 1.5;
}
.ai-input:focus { border-color: var(--brand); background: #fff; }
.ai-actions { display: flex; gap: 8px; margin-top: 9px; justify-content: flex-end; }
.ai-file { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
.ai-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.batch-card { margin-top: 14px; }
.batch-card > summary { cursor: pointer; padding: 13px 16px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.batch-card > .card-head, .batch-card > .sample-row, .batch-card > .btn { margin-left: 16px; margin-right: 16px; margin-bottom: 12px; }
.batch-card > textarea { width: calc(100% - 32px); margin: 0 16px 12px; }
.batch-card > .btn { width: calc(100% - 32px); }
