/* 家庭记账 — 样式
 *
 * 两种外观（设计文档 4.6）：A 存折（默认）、D iPhone 原生。各有浅色 / 深色，跟随系统。
 * 布局和页面结构完全一样，只有这里的"设计变量"不同。页面只引用变量。
 *
 * 用途颜色按色位：--fund-1 … --fund-8（蓝、粉红、绿、紫、橙、青、棕、灰）。
 */

@font-face {
  font-family: 'Barlow Semi Condensed';
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2');
}

/* ---------- A 存折（浅色） ---------- */
:root, [data-appearance="A"] {
  --bg: #EEF2EC;
  --surface: #EEF2EC;
  --surface-2: #E4EAE2;
  --ink: #1F3B36;
  --ink-2: #4A6259;
  --line: #D3DDD5;
  --guilloche: #C9D6CC;
  --warn: #B3261E;
  --accent: #1F3B36;
  --accent-ink: #EEF2EC;
  --link: #1F3B36;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-num: "Barlow Semi Condensed", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --num-weight: 500;
  --radius: 4px;
  --card-radius: 0px;
  --hairline: 1px;
  --nav-bg: #EEF2EC;
  --nav-blur: none;
  --fund-1: #3F6FA8; --fund-2: #B0407A; --fund-3: #3E8A5C; --fund-4: #6B4FA0;
  --fund-5: #C97A2B; --fund-6: #2E8C95; --fund-7: #8A6A3E; --fund-8: #6C7A80;
  color-scheme: light;
}

/* ---------- D iPhone 原生（浅色） ---------- */
[data-appearance="D"] {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --ink: #000000;
  --ink-2: #6C6C70;
  --line: #C6C6C8;
  --guilloche: transparent;
  --warn: #C4281C;
  --accent: #0068D9;
  --accent-ink: #FFFFFF;
  --link: #0068D9;
  --font-num: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  --num-weight: 400;
  --radius: 10px;
  --card-radius: 10px;
  --hairline: 0.5px;
  --nav-bg: rgba(249, 249, 249, 0.86);
  --nav-blur: saturate(180%) blur(20px);
  --fund-1: #007AFF; --fund-2: #FF2D55; --fund-3: #34C759; --fund-4: #AF52DE;
  --fund-5: #FF9500; --fund-6: #30B0C7; --fund-7: #A2845E; --fund-8: #8E8E93;
}

@media (prefers-color-scheme: dark) {
  :root, [data-appearance="A"] {
    --bg: #142420;
    --surface: #142420;
    --surface-2: #1A2D28;
    --ink: #E3EBE5;
    --ink-2: #A8BAB1;
    --line: #2A3E39;
    --guilloche: #20362F;
    --warn: #F08A80;
    --accent: #E3EBE5;
    --accent-ink: #142420;
    --link: #E3EBE5;
    --nav-bg: #142420;
    --fund-1: #79A2D6; --fund-2: #D877A8; --fund-3: #74B98E; --fund-4: #A28BD0;
    --fund-5: #E3A262; --fund-6: #5FB3BB; --fund-7: #B8976A; --fund-8: #9AA7AC;
    color-scheme: dark;
  }
  [data-appearance="D"] {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --ink: #FFFFFF;
    --ink-2: #98989F;
    --line: #38383A;
    --guilloche: transparent;
    --warn: #FF6961;
    --accent: #409CFF;
    --accent-ink: #000000;
    --link: #409CFF;
    --nav-bg: rgba(22, 22, 24, 0.86);
    --fund-1: #0A84FF; --fund-2: #FF375F; --fund-3: #30D158; --fund-4: #BF5AF2;
    --fund-5: #FF9F0A; --fund-6: #40C8E0; --fund-7: #AC8E68; --fund-8: #98989D;
  }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-appearance="D"] :focus-visible { outline-color: var(--accent); }

.num {
  font-family: var(--font-num);
  font-weight: var(--num-weight);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.warn { color: var(--warn); }
.right { text-align: right; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom));
}
#app.no-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- 页头 ---------- */
.topbar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 8px 4px 16px; min-height: 52px;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; }
.topbar.large h1 { font-size: 28px; font-weight: 700; }
[data-appearance="A"] .topbar.large h1 { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--ink);
  border-radius: 22px; cursor: pointer; padding: 0;
}
.icon-btn.back { margin-left: -12px; color: var(--link); }
.readonly-tag { font-size: 12px; color: var(--ink-2); border: var(--hairline) solid var(--line); border-radius: 10px; padding: 2px 8px; }

