/* ------------------------------------------------------------------ *
 * 随身秘书 · 样式
 * 移动优先；支持深色模式、刘海屏安全区；单列最大 480px。
 * ------------------------------------------------------------------ */

:root {
  --bg: #f4f5f9;
  --bg-grad: radial-gradient(120% 60% at 50% 0%, #e9ecfb 0%, #f4f5f9 55%);
  --card: #ffffff;
  --ink: #14161f;
  --ink-2: #4a4f60;
  --muted: #8b90a1;
  --line: #ebedf4;
  --input: #f6f7fb;
  --primary: #4f46e5;
  --primary-2: #6d5cf0;
  --primary-soft: rgba(79, 70, 229, 0.10);
  --expense: #e5484d;
  --income: #12a67a;
  --warn: #d93a3f;
  --shadow: 0 1px 2px rgba(20, 22, 31, 0.04), 0 12px 32px -16px rgba(20, 22, 31, 0.18);
  --radius: 18px;
  --tab-h: 74px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f14;
    --bg-grad: radial-gradient(120% 60% at 50% 0%, #171a2a 0%, #0d0f14 55%);
    --card: #171a22;
    --ink: #eef0f6;
    --ink-2: #b7bdcd;
    --muted: #7f8698;
    --line: #252a36;
    --input: #1d212b;
    --primary: #8b82ff;
    --primary-2: #a79dff;
    --primary-soft: rgba(139, 130, 255, 0.14);
    --expense: #ff6b6f;
    --income: #35d3a1;
    --warn: #ff8a8d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
}

/* ---------------- 视图 ---------------- */
.view {
  display: none;
  padding: 18px 16px 8px;
}
.view.is-active {
  display: block;
  animation: viewIn 0.26s cubic-bezier(0.22, 0.7, 0.3, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.vhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.vhead > div { min-width: 0; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
}
.vhead h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.round-btn {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, color 0.15s;
}
.round-btn:active { transform: scale(0.94); }
.round-btn svg { width: 21px; height: 21px; }
.round-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--expense);
  box-shadow: 0 0 0 2px var(--card);
}

.pill {
  align-self: center;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------- 顶部金额卡 ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 20px 20px 16px;
  color: #fff;
  background: linear-gradient(135deg, #5a52e6 0%, #7b4fdc 48%, #3f7bfa 100%);
  box-shadow: 0 18px 40px -22px rgba(79, 70, 229, 0.9);
}
.hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 62%);
  pointer-events: none;
}
.hero-label {
  margin: 0;
  font-size: 12.5px;
  opacity: 0.82;
  letter-spacing: 0.02em;
}
.hero-value {
  margin: 6px 0 14px;
  font-size: 35px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-meta div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hero-meta span { font-size: 11px; opacity: 0.72; }
.hero-meta b {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 快速记账 ---------------- */
.quick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 6px 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.quick svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.quick input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14.5px;
}
.quick input::placeholder { color: var(--muted); }
.quick button[type="submit"] {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}
.quick button[type="submit"]:active { transform: scale(0.96); filter: brightness(0.95); }

.mic {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mic svg { width: 19px; height: 19px; color: currentColor; }
.mic:active { transform: scale(0.94); }
.mic.is-live {
  background: var(--expense);
  border-color: transparent;
  color: #fff;
  animation: micPulse 1.4s ease-out infinite;
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}

.input-row { display: flex; align-items: center; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.quick.shake { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.hint {
  margin: 8px 4px 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.hint.bad { color: var(--warn); }

/* ---------------- 区块 ---------------- */
.sec-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 22px 4px 10px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.sec-title .count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.sec-title.danger-title { color: var(--warn); }

.footnote {
  margin: 18px 4px 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
.footnote a { color: var(--primary); text-decoration: none; }

/* ---------------- 列表 ---------------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 12px 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 1px 2px rgba(20, 22, 31, 0.03);
}
.grow { flex: 1; min-width: 0; }
.row-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub.warn { color: var(--warn); }

.empty {
  padding: 18px 14px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
}

.check {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.check svg { width: 14px; height: 14px; }
.check:active { transform: scale(0.9); }
.row.is-done .check { background: var(--income); border-color: var(--income); color: #fff; }
.row.is-done .row-title { color: var(--muted); text-decoration: line-through; }

.icon-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--input); color: var(--expense); }

.chev { width: 15px; height: 15px; color: var(--muted); opacity: 0.5; flex: 0 0 auto; }

.time-badge {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 7px 8px;
  border-radius: 10px;
  background: var(--input);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.time-badge.big { font-size: 14.5px; min-width: 62px; }

.pill + .pill { margin-left: 6px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.6; margin: 0 0 12px; }

/* ---------------- 记账 ---------------- */
.vhead input.month-pick {
  flex: 0 0 auto;
  width: 138px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  height: 38px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow);
  outline: none;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.tile span { font-size: 11px; color: var(--muted); }
.tile b {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile b.expense { color: var(--expense); }
.tile b.income { color: var(--income); }

.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-dot {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.cat-main { flex: 1; min-width: 0; }
.cat-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.cat-top b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: var(--input); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.cat-pct {
  flex: 0 0 auto;
  width: 34px;
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chart {
  display: flex;
  align-items: stretch;
  gap: 7px;
  height: 108px;
  padding-top: 6px;
}
.chart .col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.chart .bar-v {
  width: 100%;
  max-width: 26px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
  transition: height 0.4s ease;
}
.chart .bar-v.now { background: linear-gradient(180deg, #818cf8, #4f46e5); }
.chart .col-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart .col-label.on { color: var(--primary); font-weight: 650; }

.detail-add { padding: 0; overflow: hidden; }
.detail-add summary {
  list-style: none;
  cursor: pointer;
  padding: 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-add summary::-webkit-details-marker { display: none; }
.detail-add summary::after {
  content: "+";
  font-size: 18px;
  color: var(--muted);
  font-weight: 400;
}
.detail-add[open] summary::after { content: "−"; }
.detail-add form { padding: 0 15px 15px; }

.day-group { margin-bottom: 14px; }
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 7px;
  font-size: 11.5px;
  color: var(--muted);
}
.day-head span:first-child { font-weight: 600; color: var(--ink-2); }
.day-group .row { border-radius: 13px; margin-bottom: 6px; }
.bill .amount {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.bill .amount.income { color: var(--income); }
.bill .icon-btn { opacity: 0.45; }
.bill .icon-btn:hover { opacity: 1; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 500; padding-left: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="datetime-local"],
select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
input:focus, select:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: var(--muted); }

.btn {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--primary);
}
.btn.danger { color: var(--expense); border-color: color-mix(in srgb, var(--expense) 30%, var(--line)); }
.btn.small { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 4px; }
.btn.is-off { opacity: 0.55; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 12px; }
.chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:active { transform: scale(0.95); }
.chip.on {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  color: var(--primary);
  font-weight: 650;
}
.week-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-chips .chip { padding: 0; height: 36px; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 550;
}
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 auto; display: inline-block; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 2; cursor: pointer; }
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch input:checked + .track { background: var(--income); }
.switch input:checked + .track::after { transform: translateX(19px); }

/* ---------------- 提示条 ---------------- */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
  border-radius: 15px;
  border: 1px solid #f6d68a;
  background: linear-gradient(135deg, #fff8e6, #fffdf6);
  color: #7a5b12;
}
.banner b { font-size: 13px; }
.banner p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; opacity: 0.85; }
.banner .btn { flex: 0 0 auto; }
@media (prefers-color-scheme: dark) {
  .banner {
    border-color: #5a4613;
    background: linear-gradient(135deg, #2a2210, #1d1a12);
    color: #f0d48a;
  }
}

.alert.is-off { opacity: 0.55; }
.alert .row-title { white-space: nowrap; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line);
  z-index: 60;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0 3px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s, background 0.16s, transform 0.12s;
}
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: 10.5px; font-weight: 550; letter-spacing: 0.01em; }
.tab:active { transform: scale(0.94); }
.tab.is-on { color: var(--primary); background: var(--primary-soft); }

/* ---------------- 提醒弹层 ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 11, 20, 0.42);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 330px;
  padding: 24px 22px 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(9, 11, 20, 0.55);
  animation: pop 0.28s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.modal-bell {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 10px 24px -10px rgba(239, 68, 68, 0.8);
  animation: ring 1.1s ease 0.15s 2;
}
.modal-bell svg { width: 26px; height: 26px; }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-11deg); }
  40% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(3deg); }
}
.modal-time {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--primary);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.modal h2 {
  margin: 8px 0 6px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.modal-body { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.modal-actions { display: flex; gap: 9px; }
.modal-actions .btn { flex: 1; }

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(22, 25, 36, 0.92);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.24s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.toast.out { animation: toastOut 0.24s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* 桌面端：加一点边界感 */
@media (min-width: 520px) {
  body { padding: 0; }
  .app { box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(20, 22, 31, 0.25); }
  .tabbar { border-radius: 0 0 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 截图 / 录屏用的确定性开关：?nofx=1 由 js 加上 .nofx */
.nofx *, .nofx *::before, .nofx *::after {
  animation: none !important;
  transition: none !important;
}

/* 打印：只留内容 */
@media print {
  .tabbar, .quick, .toasts, .modal-backdrop, .row-actions, .icon-btn { display: none !important; }
  body { background: #fff; }
  .view { display: block !important; }
}
