/* ============ 智账 · 设计系统 ============ */
:root {
  --bg: #f3f4f7;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --muted: #98a2b3;
  --line: #eef0f4;
  --brand: #0fa37f;
  --brand-deep: #0a7a5f;
  --brand-soft: #e7f7f1;
  --warn: #f59e0b;
  --danger: #ef5b52;
  --income: #0fa37f;
  --shadow-s: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.04);
  --shadow-m: 0 12px 32px rgba(16, 24, 40, 0.1);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #e9ebf0;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { border: 0; outline: none; background: transparent; }
input::placeholder, textarea::placeholder { color: #b6becb; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- 手机外壳 ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 640px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(900px 600px at 20% 0%, #dff3ea 0%, rgba(223, 243, 234, 0) 60%),
      radial-gradient(700px 500px at 100% 100%, #e3ecf8 0%, rgba(227, 236, 248, 0) 60%),
      #e9ebf0;
    padding: 20px;
  }
  .app {
    height: min(900px, calc(100dvh - 40px));
    border-radius: 30px;
    box-shadow: 0 30px 70px rgba(16, 24, 40, 0.18), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  }
}

/* ---------- 登录 ---------- */
.auth {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 26px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #f6faf8 0%, #edf1f3 100%);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5;
}
.auth::before {
  content: "";
  position: absolute;
  right: -120px; top: -160px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(15, 163, 127, 0.16), rgba(15, 163, 127, 0) 68%);
  pointer-events: none;
}
.auth-top { position: relative; padding-top: calc(52px + env(safe-area-inset-top)); }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
.brand-mark {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #17b98f, #087a5e);
  color: #fff;
  display: grid; place-items: center;
  font-size: 24px;
  box-shadow: 0 10px 24px rgba(10, 122, 95, 0.28);
}
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.auth h1 { font-size: 30px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.5px; }
.auth .lead { color: var(--ink-2); font-size: 14px; margin: 0 0 28px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px;
  background: #fff; border-radius: var(--r-md);
  box-shadow: var(--shadow-s);
  border: 1px solid transparent;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 163, 127, 0.1); }