/* ---------- 分组：A 用分隔线，D 用卡片 ---------- */
.section { margin: 0 0 8px; }
.section-title {
  font-size: 13px; color: var(--ink-2); margin: 16px 16px 6px; font-weight: 500;
  text-transform: none; letter-spacing: 0.02em;
}
.group { background: var(--surface); border-top: var(--hairline) solid var(--line); border-bottom: var(--hairline) solid var(--line); }
[data-appearance="D"] .group { margin: 0 16px; border: 0; border-radius: var(--card-radius); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 48px;
  border-bottom: var(--hairline) solid var(--line);
  background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
  color: inherit; text-decoration: none;
}
.group > .row:last-child, .group > :last-child > .row:last-child { border-bottom: 0; }
[data-appearance="D"] .row { border-bottom: 0; position: relative; }
[data-appearance="D"] .group > .row:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: var(--hairline); background: var(--line);
}
.row .grow { flex: 1; min-width: 0; }
.row .label { flex: 1; min-width: 0; }
.row .sub { font-size: 13px; color: var(--ink-2); }
button.row, a.row { cursor: pointer; }
.row .chev { color: var(--ink-2); display: inline-flex; }

/* ---------- 首页总资产 ---------- */
.hero { padding: 6px 16px 18px; position: relative; }
[data-appearance="A"] .hero {
  /* 存折的防伪细纹：只在这里 */
  background-image:
    repeating-linear-gradient(135deg, transparent 0 6px, var(--guilloche) 6px 7px),
    repeating-linear-gradient(45deg, transparent 0 10px, var(--guilloche) 10px 11px);
  background-size: 100% 100%;
  border-bottom: 1px solid var(--line);
}
[data-appearance="D"] .hero { padding-top: 0; }
.hero .label { font-size: 14px; color: var(--ink-2); }
.hero .total { font-size: 40px; line-height: 1.1; margin: 4px 0 2px; letter-spacing: -0.01em; }
[data-appearance="A"] .hero .total { font-weight: 600; font-size: 44px; }
.hero .total .cur { font-size: 15px; color: var(--ink-2); margin-left: 6px; font-family: var(--font-ui); font-weight: 400; }
.hero .note { font-size: 13px; color: var(--ink-2); }

/* ---------- 提示条 ---------- */
.alerts { margin: 12px 0 4px; }
[data-appearance="D"] .alerts { margin: 12px 16px 4px; display: grid; gap: 8px; }
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
[data-appearance="D"] .alert { background: var(--surface); border-radius: var(--card-radius); border: 0; }
.alert .grow { flex: 1; }
.alert.warn .mark { color: var(--warn); }
.alert .mark { display: inline-flex; padding-top: 1px; }
.alert .act { border: 0; background: none; color: var(--link); font-weight: 600; padding: 0 0 0 8px; min-height: 32px; cursor: pointer; white-space: nowrap; }
.pending-list { margin-top: 6px; display: grid; gap: 4px; }
.pending-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; text-align: left; cursor: pointer; min-height: 44px; align-items: center; }

/* ---------- 分段切换 ---------- */
.segmented {
  display: flex; margin: 12px 16px; padding: 2px; border-radius: 9px;
  background: var(--surface-2); border: var(--hairline) solid var(--line);
}
.segmented button {
  flex: 1; border: 0; background: none; min-height: 36px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 14px;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
[data-appearance="A"] .segmented { border-radius: 2px; background: none; }
[data-appearance="A"] .segmented button { border-radius: 2px; }
[data-appearance="A"] .segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* ---------- 账户 / 用途卡 ---------- */
.ledger { }
.ledger-item { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); padding: 14px 16px; color: inherit; cursor: pointer; border-bottom: 1px solid var(--line); }
[data-appearance="D"] .ledger { display: grid; gap: 10px; margin: 0 16px; }
[data-appearance="D"] .ledger-item { border-radius: var(--card-radius); border: 0; }
.ledger-head { display: flex; align-items: baseline; gap: 8px; }
.ledger-head .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-head .amount { font-size: 20px; }
.ledger-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
[data-appearance="A"] .dot { border-radius: 2px; }