.field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.field input { flex: 1; font-size: 15px; }
.btn {
  height: 52px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600;
  transition: transform 0.12s, opacity 0.18s, background 0.18s;
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: linear-gradient(135deg, #12ad86, #078264);
  color: #fff;
  box-shadow: 0 10px 22px rgba(10, 122, 95, 0.26);
}
.btn-primary[disabled] { opacity: 0.55; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: var(--shadow-s); }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-danger { background: #fdecea; color: var(--danger); }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-switch b { color: var(--brand-deep); font-weight: 600; }
.auth-features { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 26px; }
.auth-features span {
  font-size: 11.5px; color: var(--brand-deep);
  background: rgba(15, 163, 127, 0.09);
  border-radius: 99px; padding: 5px 11px;
}
.auth-demo {
  position: relative;
  margin-top: auto; padding-top: 26px;
  text-align: center; font-size: 12px; color: var(--muted);
}
.auth-demo .demo-btn {
  margin-top: 10px;
  color: var(--brand-deep); font-weight: 600; font-size: 12.5px;
  padding: 8px 16px; border-radius: 10px; background: #fff;
  box-shadow: var(--shadow-s);
}

/* ---------- 主体 ---------- */
.main { position: absolute; inset: 0; display: flex; flex-direction: column; }
.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 112px;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view.no-pad { padding: 0 0 112px; }

/* 顶部渐变头 */
.hero {
  margin: 0 -16px 0;
  padding: calc(14px + env(safe-area-inset-top)) 20px 58px;
  background:
    radial-gradient(320px 220px at 92% -20%, rgba(52, 211, 153, 0.35), transparent 70%),
    linear-gradient(135deg, #0a2a25 0%, #0e463a 58%, #0f5b49 100%);
  color: #fff;
  border-radius: 0 0 26px 26px;
  position: relative;
}
.hero-compact { padding-bottom: 26px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-title { font-size: 19px; font-weight: 650; letter-spacing: 0.2px; }
.hero-sub { font-size: 12px; color: rgba(255, 255, 255, 0.62); margin-top: 3px; }
.hero-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(6px);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.plain { background: #fff; color: var(--ink-2); box-shadow: var(--shadow-s); }

.book-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff; font-size: 12.5px; font-weight: 500;
  backdrop-filter: blur(6px);
}
.book-chip svg { width: 12px; height: 12px; opacity: 0.7; }

.hero-balance { margin-top: 22px; }
.hero-label { font-size: 12px; color: rgba(255, 255, 255, 0.62); letter-spacing: 0.4px; }
.hero-amount {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 40px; font-weight: 680; letter-spacing: -1.2px; line-height: 1.15;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-amount span { font-size: 20px; font-weight: 500; opacity: 0.72; letter-spacing: 0; }
.hero-row { display: flex; gap: 26px; margin-top: 16px; }
.hero-row div { display: flex; flex-direction: column; gap: 2px; }
.hero-row .k { font-size: 11.5px; color: rgba(255, 255, 255, 0.58); }
.hero-row .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-row .v.income { color: #7ef0c8; }

/* 悬浮汇总卡 */
.float-card {
  margin-top: 14px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 16px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-mini { text-align: left; }
.stat-mini .k { font-size: 11.5px; color: var(--muted); }
.stat-mini .v { font-size: 17px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 14px -16px; }

/* 月份选择 */
.month-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2px 8px;
}
.month-pick {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px; font-weight: 600;
}
.month-pick svg { width: 14px; height: 14px; color: var(--muted); }
.month-nav { display: flex; gap: 4px; }
.month-nav button {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-2); background: #fff; box-shadow: var(--shadow-s);
}
.month-nav button svg { width: 14px; height: 14px; }
.month-nav button:disabled { opacity: 0.35; }

/* 账单列表 */
.day-group { margin-top: 14px; }
.day-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 6px;
  font-size: 12px; color: var(--muted);
}
.day-head b { color: var(--ink-2); font-weight: 600; margin-right: 6px; }
.day-head .sum { font-variant-numeric: tabular-nums; }
.list-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-s); overflow: hidden; }
.bill-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 13px 14px;
  position: relative;
  background: #fff;
  text-align: left;
}
.bill-item + .bill-item::before {
  content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line);
}
.bill-item:active { background: #fafbfc; }
.icon-badge {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px; flex: none;
}
.bill-main { flex: 1; min-width: 0; }
.bill-name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-amount { font-size: 16px; font-weight: 640; font-variant-numeric: tabular-nums; }
.bill-amount.expense { color: var(--ink); }
.bill-amount.income { color: var(--income); }

.empty {
  padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13px;
}
.empty-emoji { font-size: 34px; margin-bottom: 10px; opacity: 0.9; }

/* 卡片通用 */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-s); padding: 16px; margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: 0.1px; }
.card-hint { font-size: 11.5px; color: var(--muted); }
.card-title .dot { display: inline-block; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); margin-right: 8px; vertical-align: 2px; }

/* 分段控件 */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: #f1f3f6; border-radius: 12px;
}
.seg button {
  height: 30px; padding: 0 14px; border-radius: 9px;
  font-size: 13px; font-weight: 550; color: var(--ink-2);
  transition: all 0.18s;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }

/* 图表 */
.chart-wrap { position: relative; display: flex; justify-content: center; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center .k { font-size: 11px; color: var(--muted); }
.donut-center .v { font-size: 21px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 2px; }
.legend { margin-top: 8px; display: flex; flex-direction: column; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.legend-row + .legend-row { border-top: 1px solid var(--line); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-name { font-size: 13px; color: var(--ink-2); flex: 1; }
.legend-amount { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-pct { font-size: 11.5px; color: var(--muted); width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* 预算进度 */
.budget-row { padding: 11px 0; }
.budget-row + .budget-row { border-top: 1px solid var(--line); }
.budget-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.budget-name { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.budget-val { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-val b { color: var(--ink-2); font-weight: 600; }
.track { height: 7px; border-radius: 99px; background: #f1f3f6; overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.track.over > i { background: linear-gradient(90deg, #ff9a76, #ef5b52) !important; }
.over-tag {
  font-size: 10.5px; color: var(--danger); background: #fdecea;
  padding: 1px 6px; border-radius: 6px; font-weight: 600;
}

/* 首页快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: 14px; background: #fafbfc;
  font-size: 11.5px; color: var(--ink-2);
}
.quick-item .qi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: #fff; box-shadow: var(--shadow-s); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(16, 24, 40, 0.06);
  z-index: 20;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #9aa4b2; font-size: 10.5px; font-weight: 500;
  transition: color 0.18s;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--brand-deep); }
.tab.on svg { stroke-width: 2.1; }

.fab {
  position: absolute;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: 54px; height: 54px;
  border-radius: 20px;
  background: linear-gradient(140deg, #14b58c, #078264);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(10, 122, 95, 0.36);
  z-index: 19;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.94); }
.fab svg { width: 24px; height: 24px; }

/* ---------- 弹层 ---------- */
.mask {
  position: absolute; inset: 0; background: rgba(10, 18, 28, 0.46);
  z-index: 30; animation: fade 0.22s ease;
  backdrop-filter: blur(1px);
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 26px 26px 0 0;
  z-index: 31;
  max-height: 92%;
  display: flex; flex-direction: column;
  animation: rise 0.26s cubic-bezier(0.22, 0.75, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 6px; flex: none;
}
.sheet-title { font-size: 16px; font-weight: 650; }
.sheet-close { width: 30px; height: 30px; border-radius: 50%; background: #f3f4f7; display: grid; place-items: center; color: var(--ink-2); }
.sheet-close svg { width: 15px; height: 15px; }
.sheet-body { overflow-y: auto; padding: 8px 18px 18px; }

/* 记账面板 */
.entry-type { display: flex; justify-content: center; margin-bottom: 10px; }
.entry-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  padding: 6px 0 4px;
  font-size: 42px; font-weight: 680; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  min-height: 58px;
}
.entry-amount .cur { font-size: 20px; font-weight: 500; color: var(--muted); }
.entry-amount.income { color: var(--income); }
.entry-amount .caret { width: 2px; height: 34px; background: var(--brand); border-radius: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.entry-cats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  max-height: 168px; overflow-y: auto;
  padding: 4px 0 6px;
}
.cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px; border-radius: 14px;
  font-size: 11.5px; color: var(--ink-2);
}
.cat-cell .ci { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; background: #f6f7f9; }
.cat-cell.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.cat-cell.on .ci { background: #fff; box-shadow: 0 2px 8px rgba(10, 122, 95, 0.16); }
.entry-meta { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.entry-meta .field { height: 46px; background: #f7f8fa; box-shadow: none; border-radius: 13px; }
.entry-meta input { font-size: 14px; }
.entry-meta .date-btn {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: #f7f8fa; border-radius: 13px; font-size: 14px; color: var(--ink-2);
  text-align: left;
}
.entry-meta .date-btn svg { width: 16px; height: 16px; color: var(--muted); }
.entry-meta input[type="datetime-local"] { width: 100%; }

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: #f4f5f8; border-radius: 18px; padding: 8px;
}
.keypad button {
  height: 50px; border-radius: 12px; background: #fff;
  font-size: 21px; font-weight: 550; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  display: grid; place-items: center;
}
.keypad button:active { background: #eef0f4; }
.keypad button svg { width: 21px; height: 21px; }
.entry-actions { display: flex; gap: 10px; margin-top: 12px; }
.entry-actions .btn { flex: 1; height: 50px; }

/* 列表型设置 */
.setting-list { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-s); overflow: hidden; }
.setting-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  position: relative; width: 100%; text-align: left;
}
.setting-row + .setting-row::before {
  content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line);
}
.setting-row .si { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; background: #f5f7f9; flex: none; }
.setting-row .st { flex: 1; font-size: 14px; }
.setting-row .sv { font-size: 12.5px; color: var(--muted); }
.setting-row svg.chev { width: 15px; height: 15px; color: #c7ced9; }

.switch {
  width: 46px; height: 28px; border-radius: 99px; background: #e2e6ec;
  position: relative; transition: background 0.2s; flex: none;
}
.switch i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}
.switch.on { background: var(--brand); }
.switch.on i { transform: translateX(18px); }

/* 头像 & 个人 */
.profile {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--r-lg);
  background: #fff; box-shadow: var(--shadow-s);
  margin-top: 14px;
  position: relative; z-index: 3;
}
.avatar {
  width: 56px; height: 56px; border-radius: 19px;
  background: linear-gradient(145deg, #e8f7f2, #d3eee6);
  display: grid; place-items: center; font-size: 27px;
}
.profile-name { font-size: 17px; font-weight: 650; }
.profile-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- AI ---------- */
.ai-hero {
  margin: 0 -16px;
  padding: calc(16px + env(safe-area-inset-top)) 20px 42px;
  background:
    radial-gradient(300px 220px at 88% -20%, rgba(110, 231, 183, 0.32), transparent 70%),
    linear-gradient(150deg, #08211d 0%, #0d3b32 50%, #124d40 100%);
  color: #fff;
  border-radius: 0 0 26px 26px;
}
.ai-title { font-size: 22px; font-weight: 680; letter-spacing: 0.2px; }
.ai-desc { font-size: 12.5px; color: rgba(255, 255, 255, 0.62); margin-top: 6px; line-height: 1.55; }
.ai-badges { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 11px; font-weight: 500;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}
.badge-pill .dot-live { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18); }
.badge-pill .dot-local { width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; }

.ai-tabs { display: flex; gap: 6px; margin-top: -24px; position: relative; z-index: 2; }
.ai-tab {
  flex: 1; padding: 10px 6px; border-radius: 14px;
  background: #fff; box-shadow: var(--shadow-s);
  font-size: 12.5px; color: var(--ink-2); text-align: center; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.ai-tab .ti { font-size: 17px; }
.ai-tab.on { background: linear-gradient(140deg, #12ad86, #078264); color: #fff; box-shadow: 0 10px 20px rgba(10, 122, 95, 0.26); }

.ai-result {
  margin-top: 12px;
  background: #fafbfc;
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 13.5px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-result h4 { margin: 12px 0 4px; font-size: 13.5px; color: var(--ink); font-weight: 650; }
.ai-result h4:first-child { margin-top: 0; }
.ai-result .hl { color: var(--danger); font-weight: 600; }
.ai-result .pos { color: var(--brand-deep); font-weight: 600; }

.input-stack { display: flex; flex-direction: column; gap: 10px; }
.input-stack .field { background: #f7f8fa; box-shadow: none; height: 46px; border-radius: 13px; }
.input-stack textarea {
  width: 100%; min-height: 88px; padding: 13px 14px;
  background: #f7f8fa; border-radius: 13px; font-size: 14px; line-height: 1.6;
  resize: none; border: 1px solid transparent;
}
.input-stack textarea:focus { border-color: var(--brand); background: #fff; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 99px;
  background: #f1f3f6; color: var(--ink-2); font-size: 11.5px;
}
.chip:active { background: #e7eaef; }

.answer-block { animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.ring { width: 84px; height: 84px; flex: none; position: relative; }
.ring .rv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .rv b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ring .rv span { font-size: 10px; color: var(--muted); margin-top: 2px; }
.score-meta .t { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.score-meta .d { font-size: 12px; color: var(--muted); line-height: 1.6; }

.candidate {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px; background: #fafbfc;
  margin-top: 10px;
}
.candidate .cm { flex: 1; min-width: 0; }
.candidate .cn { font-size: 13.5px; font-weight: 550; }
.candidate .cs { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.candidate .ca { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mini-btn {
  height: 30px; padding: 0 12px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
}
.mini-btn.ghost { background: var(--brand-soft); color: var(--brand-deep); }

/* 骨架/加载 */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 提示 */
.toast-wrap {
  position: absolute; left: 0; right: 0; bottom: 96px;
  display: flex; justify-content: center; z-index: 60; pointer-events: none;
}
.toast {
  background: rgba(16, 24, 40, 0.9);
  color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 12px;
  max-width: 84%;
  animation: fadeUp 0.24s ease;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-m);
}
.toast.err { background: rgba(190, 40, 32, 0.94); }

/* 设置页小标题 */
.section-label { font-size: 12px; color: var(--muted); padding: 18px 4px 8px; font-weight: 500; }
.hint-box {
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
  background: #f7f8fa; border-radius: 12px; padding: 10px 12px; margin-top: 10px;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.select-pill { padding: 7px 12px; border-radius: 11px; background: #f2f4f7; font-size: 12.5px; color: var(--ink-2); }
.select-pill.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