.bar { display: flex; height: 12px; margin: 10px 0 8px; border-radius: 2px; overflow: hidden; background: var(--surface-2); gap: 2px; }
[data-appearance="D"] .bar { border-radius: 6px; height: 10px; }
.bar.empty { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); }
.seg { height: 100%; min-width: 3px; transition: width 380ms cubic-bezier(.2,.7,.2,1); }
.seg.other { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 2px, transparent 2px 6px) !important; }
@media (prefers-color-scheme: dark) { .seg.other { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.45) 0 2px, transparent 2px 6px) !important; } }
@media (prefers-reduced-motion: reduce) { .seg { transition: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .overdraft { color: var(--warn); }

.f1 { --c: var(--fund-1); } .f2 { --c: var(--fund-2); } .f3 { --c: var(--fund-3); } .f4 { --c: var(--fund-4); }
.f5 { --c: var(--fund-5); } .f6 { --c: var(--fund-6); } .f7 { --c: var(--fund-7); } .f8 { --c: var(--fund-8); }
.dot, .seg { background-color: var(--c); }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--nav-bg); -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur);
  border-top: var(--hairline) solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: 60px; }
.nav a, .nav button.navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 56px; font-size: 11px; color: var(--ink-2); text-decoration: none; border: 0; background: none; cursor: pointer;
}
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
[data-appearance="A"] .nav a[aria-current="page"] { color: var(--ink); }
.nav .add {
  justify-self: center; width: 58px; height: 58px; border-radius: 50%; margin-bottom: 12px;
  background: var(--accent); color: var(--accent-ink); border: 0; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); cursor: pointer;
}
[data-appearance="A"] .nav .add { box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line); }

/* ---------- 底部弹出的面板 ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto;
}
[data-appearance="A"] .sheet { border-radius: 6px 6px 0 0; border-top: 2px solid var(--ink); }
[data-appearance="D"] .sheet { background: var(--bg); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.sheet h2 { font-size: 17px; margin: 4px 16px 10px; }
.action-list { display: grid; }
[data-appearance="D"] .action-list { margin: 0 16px; background: var(--surface); border-radius: var(--card-radius); overflow: hidden; }
.action-list button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; text-align: left;
  padding: 12px 16px; border-bottom: var(--hairline) solid var(--line); cursor: pointer; min-height: 56px;
}
.action-list button:last-child { border-bottom: 0; }
.action-list b { font-size: 16px; font-weight: 600; }
.action-list span { font-size: 13px; color: var(--ink-2); }

/* ---------- 表单 ---------- */
.form { padding: 0 0 16px; }
.field { padding: 10px 16px; border-bottom: var(--hairline) solid var(--line); display: grid; gap: 4px; }
[data-appearance="D"] .field { border-bottom: 0; position: relative; }
[data-appearance="D"] .group > .field:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: var(--hairline); background: var(--line); }
.field > label, .field > .flabel { font-size: 13px; color: var(--ink-2); }
.field-inline { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 48px; border-bottom: var(--hairline) solid var(--line); }
[data-appearance="D"] .field-inline { border-bottom: 0; position: relative; }
[data-appearance="D"] .group > .field-inline:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: var(--hairline); background: var(--line); }
.field-inline > label { flex: 1; }
input[type="text"], input[type="date"], input[inputmode], select, textarea {
  width: 100%; min-height: 44px; border: var(--hairline) solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 8px 10px; font-size: 16px; color: var(--ink);
}
[data-appearance="D"] input[type="text"], [data-appearance="D"] input[type="date"], [data-appearance="D"] input[inputmode], [data-appearance="D"] select { background: var(--surface-2); border-color: transparent; }
.field-inline select, .field-inline input { width: auto; max-width: 60%; }
input.big { font-size: 32px; min-height: 56px; font-family: var(--font-num); font-weight: var(--num-weight); font-variant-numeric: tabular-nums; }
input.amount { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
input[aria-invalid="true"] { border-color: var(--warn); }
.amount-row { display: flex; align-items: center; gap: 8px; }
.amount-row .cur { color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-2); padding: 8px 16px; margin: 0; }
.error-box { margin: 12px 16px 0; padding: 10px 12px; border-left: 3px solid var(--warn); color: var(--warn); font-size: 14px; background: var(--surface); }
[data-appearance="D"] .error-box { border-radius: var(--card-radius); border-left: 0; }
.ok-box { margin: 12px 16px 0; padding: 10px 12px; font-size: 14px; color: var(--ink-2); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: calc(100% - 32px); margin: 16px 16px 0; min-height: 50px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); border: 0; font-size: 17px; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn.secondary { background: none; color: var(--link); border: var(--hairline) solid var(--line); }
.btn.danger { background: none; color: var(--warn); border: var(--hairline) solid var(--line); }
.btn-row { display: flex; gap: 8px; margin: 16px 16px 0; }
.btn-row .btn { margin: 0; width: auto; flex: 1; }
.link-btn { border: 0; background: none; color: var(--link); padding: 8px 0; min-height: 44px; cursor: pointer; font-size: 15px; }

/* 分配结果 / 拆分行 */
.alloc-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px 10px; padding: 8px 16px; min-height: 48px; border-bottom: var(--hairline) solid var(--line); }
[data-appearance="D"] .alloc-row { border-bottom: 0; }
.alloc-row .desc { font-size: 13px; color: var(--ink-2); }
.alloc-row .amt { text-align: right; }
.alloc-row input.amount { width: 120px; min-height: 40px; }
.alloc-row .manual { font-size: 12px; color: var(--ink-2); grid-column: 2 / -1; margin-top: -4px; }
.total-row { display: flex; justify-content: space-between; padding: 10px 16px; font-weight: 600; }
.total-row.bad { color: var(--warn); }
.line-row { display: grid; grid-template-columns: 1fr 130px 44px; gap: 8px; padding: 6px 16px; align-items: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background-color: var(--c); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
[data-appearance="A"] .swatches button { border-radius: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
.chips button { border: var(--hairline) solid var(--line); background: var(--surface); border-radius: 18px; padding: 6px 14px; min-height: 40px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* 表格（账户详情、报表） */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { font-weight: 500; color: var(--ink-2); font-size: 12px; text-align: right; padding: 6px 16px 4px 0; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 16px; }
.table td { padding: 8px 16px 8px 0; text-align: right; border-top: var(--hairline) solid var(--line); }

/* 流水列表 */
.entry { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: var(--hairline) solid var(--line); width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; background: none; cursor: pointer; color: inherit; }
[data-appearance="D"] .entry { border-bottom: 0; position: relative; }
[data-appearance="D"] .group > .entry:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: var(--hairline); background: var(--line); }
.entry .grow { flex: 1; min-width: 0; }
.entry .t { font-weight: 500; }
.entry .d { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-head { font-size: 13px; color: var(--ink-2); padding: 14px 16px 4px; }

.month-switch { display: flex; align-items: center; justify-content: space-between; margin: 8px 8px; }
.month-switch b { font-size: 17px; }

.kv { display: flex; justify-content: space-between; padding: 10px 16px; border-bottom: var(--hairline) solid var(--line); }
[data-appearance="D"] .kv { border-bottom: 0; position: relative; }
[data-appearance="D"] .group > .kv:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: var(--hairline); background: var(--line); }
.kv.total { font-weight: 600; }

/* 开关 */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
[data-appearance="D"] .switch input:checked + span { background: #34C759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 提示消息 */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: calc(100% - 32px);
}
[data-appearance="A"] .toast { border-radius: 3px; }

.empty-state { padding: 32px 24px; text-align: center; color: var(--ink-2); }
.empty-state .btn { width: auto; display: inline-flex; padding: 0 20px; margin-top: 16px; }

.welcome { padding: 48px 24px 24px; }
.welcome h1 { font-size: 28px; margin: 0 0 8px; }
.welcome p { color: var(--ink-2); }
.steps { font-size: 13px; color: var(--ink-2); margin: 4px 16px 0; }
.demo-banner { background: var(--warn); color: #fff; text-align: center; font-size: 12px; padding: 4px 8px; }

/* 安装提示、更新提示、无法保存警告 */
.notice { margin: 12px 16px 0; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
[data-appearance="D"] .notice { border: 0; border-radius: var(--card-radius); }
.notice b { display: block; margin-bottom: 4px; }
.notice p { margin: 4px 0 0; color: var(--ink-2); }
.notice.warn { border-color: var(--warn); color: var(--warn); }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top)); z-index: 45;
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; background: var(--ink); color: var(--bg); border-radius: 22px;
  font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
[data-appearance="A"] .update-bar { border-radius: 3px; }
.update-bar button { border: 0; background: var(--bg); color: var(--ink); font-weight: 600; min-height: 36px; padding: 0 14px; border-radius: 18px; cursor: pointer; }
