/* ═══════════════════════════════════════════════
   YEEX Design System v2
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-number: "Inter", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  /* Core palette */
  --sky-50: #f3fbff;
  --sky-100: #e4f5ff;
  --sky-200: #c8ebff;
  --sky-300: #9fdbff;
  --sky-400: #66c2ff;
  --sky-500: #2f97ec;
  --sky-600: #1c7fd4;
  --sky-700: #1769b4;

  --indigo-400: #75aef4;
  --indigo-500: #438ee4;
  --indigo-600: #2d75cf;

  --violet-400: #9ec9ff;
  --violet-500: #66aaf6;

  --amber-300: #ffeaa3;
  --amber-400: #ffdb64;
  --amber-500: #ffc43d;

  --emerald-400: #34d399;
  --emerald-500: #10b981;

  --rose-400: #ff8ba0;
  --rose-500: #f76883;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic */
  --bg-page:
    radial-gradient(circle at 78% 10%, rgba(255, 231, 146, 0.42), rgba(255, 231, 146, 0) 24%),
    radial-gradient(circle at 12% 18%, rgba(126, 207, 255, 0.42), rgba(126, 207, 255, 0) 30%),
    linear-gradient(160deg, #eaf7ff 0%, #f8fcff 48%, #eef8ff 100%);
  --bg-phone: linear-gradient(180deg, #eaf7ff 0%, #fbfdff 48%, #edf8ff 100%);
  --bg-glass: rgba(255, 255, 255, 0.66);
  --bg-glass-strong: rgba(255, 255, 255, 0.82);
  --border-glass: rgba(255, 255, 255, 0.86);
  --blur-glass: blur(34px) saturate(210%);

  --text-primary: #10263d;
  --text-secondary: #496780;
  --text-muted: #7c96ad;
  --text-accent: var(--sky-600);

  --accent: var(--sky-500);
  --accent-soft: var(--sky-100);

  --shadow-sm: 0 1px 4px rgba(40, 102, 150, 0.04), 0 10px 24px rgba(52, 142, 213, 0.08);
  --shadow-md: 0 8px 24px rgba(40, 102, 150, 0.06), 0 28px 68px rgba(52, 142, 213, 0.12);
  --shadow-lg: 0 18px 42px rgba(40, 102, 150, 0.09), 0 42px 100px rgba(52, 142, 213, 0.18);
  --shadow-glow: 0 0 64px rgba(74, 180, 255, 0.18);

  --radius-sm: 18px;
  --radius-md: 26px;
  --radius-lg: 34px;
  --radius-xl: 42px;
  --radius-phone: 52px;

  /* Element colors */
  --el-wood: #22c55e;
  --el-fire: #f97316;
  --el-earth: #eab308;
  --el-metal: #a855f7;
  --el-water: #3b82f6;

  /* Score colors */
  --score-high: linear-gradient(135deg, var(--emerald-400), var(--sky-400));
  --score-mid: linear-gradient(135deg, var(--sky-400), var(--indigo-400));
  --score-low: linear-gradient(135deg, var(--amber-400), var(--rose-400));
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; }

/* ── Stage ── */
.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}

/* ── Phone Shell ── */
.phone {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(390px, 100%);
  height: min(844px, calc(100vh - 56px));
  min-height: 640px;
  overflow: hidden;
  border-radius: var(--radius-phone);
  padding: 18px;
  background:
    radial-gradient(circle at 50% -4%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0) 24%),
    var(--bg-phone);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -18px 42px rgba(190, 226, 255, 0.22),
    var(--shadow-lg),
    var(--shadow-glow);
  border: 1px solid var(--border-glass);
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-block-end: 12px;
  scrollbar-width: none;
}
.app-scroll::-webkit-scrollbar { display: none; }

/* ── Status Bar ── */
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  padding-inline: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.status-brand {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 142px;
  color: var(--accent);
  line-height: 1;
  white-space: nowrap;
}

.brand-main {
  display: block;
  width: 112px;
  height: auto;
  object-fit: contain;
  transform: translateY(2px);
}

.brand-subtitle {
  display: inline-block;
  color: rgba(73, 103, 128, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  transform: translate(-2px, 6px);
}

.status-state {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

/* ── Live Hint ── */
.live-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.9);
}

.live-hint b {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.live-hint span {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: end;
  color: var(--text-muted);
}

.live-hint.warning {
  color: #92400e;
  background: rgba(254, 243, 199, 0.9);
  border-color: rgba(253, 230, 138, 0.5);
}
.live-hint.warning b { color: #d97706; }

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
.page[data-page="kline"].active {
  display: flex;
  flex-direction: column;
}

.page[data-page="kline"] .kline-setup-card {
  order: -2;
  margin-block-start: 6px;
}

/* 待重算时也要能改生辰：只有"已生成且输入没变"才收起设置表单 */
.page[data-page="kline"]:not(.needs-setup):not(.result-stale) .kline-setup-card {
  display: none;
}

.page[data-page="kline"].needs-setup .hero,
.page[data-page="kline"].needs-setup .kline-metrics-legacy,
.page[data-page="kline"].needs-setup .kline,
.page[data-page="kline"].needs-setup .flow-receipt-card,
.page[data-page="kline"].needs-setup .experience-sheet,
.page[data-page="kline"].needs-setup .week {
  display: none !important;
}

/*
 * 「已生成但需要重算」和「从没生成过」是两回事。
 * 原来两者共用 needs-setup，于是点一下「+ 添加经历」就触发 markResultStale()，
 * 整张经历卡片连同刚加的那条一起被 display:none 收走——经历根本没法编辑。
 * stale 状态保留报告和经历编辑器，只是把图压暗并提示需要重新生成。
 */
.page[data-page="kline"].result-stale .kline,
.page[data-page="kline"].result-stale .hero,
.page[data-page="kline"].result-stale .kline-metrics-legacy,
.page[data-page="kline"].result-stale .week {
  opacity: 0.55;
}

.stale-banner {
  display: none;
  order: -3;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-start: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 241, 243, 0.92);
  border: 1px solid rgba(194, 51, 77, 0.35);
  color: #a32340;
  font-size: 12px;
  font-weight: 700;
}

.page[data-page="kline"].result-stale .stale-banner {
  display: flex;
}

.stale-banner button {
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #c2334d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/*
 * 页面顺序按「用户打开这一页最想先知道什么」排：
 *   结论（现在多少分、什么大运什么流年）→ 四个关键指标（日主/喜用/起运/当前大运）
 *   → 百年K线 → 未来七年流年 → 记录真实经历
 * 原顺序是图表(-1) → 经历(0) → 结论(1) → 未来七年(2)：
 * 一打开先撞上 100 根挤在一起的蜡烛，看不出所以然，得往下滚才看到结论；
 * 而四个关键指标干脆被 display:none 藏掉了，只能去命盘页找。
 */
.page[data-page="kline"] #heroSection {
  order: -1;
  min-height: 132px;
  margin-block-start: 6px;
  padding: 14px;
}

.page[data-page="kline"] .kline-metrics-legacy {
  order: 0;
}

.page[data-page="kline"] .kline {
  order: 1;
  margin-block-start: 6px;
  padding: 14px;
}

.page[data-page="kline"] .week {
  order: 2;
}

.page[data-page="kline"] .experience-sheet {
  order: 3;
}

.page[data-page="kline"] #heroSection .hero-copy {
  max-width: 235px;
}

.page[data-page="kline"] #heroSection .score span {
  font-size: 38px;
}

.page[data-page="kline"] #heroSection .index-orb {
  width: 54px;
  height: 54px;
  right: 18px;
  top: 24px;
}

.page[data-page="kline"] #heroSection .index-orb i {
  width: 42px;
  height: 42px;
}

.page[data-page="kline"] #heroSection .index-orb em {
  width: 36px;
  height: 18px;
  bottom: 8px;
}

.page[data-page="kline"] #heroSection .segment,
.page[data-page="kline"] #heroSection .primary {
  display: none;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 210px;
  padding: 18px 18px;
  border-radius: 36px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 226, 133, 0.72), rgba(255, 226, 133, 0) 22%),
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 36%),
    linear-gradient(150deg, #9bddff 0%, #61c2f7 44%, #388fed 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.58),
    inset 0 -28px 62px rgba(19, 111, 211, 0.16),
    0 24px 58px rgba(48, 145, 230, 0.24),
    0 9px 22px rgba(48, 145, 230, 0.10);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(199, 235, 255, 0.24), transparent 45%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: -86px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 220px;
}

.eyebrow {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

.hero-mini-stats {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 9px;
}

.hero-mini-stats span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  font-size: 10px;
  font-weight: 900;
}

.score {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  margin-block: 5px 0 8px;
}

.score span {
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.score b {
  font-size: 18px;
  align-self: flex-end;
  margin-block-end: 6px;
  opacity: 0.8;
}

/* 「低位 / 中段 / 高位」：把裸分数换算成用户看得懂的位置 */
.score .score-level {
  flex: 0 0 auto;
  margin: 0 0 2px 7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.score .score-level:empty {
  display: none;
}

/* 当前大运在百年图上的位置 */
.cycle-band {
  fill: rgba(99, 102, 241, 0.08);
  stroke: rgba(99, 102, 241, 0.28);
  stroke-width: 0.6;
  stroke-dasharray: 2 2;
}

.cycle-band-label {
  fill: rgba(79, 70, 229, 0.75);
  font-size: 6px;
  font-weight: 800;
}

#heroReading {
  margin-block-end: 5px;
  font-size: 12.5px;
  opacity: 0.96;
}

/* 摘要与上面那句解读重复度高，收成一行，需要细节的去命盘页 */
#summary {
  opacity: 0.8;
  font-size: 12px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  line-height: 1.55;
  font-size: 13px;
  font-weight: 500;
  /* 白字压在渐变上，0.75 太淡；正文要读得清 */
  opacity: 0.92;
}

#summary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 当前流年指数球 ── */
.index-orb {
  position: absolute;
  right: 18px;
  top: 34px;
  width: 68px;
  height: 68px;
  z-index: 2;
  animation: float 4s ease-in-out infinite alternate;
  opacity: 0.82;
}

.index-orb i, .index-orb em {
  position: absolute;
  display: block;
}

.index-orb i {
  width: 50px;
  height: 50px;
  right: 0;
  top: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff1a8, #ffd75f, #ffc04a);
  box-shadow: 0 8px 28px rgba(255, 199, 70, 0.28), 0 0 42px rgba(255, 214, 97, 0.18);
}

.index-orb em {
  width: 44px;
  height: 22px;
  left: 0;
  bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(48, 145, 230, 0.12);
}

.mini-orb {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
}
.mini-orb i, .mini-orb em { position: absolute; display: block; }
.mini-orb i {
  width: 52px; height: 52px; right: 2px; top: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.3);
}
.mini-orb em {
  width: 48px; height: 24px; left: 2px; bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

/* ── Segment & Primary ── */
.segment {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-block-start: 14px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.segment button, .chips button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.segment button {
  padding: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.segment .active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.primary {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-block-start: 14px;
  border: 0;
  padding: 12px;
  border-radius: 999px;
  color: white;
  font-size: 16px;
  font-weight: 800;
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,0.34), rgba(255,255,255,0) 28%),
    linear-gradient(135deg, #66c7ff, #2e8cf0);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.36), 0 14px 30px rgba(46, 135, 234, 0.24);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/*
 * 日主 / 喜用神 / 起运 / 当前大运这四个数是整份报告的骨架，
 * 原来在 K 线页被 display:none 藏掉，用户只能切到命盘页才看得到。
 * 放回来，紧跟在结论下面。
 */

.page[data-page="kline"] .flow-receipt-card,
.page[data-page="kline"] .flow-peek-button {
  display: none;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(46, 135, 234, 0.25); }
.primary:active { transform: translateY(0); }

/* ── K-Line Setup ── */
.kline-setup-card {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.kline-setup-card::before {
  content: "";
  position: absolute;
  inset: -80px -80px auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 211, 255, 0.30), rgba(139, 211, 255, 0));
  pointer-events: none;
}

.setup-title {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
}

.setup-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: white;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(145deg, #57bbff, #2387ea);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.48), 0 14px 28px rgba(47, 151, 236, 0.22);
}

.setup-title h2 { font-size: 18px; }

.setup-steps {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(169, 214, 249, 0.34);
}

.setup-steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.setup-steps span b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-muted);
  background: rgba(226, 232, 240, 0.72);
  font-size: 11px;
}

.setup-steps span.active { color: var(--text-primary); }

.setup-steps span.active b {
  color: white;
  background: linear-gradient(145deg, #4aaeff, #227fe5);
  box-shadow: 0 8px 16px rgba(47, 151, 236, 0.22);
}

.setup-steps i {
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
}

.setup-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-block-end: 24px;
}

.setup-form label {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.setup-form .setup-full { grid-column: 1 / -1; }

.setup-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(137, 197, 246, 0.42);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.setup-form input:focus {
  border-color: rgba(47, 151, 236, 0.72);
  box-shadow: 0 0 0 3px rgba(47, 151, 236, 0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}

.setup-form .hour-field small {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  color: #247dcc;
  background: rgba(228, 245, 255, 0.88);
  border: 1px solid rgba(137, 197, 246, 0.34);
  font-size: 10px;
  font-weight: 900;
}

.setup-chips-row {
  display: grid;
  gap: 10px;
}

.setup-chips-row small {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
}

.setup-chips {
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  background: rgba(228, 245, 255, 0.72);
}

.setup-preview {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 226, 133, 0.28), transparent 28%),
    linear-gradient(145deg, rgba(238, 248, 255, 0.92), rgba(255, 255, 255, 0.74));
  border: 1px solid rgba(137, 197, 246, 0.34);
}

.setup-preview b {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.setup-preview span {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.setup-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-block-start: -12px;
}

.setup-pillars article {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(137, 197, 246, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.setup-pillars small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 900;
}

.setup-pillars b {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}

.setup-pillars span {
  max-width: 100%;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-actions {
  display: grid;
  grid-template-columns: minmax(108px, 0.72fr) minmax(0, 1.28fr);
  gap: 10px;
}

.setup-save,
.setup-generate {
  min-height: 46px;
  margin-block-start: 0;
}

.setup-save {
  border: 1px solid rgba(47, 151, 236, 0.3);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-brand, #146cc1);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.setup-save.is-saved {
  border-color: rgba(44, 143, 111, 0.35);
  background: rgba(232, 248, 241, 0.92);
  color: #217a60;
}

.setup-save-status {
  margin: 8px 2px 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.setup-generate[disabled] { opacity: 0.72; cursor: progress; }

@media (max-width: 340px) {
  .setup-actions { grid-template-columns: 1fr; }
}

/* ── Cards & Glass ── */
.hero, .card, .metric-grid article {
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--blur-glass);
}

.card {
  margin-block-start: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 30%),
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(244, 251, 255, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 38px rgba(75, 139, 201, 0.12);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.9);
  animation: fadeSlideUp 0.4s ease both;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
.card:nth-child(7) { animation-delay: 0.3s; }

.birth-hero, .profile-hero { margin-block-start: 0; }

.card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 14px;
}

.page[data-page="kline"] .kline header {
  margin-block-end: 9px;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.card p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

small, .card p, label {
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Metric Grid ── */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.page[data-page="kline"] .metric-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.metric-grid article {
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.92), rgba(255,255,255,0) 35%),
    rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.86);
  transition: transform 0.2s ease;
}
.metric-grid article:hover { transform: translateY(-2px); }

.metric-grid article {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 10px;
  padding: 14px;
}

.page[data-page="kline"] .metric-grid article {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  text-align: center;
}

.metric-grid span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
}

.metric-icon-emotion { background: #e4f5ff; color: #2f91e8; }
.metric-icon-focus { background: #dff2ff; color: #1f7dd2; }
.metric-icon-action { background: #eef8ff; color: #2c87df; }
.metric-icon-inspire { background: #f3fbff; color: #3298e8; }

.page[data-page="kline"] .metric-grid span {
  grid-row: auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.metric-grid b {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.profile-readonly.locked b {
  max-width: 100%;
  display: block;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  padding: 0;
}

.page[data-page="kline"] .metric-grid b {
  font-size: 17px;
}

/* ── K-Line Chart ── */
.chart {
  position: relative;
  padding: 12px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,0.98), rgba(255,255,255,0) 30%),
    radial-gradient(circle at 92% 12%, rgba(255, 204, 213, 0.22), rgba(255, 204, 213, 0) 28%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(232,247,255,0.80));
  border: 1px solid rgba(137, 197, 246, 0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 14px 34px rgba(50, 112, 175, 0.12);
}

.market-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px 7px;
  color: var(--text-primary);
}

.market-strip span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--accent);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
}

.market-strip b {
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--sky-600);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}

.market-strip em {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: var(--text-muted);
}

.chart svg {
  width: 100%;
  height: 238px;
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(137, 197, 246, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.94);
}

#element {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #247dcc;
  background: rgba(232, 248, 255, 0.76);
  border: 1px solid rgba(137, 197, 246, 0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84), 0 8px 18px rgba(59, 130, 246, 0.10);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.grid {
  fill: none;
  stroke: rgba(80, 99, 118, 0.24);
  stroke-width: 0.65;
  stroke-dasharray: none;
}

.grid.vertical {
  stroke: rgba(80, 99, 118, 0.16);
}

.chart-pane {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(137, 197, 246, 0.26);
  stroke-width: 0.8;
}

.volume-pane {
  fill: rgba(235, 248, 255, 0.74);
  stroke: rgba(137, 197, 246, 0.2);
  stroke-width: 0.8;
}

/* Stock styling additions */
.candle-wick {
  stroke-width: 1.25;
  stroke-linecap: square;
}
.candle-wick.bull { stroke: #ff6f8f; }
.candle-wick.bear { stroke: #4fb5ff; }

.candle-body {
  stroke-width: 1;
  rx: 2;
  filter: drop-shadow(0 3px 6px rgba(50, 112, 175, 0.12));
}
.candle-body.bull {
  fill: url(#bullGradient);
  stroke: #ff9caf;
}
.candle-body.bear {
  fill: url(#bearGradient);
  stroke: #68bdf6;
}

.volume-bar {
  rx: 0;
}
.volume-bar.bull { fill: rgba(255, 111, 143, 0.36); }
.volume-bar.bear { fill: rgba(79, 181, 255, 0.42); }

.ma-line {
  fill: none;
  stroke: #facc15;
  stroke-width: 1.75;
  stroke-dasharray: 4 4;
  opacity: 0.86;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.32));
}

.crosshair-hud line {
  pointer-events: none;
}

.chart-label {
  fill: #45586d;
  font-size: 7px;
  font-weight: 900;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}

.year-label {
  fill: #334e68;
}

.age-label {
  fill: #8aa0b6;
  font-size: 6.5px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
}

/* Y-axis labels */
.chart-axis-label {
  fill: #51667a;
  font-size: 8px;
  font-weight: 900;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}

.axis-title,
.x-axis-title {
  fill: #7b91a7;
  font-size: 7px;
  font-weight: 900;
}

.ma-label,
.volume-label {
  fill: #f59e0b;
  font-size: 7px;
  font-weight: 900;
}

.volume-label {
  fill: #7c8da0;
}

/* Volume separator line */
.vol-separator {
  stroke: var(--slate-200);
  stroke-width: 0.8;
}

/* Node event flag markers */
.node-flag polygon {
  cursor: pointer;
  transition: opacity 0.15s;
}
.node-flag polygon:hover { opacity: 1 !important; }

/* Predicted candle label */
.pred-label {
  fill: var(--slate-400);
  font-size: 7px;
  font-weight: 800;
  font-style: italic;
}

/* Chart legend */
.chart-legend {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  padding: 0 2px;
  flex-wrap: wrap;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-legend-dot.bull { background: #fb7185; }
.chart-legend-dot.bear { background: #7cc7ff; }
.chart-legend-dot.ma { background: #fbbf24; border-radius: 50%; }
.chart-legend-dot.pred { background: transparent; border: 1.5px dashed #94a3b8; }
.chart-legend-dot.checkin-dot { background: #818cf8; border-radius: 50%; }

.life-range-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.life-range-summary div {
  display: grid;
  gap: 2px;
}

.life-range-summary small,
.life-range-summary span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
}

.life-range-summary b {
  color: var(--text-primary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.life-range-summary span {
  max-width: 105px;
  text-align: right;
}

.year-jump {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  padding: 1px 1px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 70, 229, 0.25) transparent;
}

.year-jump button {
  display: grid;
  flex: 0 0 auto;
  min-width: 58px;
  gap: 1px;
  padding: 7px 8px;
  border: 1px solid rgba(137, 197, 246, 0.34);
  border-radius: 11px;
  background: rgba(241, 249, 255, 0.86);
  color: var(--text-secondary);
  text-align: center;
}

.year-jump button b {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.year-jump button small {
  color: var(--text-muted);
  font-size: 8px;
  white-space: nowrap;
}

.year-jump button.current {
  border-color: rgba(79, 70, 229, 0.42);
}

.year-jump button.active {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.22);
}

.year-jump button.active small { color: rgba(255, 255, 255, 0.82); }

.current-year-line {
  stroke: rgba(79, 70, 229, 0.58);
  stroke-width: 0.8;
  stroke-dasharray: 3 3;
}

.current-year-badge rect {
  fill: #4f46e5;
  filter: drop-shadow(0 3px 5px rgba(79, 70, 229, 0.24));
}

.current-year-badge text {
  fill: #fff;
  font-size: 7px;
  font-weight: 900;
}

.extreme-marker circle { stroke: #fff; stroke-width: 1.2; }
.extreme-marker.high circle { fill: #fb7185; }
.extreme-marker.low circle { fill: #38bdf8; }
.extreme-marker text {
  fill: #526579;
  font-size: 6.5px;
  font-weight: 900;
}

.year-detail-card {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 247, 255, 0.95), rgba(238, 248, 255, 0.82));
}

.year-detail-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.year-detail-card header span,
.year-detail-card p {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.55;
}

.year-detail-card header b {
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 15px;
  text-align: center;
}

.year-detail-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
}

.year-detail-card p { margin: 0; }

.ohlc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.ohlc-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid rgba(47, 151, 236, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.ohlc-item small { color: var(--text-muted); font-size: 9px; }
.ohlc-item b {
  color: var(--text-primary);
  font-family: var(--font-number);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.ohlc-high b { color: #e84f70; }
.ohlc-low b { color: #168bc9; }
.ohlc-close b { color: var(--accent); }
.year-detail-node { display: block; margin-top: 8px; color: var(--text-secondary); }

.future-lock-mask {
  fill: rgba(232, 248, 255, 0.72);
  stroke: rgba(47, 151, 236, 0.26);
  stroke-width: 0.8;
  stroke-dasharray: 4 4;
  backdrop-filter: blur(10px);
}

.future-lock-badge rect {
  fill: rgba(255, 255, 255, 0.88);
  stroke: rgba(47, 151, 236, 0.32);
  filter: drop-shadow(0 8px 14px rgba(47, 151, 236, 0.12));
}

.future-lock-badge text {
  fill: #247dcc;
  font-size: 10px;
  font-weight: 900;
}


/* Chart tooltip */
.chart-tooltip {
  position: absolute;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--slate-800);
  color: white;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.years, .meters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.meters {
  grid-template-columns: repeat(3, 1fr);
  margin-block-start: 8px;
}

.meters article, .nodes article {
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.page[data-page="kline"] .meters article {
  padding: 9px 10px;
}

.meters b {
  display: block;
  margin-block-start: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

/* ── Cycle ── */
.cycle-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-start: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(228, 245, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.cycle-note b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.cycle-note span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: end;
}

.flow-peek-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-block-start: 9px;
  padding: 12px 14px;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 24%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(135deg, rgba(224, 242, 254, 0.96), rgba(245, 243, 255, 0.92));
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 14px 30px rgba(56, 189, 248, 0.16);
  cursor: pointer;
}

.flow-peek-button span {
  color: var(--accent);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-align: left;
}

.flow-peek-button b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.unlock-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-block-start: 9px;
  padding: 12px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 226, 133, 0.26), transparent 34%),
    linear-gradient(145deg, rgba(235, 248, 255, 0.92), rgba(255, 255, 255, 0.76));
  border: 1px solid rgba(137, 197, 246, 0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
}

.unlock-panel div {
  display: grid;
  gap: 4px;
}

.unlock-panel b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.unlock-panel span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.unlock-panel button,
.login-button,
.pay-button {
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #66c7ff, #2e8cf0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.36), 0 12px 24px rgba(46, 135, 234, 0.20);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.unlock-panel button {
  min-width: 88px;
  padding: 10px 12px;
}

.cycle-strip, .decade-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-block-start: 10px;
}

.cycle-strip article, .decade-strip article {
  display: grid;
  gap: 3px;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: background 0.2s, box-shadow 0.2s;
}

.cycle-strip article.active, .decade-strip article.active {
  background: var(--accent-soft);
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.1);
}

.cycle-strip b, .decade-strip b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.cycle-strip span, .cycle-strip small,
.decade-strip span, .decade-strip small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.cycle-strip small, .decade-strip small {
  color: var(--accent);
}

/* ── Rhythm Card ── */
.rhythm-card strong {
  max-width: 118px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.35;
  text-align: end;
}

.rhythm-row, .pillar-list { display: grid; gap: 8px; }
.rhythm-row { grid-template-columns: repeat(4, 1fr); }

.rhythm-row article, .pillar-list article {
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.rhythm-row article {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px;
}

.rhythm-row b {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 800;
}

.rhythm-row span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

/* ── Birth Pillars ── */
.pillar-list article {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  transition: transform 0.15s ease;
}
.pillar-list article:hover { transform: translateX(2px); }

.pillar-list .pillar-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 20px;
}

.pillar-icon-wood { background: #dcfce7; color: var(--el-wood); }
.pillar-icon-fire { background: #ffedd5; color: var(--el-fire); }
.pillar-icon-earth { background: #fef9c3; color: var(--el-earth); }
.pillar-icon-metal { background: #f3e8ff; color: var(--el-metal); }
.pillar-icon-water { background: #dbeafe; color: var(--el-water); }

.pillar-list span {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
}

.pillar-list small {
  font-size: 12px;
  font-weight: 600;
}

.bazi-matrix {
  display: grid;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.bazi-matrix-row {
  display: grid;
  grid-template-columns: 42px repeat(4, minmax(0, 1fr));
  align-items: stretch;
  border-bottom: 1px solid var(--border-glass);
}

.bazi-matrix-row:last-child { border-bottom: 0; }

.bazi-matrix-row > * {
  display: grid;
  min-width: 0;
  min-height: 38px;
  place-items: center;
  padding: 6px 3px;
  border-right: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 10px;
  text-align: center;
  overflow-wrap: anywhere;
}

.bazi-matrix-row > *:last-child { border-right: 0; }
.bazi-matrix-head { background: rgba(79, 70, 229, 0.06); }
.bazi-matrix-head b { color: var(--text-primary); font-size: 12px; }
.bazi-row-label { color: var(--text-muted); font-weight: 800; }

.bazi-ganzhi {
  margin: 5px;
  min-height: 34px;
  border-radius: 11px;
  font-size: 19px !important;
}

.hidden-stems {
  align-content: center;
  gap: 4px;
}

.hidden-stems i {
  display: grid;
  grid-template-columns: auto;
  color: var(--text-primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.hidden-stems small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

/* ── Decade Card ── */
.decade-card strong {
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
}

/* ── 未来七年预测 ── */
.forecast-card {
  overflow: hidden;
}

.forecast-card header {
  align-items: flex-start;
  gap: 10px;
  margin-block-end: 14px;
}

.forecast-heading {
  min-width: 0;
}

.forecast-kicker {
  display: block;
  margin-block-end: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.forecast-heading h2 {
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.2;
}

.forecast-heading p {
  max-width: 290px;
  margin-block-start: 6px;
  line-height: 1.55;
}

.forecast-swipe-hint {
  appearance: none;
  flex: 0 0 auto;
  margin-block-start: 2px;
  padding: 5px 8px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
  background: rgba(235, 248, 255, 0.78);
  color: var(--accent);
  font-size: 9px;
  font-family: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.days {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82px;
  grid-template-columns: none;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  cursor: grab;
  padding: 2px 2px 7px;
}

.days.dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.days::-webkit-scrollbar {
  display: none;
}

.days div {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 7px;
  min-height: 174px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(137, 197, 246, 0.2);
  scroll-snap-align: start;
  transition: background 0.2s, border-color 0.2s;
}

.days .today {
  background: var(--accent-soft);
  border-color: rgba(14, 165, 233, 0.28);
}

.days b {
  color: var(--accent);
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
}
.days small {
  max-width: none;
  min-height: 24px;
  font-size: 9px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}
.days span { font-size: 15px; font-weight: 900; color: var(--text-primary); }

.days em {
  font-size: 8px;
  font-weight: 800;
  font-style: normal;
  color: var(--text-muted);
}

/* 涨/跌标记取代原来的天气图标（☀ ☁ 🌧） */
.days .year-trend-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.days .year-trend-icon.rise {
  color: #c2334d;
  background: linear-gradient(180deg, #fff1f3, #ffd7de);
}

.days .year-trend-icon.fall {
  color: #1f7a9c;
  background: linear-gradient(180deg, #f1fbff, #cfeaf7);
}

/* 落在百年区间之外的经历不会计入 K 线，标出来而不是让它静静失效 */
.node-item.node-out-of-range {
  border-color: rgba(194, 51, 77, 0.45);
}

.node-item.node-out-of-range .node-top b {
  color: #c2334d;
  font-size: 12px;
}

/* ── Life Nodes / Experience Sheet ── */
.experience-sheet {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 248, 255, 0.58));
}

.experience-sheet summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.experience-sheet summary::-webkit-details-marker {
  display: none;
}

.experience-sheet summary span {
  display: grid;
  gap: 4px;
}

.experience-sheet summary b {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 900;
}

.experience-sheet summary small {
  font-size: 12px;
  line-height: 1.45;
}

.experience-sheet summary i {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.experience-sheet[open] summary {
  margin-bottom: 14px;
}

.experience-sheet[open] summary i::before {
  content: "已";
}

.experience-sheet:not([open]) header,
.experience-sheet:not([open]) #nodeList {
  display: none;
}

.experience-sheet header {
  padding-bottom: 4px;
  border-bottom: 0.5px solid rgba(125, 163, 196, 0.16);
}

.nodes header button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: grid;
  place-items: center;
  line-height: 1;
}
.nodes header button:hover { transform: scale(1.1); }

.nodes article + article { margin-block-start: 10px; }

.node-item {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-block-end: 10px;
}

.node-top span {
  display: inline-flex;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--slate-100);
}

.node-top button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.node-top button:hover { background: var(--slate-200); color: var(--text-primary); }

.node-item label {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text-primary);
  background: white;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--sky-400);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

/* ── Chips ── */
.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin: 8px 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--slate-100);
}

.chips button {
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.chips .active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Slider ── */
.range {
  appearance: none;
  height: 6px;
  margin-block-start: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-400), var(--slate-200), var(--emerald-400));
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
  cursor: pointer;
}

/* ── Flow Receipt / Today Detail ── */
.today-card { padding-block-end: 16px; }

.flow-receipt-card {
  position: relative;
  overflow: hidden;
  margin-block-start: 10px;
  background:
    radial-gradient(circle at 85% 10%, rgba(186, 230, 253, 0.62), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 248, 255, 0.62));
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px rgba(78, 151, 211, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.page[data-page="kline"] .flow-receipt-card {
  min-height: 210px;
}

.flow-receipt-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 0.5px solid rgba(125, 163, 196, 0.16);
  pointer-events: none;
}

.today-action {
  display: grid;
  gap: 8px;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 0.5px solid rgba(125, 163, 196, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.today-action small {
  color: var(--text-muted);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.today-action b {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.today-action span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.receipt-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.receipt-form label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.receipt-form label b {
  color: var(--accent);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.receipt-form textarea {
  min-height: 74px;
  background: rgba(255, 255, 255, 0.76);
}

.receipt-spark {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 0.5px solid rgba(125, 163, 196, 0.18);
}

.receipt-spark > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.receipt-spark b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.receipt-spark span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.spark-bars {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 64px;
  padding: 8px 10px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.86), rgba(255, 255, 255, 0.72));
}

.spark-bars i {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  background: rgba(186, 230, 253, 0.78);
}

.spark-bars i.active {
  background: linear-gradient(180deg, #93c5fd, #38bdf8);
  box-shadow: 0 8px 16px rgba(56, 189, 248, 0.18);
}

.receipt-submit {
  margin-top: 0;
  background: linear-gradient(135deg, var(--sky-500), #60a5fa);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.18);
}

/* ── Steps ── */
.steps {
  display: grid;
  gap: 6px;
  margin-block-start: 10px;
}

.steps p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.privacy-reset {
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border: 1px solid rgba(125, 163, 196, 0.24);
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.policy-details {
  margin-top: 12px;
  border: 1px solid rgba(125, 163, 196, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.policy-details summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.policy-details summary::-webkit-details-marker {
  display: none;
}

.policy-details summary::after {
  content: "›";
  float: right;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 0.8;
  transform: rotate(90deg);
}

.policy-details[open] summary::after {
  transform: rotate(-90deg);
}

.policy-details div {
  display: grid;
  gap: 6px;
  padding: 0 15px 15px;
}

.policy-details b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.policy-details p {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

/* ── Form Card ── */
.form-card { display: grid; gap: 8px; }
.form-card label {
  margin-block-start: 4px;
  font-size: 13px;
  font-weight: 700;
}

/* ── Profile ── */
.profile-hero {
  background: linear-gradient(145deg, #63c4f6 0%, #3aa1ee 48%, #2f86e8 100%);
  color: white;
  box-shadow: 0 18px 48px rgba(48, 145, 230, 0.22);
}
.profile-hero h2 { color: white; }
.profile-hero p { color: rgba(255,255,255,0.75); }

.login-card,
.paywall-card {
  position: relative;
  overflow: hidden;
}

/*
 * 会员状态。普通用户是中性灰蓝，会员才上金色——
 * 让「已经是会员」这件事看一眼就和「还不是」区分开。
 */
.member-state {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-block-start: 11px;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.member-state[hidden] { display: none !important; }

.member-state b {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(100, 137, 168, 0.1);
  color: #4a6c8a;
  font-size: 12px;
  font-weight: 900;
}

.member-state span {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.member-state.is-member {
  padding: 10px 13px;
  border-color: rgba(214, 168, 74, 0.55);
  border-style: solid;
  border-width: 1px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 250, 236, 0.95), rgba(255, 244, 219, 0.88));
}

.member-state.is-member b {
  background: linear-gradient(135deg, #e0b354, #c8923a);
  color: #ffffff;
}

.member-state.is-member span { color: #8a6a26; }

.member-expiry-notice {
  flex: 1 0 100%;
  margin: 2px 0 0;
  padding: 8px 10px;
  border-left: 3px solid #c0442f;
  border-radius: 0 10px 10px 0;
  background: rgba(192, 68, 47, 0.08);
  color: #8f2f1e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.member-expiry-notice[hidden] { display: none !important; }
.member-state.is-expiring { border-color: rgba(192, 68, 47, 0.38); }

/* 云端会员凭证：轻盈、克制，与整站的 iOS 玻璃感保持一致。 */
.membership-promo {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(202, 164, 79, 0.3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 3%, rgba(232, 199, 117, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(252, 249, 239, 0.94) 56%, rgba(241, 248, 253, 0.94));
  box-shadow: 0 12px 30px rgba(126, 101, 47, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.membership-promo[hidden] { display: none !important; }

.membership-promo::after {
  content: "";
  position: absolute;
  right: -52px;
  top: -72px;
  width: 146px;
  height: 146px;
  border: 1px solid rgba(205, 169, 84, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.membership-promo-heading,
.membership-promo-copy,
.membership-promo-footer {
  position: relative;
  z-index: 1;
}

.membership-promo-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.membership-promo-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(201, 151, 51, 0.24);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 249, 229, 0.96), rgba(244, 225, 168, 0.68));
  box-shadow: 0 4px 10px rgba(164, 121, 35, 0.1);
}

.membership-promo-mark svg { width: 14px; height: 14px; }
.membership-promo-mark path {
  fill: none;
  stroke: #bd8725;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.membership-promo-kicker {
  color: #8d6a29;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.membership-promo h3 {
  max-width: 310px;
  margin: 2px 0 4px;
  color: #102a42;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.38;
}

.membership-promo p {
  margin: 0;
  color: #6e8ba4;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.55;
}

.membership-promo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(190, 151, 68, 0.16);
}

.membership-promo-footer small {
  min-width: 0;
  color: #7892a7;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
}

.membership-promo-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 8px 8px 8px 13px;
  border: 1px solid rgba(163, 116, 28, 0.2);
  border-radius: 11px;
  background: linear-gradient(135deg, #edca72, #c99735);
  box-shadow: 0 7px 15px rgba(157, 112, 26, 0.18), inset 0 1px 0 rgba(255, 250, 221, 0.72);
  color: #4f3910;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.membership-promo-button i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: rgba(255, 248, 216, 0.32);
  font-size: 17px;
  font-style: normal;
  transition: transform 0.18s ease;
}

.membership-promo-button:hover i { transform: translateX(3px); }

.member-benefits {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.member-benefits[hidden] { display: none !important; }

.member-benefits span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid rgba(137, 197, 246, 0.28);
  border-radius: 999px;
  background: rgba(228, 245, 255, 0.78);
  color: #1d7ac5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.member-benefits span::before {
  content: "✓";
  color: #10a875;
  font-weight: 900;
}

.access-lock-card,
.access-lock-inline {
  border: 1px dashed rgba(48, 150, 237, 0.42);
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.96), rgba(255, 255, 255, 0.94));
}

.access-lock-card[hidden],
.access-lock-inline[hidden] { display: none !important; }

.access-lock-card h2 { margin: 5px 0 7px; }

.access-lock-card p,
.access-lock-inline span {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.access-lock-kicker {
  color: #1884dc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.access-lock-inline {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
}

.access-lock-inline b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.saved-profiles-card[hidden] { display: none !important; }

.saved-profiles-card header strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.saved-profiles-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.saved-profiles-search {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(139, 190, 231, 0.48);
  border-radius: 13px;
  background: rgba(248, 252, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.saved-profiles-search:focus-within {
  border-color: rgba(47, 151, 236, 0.8);
  box-shadow: 0 0 0 3px rgba(47, 151, 236, 0.12);
}

.saved-profiles-search span {
  flex: 0 0 auto;
  color: #52738d;
  font-size: 20px;
  line-height: 1;
}

.saved-profiles-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 0 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.saved-profiles-search input::placeholder { color: #71879a; }

.saved-profiles-manage {
  min-width: 62px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(197, 139, 25, 0.44);
  border-radius: 13px;
  background: #fffaf0;
  color: #9a6812;
  font-size: 13px;
  font-weight: 700;
}

.saved-profiles-manage[aria-pressed="true"] {
  border-color: rgba(190, 62, 53, 0.4);
  background: #fff3ef;
  color: #aa3d34;
}

.saved-profiles-bulk {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(190, 62, 53, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 249, 244, 0.98), rgba(255, 242, 237, 0.92));
}

.saved-profiles-bulk[hidden] { display: none !important; }
.saved-profiles-bulk button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}
.saved-profiles-bulk strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.saved-profiles-bulk button.danger { background: #b9473f; color: #fff; }
.saved-profiles-bulk button:disabled { opacity: 0.48; }

.saved-profiles-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.saved-profiles-status {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(226, 243, 255, 0.8);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.saved-profiles-status[hidden] { display: none !important; }
.saved-profiles-status.is-success { background: rgba(232, 248, 241, 0.9); color: #217a60; }
.saved-profiles-status.is-error { background: rgba(255, 238, 239, 0.92); color: #b6384f; }

.saved-profile-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid rgba(153, 178, 198, 0.3);
  border-radius: 17px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 254, 0.94));
  box-shadow: 0 8px 22px rgba(29, 76, 108, 0.06);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.saved-profile-item.is-selected {
  border-color: rgba(190, 62, 53, 0.46);
  background: linear-gradient(150deg, #fffdfb, #fff3ef);
  transform: translateY(-1px);
}

.saved-profile-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}

.saved-profile-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.saved-profile-selector span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(82, 108, 131, 0.5);
  border-radius: 7px;
  background: #fff;
}

.saved-profile-selector input:checked + span {
  border-color: #b9473f;
  background: #b9473f;
}

.saved-profile-selector input:checked + span::after {
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.saved-profile-selector b { font-size: 12px; font-weight: 650; }

.saved-profile-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.saved-profile-main span { display: grid; gap: 3px; min-width: 0; }
.saved-profile-main b { color: var(--text-primary); font-size: 15px; font-weight: 700; }
.saved-profile-main small { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.saved-profile-main small.saved-profile-updated { color: #71879a; font-size: 12px; }
.saved-profile-main em {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 6px 9px;
  border-radius: 11px;
  background: #fff8e9;
  color: #9a6812;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}
.saved-profile-main em strong { color: #a34237; font-size: 16px; font-variant-numeric: tabular-nums; }

.saved-profile-item details summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.saved-report-history { display: grid; gap: 6px; margin-top: 8px; }
.saved-report-history p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}
.saved-report-history b { color: var(--text-primary); font-size: 12px; }
.saved-report-history span { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

.saved-profile-actions { display: flex; gap: 8px; }
.saved-profile-actions[hidden] { display: none !important; }
.saved-profile-actions button {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #57bbff, #2387ea);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.saved-profile-actions button.ghost {
  border: 1px solid rgba(139, 190, 231, 0.48);
  background: #fff;
  color: var(--text-secondary);
}

.saved-profile-actions button.danger { color: #b6384f; }
.saved-profile-actions button:disabled { opacity: 0.62; cursor: not-allowed; }
.saved-profile-actions button.is-busy { cursor: progress; }

.saved-profiles-empty-search {
  display: grid;
  gap: 4px;
  padding: 22px 14px;
  border-radius: 16px;
  background: rgba(247, 251, 254, 0.82);
  text-align: center;
}
.saved-profiles-empty-search b { color: var(--text-primary); font-size: 14px; }
.saved-profiles-empty-search span { color: var(--text-secondary); font-size: 12px; }

@media (max-width: 359px) {
  .saved-profiles-bulk { grid-template-columns: 1fr 1fr; }
  .saved-profiles-bulk strong { grid-column: 1 / -1; grid-row: 1; }
}

/* ── 会员档位 ── */
.plan-picker {
  position: relative;
  z-index: 2;
  margin-block-start: 12px;
}

.plan-picker[hidden] { display: none !important; }

.plan-picker.membership-focus {
  animation: membership-plan-focus 1.55s ease both;
}

@keyframes membership-plan-focus {
  0%, 100% { filter: none; }
  32% { filter: drop-shadow(0 0 11px rgba(35, 135, 234, 0.46)); }
}

.plan-picker-title {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.plan-value-line {
  margin: -2px 0 11px;
  padding: 8px 10px;
  border-left: 3px solid #c0442f;
  border-radius: 0 10px 10px 0;
  background: rgba(253, 241, 238, 0.92);
  color: #8f2f1e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

/* 三个会员档位严格并列，不截断第三张，也不要求用户横向滑动。 */
.plan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  width: 100%;
  overflow: visible;
}

.plan-item {
  position: relative;
  overflow: visible;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 3px;
  padding: 10px 5px;
  border: 1px solid rgba(139, 190, 231, 0.55);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.plan-item:hover:not(:disabled) {
  border-color: #3096ed;
  transform: translateY(-1px);
}

.plan-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.plan-item.selected {
  border-color: #2387ea;
  background: linear-gradient(145deg, rgba(228, 245, 255, 0.97), rgba(255, 255, 255, 0.94));
  box-shadow: 0 0 0 2px rgba(35, 135, 234, 0.18), 0 8px 20px rgba(35, 135, 234, 0.12);
  transform: translateY(-2px);
}

.plan-item.popular {
  border-color: rgba(213, 166, 63, 0.68);
  background: linear-gradient(145deg, rgba(255, 249, 232, 0.97), rgba(255, 255, 255, 0.94));
}

.plan-item.popular::before {
  content: attr(data-badge);
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0cf79, #c99634);
  color: #4d370d;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.plan-item.is-busy {
  opacity: 0.82;
  cursor: progress;
}

.plan-item.is-busy::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(35, 135, 234, 0.22);
  border-top-color: #2387ea;
  border-radius: 50%;
  animation: plan-spin 0.65s linear infinite;
}

@keyframes plan-spin { to { transform: rotate(360deg); } }

.plan-item b {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-item span {
  color: #1470c8;
  font-size: clamp(14px, 4.1vw, 17px);
  font-weight: 900;
  white-space: nowrap;
}

.plan-item small {
  align-self: end;
  display: grid;
  gap: 1px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.35;
}

.plan-item small em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-item small .plan-core-benefit {
  color: #9b3324;
  font-weight: 800;
}

.plan-hint {
  margin: 8px 2px 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.login-card::after,
.paywall-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -54px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 211, 255, 0.26), transparent 64%);
  pointer-events: none;
}

.login-card header,
.paywall-card header {
  position: relative;
  z-index: 1;
}

.login-card strong,
.paywall-card strong {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(228, 245, 255, 0.88);
  border: 1px solid rgba(137, 197, 246, 0.34);
  font-size: 12px;
  font-weight: 900;
}

.paywall-card strong {
  color: white;
  background: linear-gradient(135deg, #57bbff, #2387ea);
  box-shadow: 0 10px 22px rgba(47, 151, 236, 0.18);
}

.paywall-hidden {
  display: none !important;
}

.login-button,
.pay-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding: 11px 14px;
  font-size: 14px;
}

.login-button.logged {
  color: #1e83da;
  background: rgba(231, 247, 255, 0.9);
  border: 1px solid rgba(126, 197, 247, 0.36);
  box-shadow: none;
}

.commerce-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.commerce-links a {
  color: inherit;
  text-decoration: none;
}

.commerce-links a:hover,
.commerce-links a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.login-sheet.show {
  display: flex;
}

.login-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 30, 54, 0.22);
  backdrop-filter: blur(10px);
}

.login-sheet-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 255, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(38, 120, 202, 0.28);
}

.login-sheet-close {
  position: sticky;
  float: right;
  top: 16px;
  right: 0;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #5d7d98;
  background: rgba(223, 241, 252, 0.9);
  font-size: 24px;
  line-height: 1;
}

.login-sheet-panel h2 {
  margin: 4px 0 8px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.18;
}

.login-sheet-copy,
.login-sheet-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
}

.login-sheet-note a {
  color: #197fd5;
  text-decoration: none;
}

.username-login-form {
  display: grid;
  gap: 8px;
  margin: 18px 0 12px;
}

.username-login-form[hidden] { display: none !important; }

.username-login-form label {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.account-input-wrap {
  display: flex;
  align-items: center;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(139, 190, 231, 0.52);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.account-input-wrap:focus-within {
  border-color: #3096ed;
  box-shadow: 0 0 0 3px rgba(48, 150, 237, 0.11);
}

.username-login-form input {
  min-width: 0;
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.register-only {
  display: none;
  gap: 8px;
}

.username-login-form[data-mode="register"] .register-only {
  display: grid;
}

.account-login-message {
  min-height: 20px;
  margin: 1px 2px 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.account-login-message.error { color: #d04458; }
.account-login-message.success { color: #168a67; }

.account-login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, #50baff, #2387ea);
  box-shadow: 0 14px 30px rgba(35, 135, 234, 0.23);
  font-size: 15px;
  font-weight: 900;
}

.account-login-submit:disabled { opacity: 0.68; }

.auth-mode-switch {
  width: 100%;
  min-height: 38px;
  border: 0;
  color: #217fc9;
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.account-support-link {
  display: block;
  width: fit-content;
  margin: -4px auto 2px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.account-support-link:hover,
.account-support-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-login-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
  padding: 15px;
  border: 1px solid rgba(76, 180, 143, 0.25);
  border-radius: 18px;
  background: rgba(234, 251, 245, 0.84);
}

.account-login-success[hidden] { display: none !important; }

.account-login-success div {
  display: grid;
  gap: 3px;
}

.account-login-success small,
.account-login-success span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
}

.account-login-success b {
  color: var(--text-primary);
  font-size: 18px;
}

.account-login-success button {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(122, 169, 201, 0.34);
  border-radius: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 850;
}

.login-methods {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.login-method {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  text-align: left;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(156, 207, 247, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.login-method b {
  font-size: 15px;
}

.login-method span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.test-login-only {
  display: none;
}

.test-login-enabled .test-login-only {
  display: grid;
}

.test-login-method {
  background: rgba(239, 248, 255, 0.9);
  border-color: rgba(80, 165, 230, 0.38);
}

.primary-method {
  color: white;
  background: linear-gradient(135deg, #54bdff, #2489ee);
  box-shadow: 0 14px 34px rgba(38, 139, 230, 0.2);
}

.primary-method span {
  color: rgba(255, 255, 255, 0.82);
}

.paywall-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  margin: 2px 0 12px;
}

.paywall-benefits span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.paywall-benefits span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #86d8ff, #2f97ec);
  box-shadow: 0 5px 10px rgba(47, 151, 236, 0.16);
}

.member-boundary {
  display: grid;
  gap: 8px;
}

.member-boundary article {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(125, 163, 196, 0.18);
}

.member-boundary b {
  position: relative;
  padding-inline-start: 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.member-boundary b::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--accent);
}

.member-boundary .ready b::before { background: #00a870; }
.member-boundary .pending b::before { background: #f59e0b; }
.member-boundary .future b::before { background: var(--primary-blue); }

.member-boundary span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-file-grid article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.profile-file-grid small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-file-grid b {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-file-grid .profile-cycle-value {
  display: grid;
  gap: 2px;
  overflow-wrap: normal;
}

.profile-cycle-pillar {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.profile-cycle-range {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.settings-list { display: grid; gap: 8px; }

.settings-list article {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: transform 0.15s;
}
.settings-list article:hover { transform: translateX(2px); }

.settings-list b {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.settings-list span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.full-report-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 4px;
}

.full-report-action {
  min-width: 0;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 17px;
  border: 1px solid rgba(132, 187, 232, 0.42);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(81, 135, 177, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.full-report-action.primary {
  border-color: rgba(43, 146, 235, 0.5);
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 255, 255, 0.88) 0 34px, transparent 35px),
    linear-gradient(145deg, rgba(241, 250, 255, 0.99), rgba(215, 239, 255, 0.94));
}

.full-report-action:hover:not(.disabled):not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(43, 146, 235, 0.72);
  box-shadow: 0 11px 26px rgba(61, 143, 211, 0.14);
}

.full-report-action span {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.full-report-action b {
  color: #153554;
  font-size: 17px;
  font-weight: 750;
}

.full-report-action small {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #526f88;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.full-report-action em {
  color: #1873c5;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.45;
}

.full-report-action i {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(43, 146, 235, 0.11);
  color: #2387dd;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

.full-report-action.disabled,
.full-report-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 360px) {
  .full-report-action { min-height: 92px; padding: 15px 14px; }
}

/* ── Bottom Tabs ── */
.tabs {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-block-start: 12px;
  padding: 8px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: var(--blur-glass);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.94),
    0 -4px 24px rgba(54, 129, 196, 0.05),
    0 16px 40px rgba(52, 142, 213, 0.12);
  z-index: 999;
  border: 1px solid var(--border-glass);
}

.tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 22px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tabs .active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(232, 248, 255, 0.96), rgba(214, 239, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 22px rgba(47, 151, 236, 0.13);
  transform: translateY(-1px);
}

.tabs .tab-icon {
  font-size: 18px;
  line-height: 1;
}

.tabs .tab-icon-trend {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.tabs .tab-icon-trend svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Loading / Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.hero.loading .score span,
.hero.loading h1,
.hero.loading p,
.hero.loading .eyebrow {
  color: transparent;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  animation: pulse 1.5s ease-in-out infinite;
  user-select: none;
}

.hero.loading .index-orb i {
  animation: orbLoadingPulse 1.4s ease-in-out infinite;
}

@keyframes orbLoadingPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.96); }
  50% { opacity: 0.75; transform: scale(1.02); }
}

/* ── Animations ── */
@keyframes float {
  from { transform: translateY(4px) scale(0.98); }
  to { transform: translateY(-4px) scale(1.02); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
  from { stroke-dashoffset: var(--line-length, 1000); }
  to { stroke-dashoffset: 0; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(251, 191, 36, 0.4), 0 0 60px rgba(251, 191, 36, 0.15); }
  50% { box-shadow: 0 8px 32px rgba(251, 191, 36, 0.5), 0 0 80px rgba(251, 191, 36, 0.25); }
}

.index-orb i { animation: orbPulse 3s ease-in-out infinite; }

/* ── Element Bars ── */
.element-bars {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.element-bar-row {
  display: grid;
  grid-template-columns: 50px 1fr 30px;
  align-items: center;
  gap: 10px;
}

.element-bar-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.element-bar-track {
  height: 8px;
  background: var(--slate-200);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.element-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.element-bar-fill.wood { background: var(--el-wood); }
.element-bar-fill.fire { background: var(--el-fire); }
.element-bar-fill.earth { background: var(--el-earth); }
.element-bar-fill.metal { background: var(--el-metal); }
.element-bar-fill.water { background: var(--el-water); }

.element-bar-row span {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  text-align: right;
}

/* ── Birth Detail Advice ── */
.birth-detail-advice {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--border-glass);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ── Dynamic Orbs ── */
.mini-orb.wood i { background: linear-gradient(135deg, #a7f3d0, #10b981); box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3); }
.mini-orb.fire i { background: linear-gradient(135deg, #ffedd5, #f97316); box-shadow: 0 6px 24px rgba(249, 115, 22, 0.3); }
.mini-orb.earth i { background: linear-gradient(135deg, #fef9c3, #eab308); box-shadow: 0 6px 24px rgba(234, 179, 8, 0.3); }
.mini-orb.metal i { background: linear-gradient(135deg, #f3e8ff, #a855f7); box-shadow: 0 6px 24px rgba(168, 85, 247, 0.3); }
.mini-orb.water i { background: linear-gradient(135deg, #dbeafe, #3b82f6); box-shadow: 0 6px 24px rgba(59, 130, 246, 0.3); }

/* ── Responsive ── */
@media (max-width: 390px), (max-height: 700px) {
  .stage { padding: 10px; }

  .phone {
    height: calc(100vh - 20px);
    min-height: 0;
    border-radius: 36px;
    padding: 12px;
  }

  .hero {
    min-height: 200px;
    border-radius: var(--radius-lg);
  }

  .card {
    padding: 14px;
    border-radius: 18px;
  }

  .page[data-page="kline"] .metric-grid { gap: 6px; }
  .page[data-page="kline"] .metric-grid article { padding: 8px 4px; }

  .tabs {
    margin-block-start: 8px;
    padding: 6px;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 360px) {
  .profile-file-grid { grid-template-columns: 1fr; }
  .forecast-heading h2 { font-size: 19px; }
  .forecast-swipe-hint { padding-inline: 7px; }
  .days { grid-auto-columns: 78px; gap: 7px; }
  .days div { min-height: 168px; gap: 6px; padding: 11px 7px; border-radius: 14px; }
  .days small { font-size: 9px; max-width: none; }
  .days span { font-size: 14px; }
  .days b { font-size: 19px; }
  .days em { font-size: 8px; }
  .days .year-trend-icon { width: 32px; height: 32px; min-height: 32px; font-size: 12px; }
}

@media (max-width: 320px) {
  .plan-list { gap: 4px; }
  .plan-item { padding: 9px 3px; border-radius: 12px; }
  .plan-item b { font-size: 10px; }
  .plan-item span { font-size: 14px; }
  .plan-item small { font-size: 10px; }
  .membership-promo { padding: 13px; }
  .membership-promo h3 { font-size: 14px; }
  .membership-promo p { font-size: 11px; }
}

/* ── Share Modal & Trigger ── */
.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2px;
}

.share-trigger-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 99px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.share-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.share-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
}

.share-modal-content {
  position: relative;
  width: min(390px, 92%);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-glass);
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-modal.active .share-modal-content {
  transform: translateY(0);
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.share-modal-header .close-btn {
  background: var(--slate-200);
  border: none;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.share-modal-header .close-btn:hover {
  background: var(--slate-300);
}

.share-canvas-container {
  width: 100%;
  aspect-ratio: 375 / 600;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--slate-200);
}

.share-preview-loading {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
  animation: pulse 1.5s infinite;
}

.share-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 700;
}

#downloadShareBtn {
  margin-top: 4px;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 900;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.24);
  transition: all 0.2s;
}

#downloadShareBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.36);
}

/* ── Checkin & Diary Card Styles ── */
.checkin-card {
  transition: transform 0.25s ease, border-color 0.25s ease;
  border: 1px solid var(--border-glass);
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.checkin-score-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkin-score-row label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.checkin-score-row label b {
  color: var(--indigo-500);
  font-size: 16px;
  margin-inline: 4px;
}

#checkinNoteInput {
  width: 100%;
  height: 74px;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  resize: none;
  transition: border-color 0.2s;
}

#checkinNoteInput:focus {
  outline: none;
  border-color: var(--indigo-400);
  background: #ffffff;
}

.checkin-history-card {
  margin-top: 18px;
}

.checkin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.checkin-item {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.checkin-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkin-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.checkin-score-badge {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--indigo-500), var(--sky-500));
  padding: 2px 8px;
  border-radius: 99px;
}

.checkin-text {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.4;
  padding-right: 32px;
}

.checkin-del-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--rose-500);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.checkin-del-btn:hover {
  opacity: 1;
  background: rgba(244, 63, 94, 0.1);
}

.chart-legend-dot.checkin-dot {
  background: transparent;
  border: 2px dashed var(--indigo-500);
  border-radius: 0;
  width: 10px;
  height: 2px;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 16px 0;
  font-weight: 700;
}

/*
 * 想法记录/打卡这一套不属于人生K线 H5，继续隐藏。
 * 「未来7年流年」原本也在这份隐藏名单里——它当时渲染的是七天天气图标，
 * 藏起来是对的。现在它取的是百年K线里接下来七年的流年干支与指数，
 * 属于「查看四柱命盘、大运和流年」这条主流程，放出来。
 */
.page[data-page="kline"] .flow-receipt-card,
.page[data-page="kline"] .flow-peek-button,
.checkin-history-card {
  display: none !important;
}

.page.active .card,
.page.active .hero {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Full 100-year H5 chart and complete birth-chart details. */
.page[data-page="kline"] .chart svg {
  height: 252px;
}

.page[data-page="kline"] .candle-wick {
  stroke-width: 0.75;
}

.page[data-page="kline"] .candle-body {
  stroke-width: 0.65;
  rx: 0.8;
}

.page[data-page="kline"] .years {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.page[data-page="kline"] .years span {
  text-align: center;
  white-space: nowrap;
}

.decade-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 42%);
  grid-template-columns: none;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
  padding-block-end: 4px;
}

.decade-strip::-webkit-scrollbar {
  display: none;
}

.decade-strip article {
  scroll-snap-align: start;
}

.bazi-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-block-start: 10px;
}

.bazi-facts article {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.bazi-facts small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.bazi-facts b {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.bazi-analysis-text {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.65;
}

.calculation-method-card header {
  align-items: flex-start;
}

.calculation-method-card header strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 999px;
  color: #2563eb;
  background: rgba(219, 234, 254, 0.58);
  font-size: 10px;
  white-space: nowrap;
}

.calculation-method-list {
  display: grid;
  gap: 7px;
  margin-block-start: 12px;
}

.calculation-method-list article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(172, 210, 242, 0.58);
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.78);
}

.calculation-method-list small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.calculation-method-list b {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.5;
}

.calculation-method-note {
  margin: 10px 2px 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.6;
}

/* ══ 手机端 2x2 八字概要网格 ══ */
.bazi-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.bazi-grid-cell {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(172, 210, 242, 0.68);
  box-shadow: 0 4px 14px rgba(31, 84, 143, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bazi-grid-cell small {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.bazi-grid-cell b {
  font-size: 15px;
  color: #1e3a8a;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.25;
  letter-spacing: 0;
}

@media (max-width: 360px) {
  .bazi-grid-cell {
    padding: 10px 10px;
  }

  .bazi-grid-cell b {
    font-size: 13px;
  }
}

/* ══ 详细运势解读区域 ══ */
.fortune-breakdown-card {
  margin: 14px 0;
  padding: 18px;
}

.ai-deep-action {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 18px;
  overflow: hidden;
  border-color: rgba(190, 65, 54, 0.24);
  background:
    radial-gradient(circle at 92% 12%, rgba(225, 177, 80, 0.20), transparent 34%),
    linear-gradient(145deg, rgba(255, 251, 243, 0.98), rgba(255, 239, 232, 0.94));
  box-shadow: 0 16px 38px rgba(126, 63, 46, 0.10);
}

.ai-deep-action[hidden] { display: none !important; }

.ai-deep-action-copy { min-width: 0; }

.ai-deep-action-copy > span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #9d2d25;
  background: rgba(181, 55, 45, 0.09);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.ai-deep-action h2 {
  margin: 7px 0 4px;
  color: var(--text-primary);
  font-size: 18px;
}

.ai-deep-action p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.ai-deep-action p.is-success { color: #21704f; }
.ai-deep-action p.is-error { color: #b13d35; }
.ai-deep-action p.is-loading { color: #8c5d19; }

.ai-deep-action > button {
  min-width: 132px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(150, 36, 29, 0.18);
  border-radius: 15px;
  color: #fffaf2;
  background: linear-gradient(145deg, #c34a3e, #9e2f28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 9px 20px rgba(159, 46, 39, 0.19);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.ai-deep-action > button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.ai-deep-action.is-busy > button { cursor: progress; }

body.ai-consent-open { overflow: hidden; }

.ai-consent-sheet {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.ai-consent-sheet.show { display: flex; }

.ai-consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 29, 25, 0.34);
  backdrop-filter: blur(10px);
}

.ai-consent-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  border: 1px solid rgba(190, 65, 54, 0.20);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 8%, rgba(229, 183, 91, 0.24), transparent 32%),
    linear-gradient(155deg, #fffdf8, #fff0e9);
  box-shadow: 0 30px 90px rgba(61, 29, 23, 0.30);
}

.ai-consent-close {
  position: sticky;
  float: right;
  top: 0;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #9b5149;
  background: rgba(181, 55, 45, 0.09);
  font-size: 24px;
  line-height: 1;
}

.ai-consent-panel h2 {
  margin: 5px 0 8px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.2;
}

.ai-consent-lead,
.ai-consent-private,
.ai-consent-quota {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.ai-consent-data {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  padding: 0;
  list-style: none;
}

.ai-consent-data li {
  position: relative;
  padding: 11px 12px 11px 36px;
  border: 1px solid rgba(190, 65, 54, 0.14);
  border-radius: 14px;
  color: #3e302d;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.ai-consent-data li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  top: 11px;
  color: #b33c33;
  font-weight: 900;
}

.ai-consent-private {
  margin-top: 13px;
  color: #27465e;
}

.ai-consent-quota {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #7e5416;
  background: rgba(226, 178, 80, 0.13);
}

.ai-consent-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
  margin-top: 18px;
}

.ai-consent-actions button {
  min-height: 46px;
  margin: 0;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 850;
}

.ai-consent-actions .ghost {
  border: 1px solid rgba(128, 93, 82, 0.20);
  color: #6e554e;
  background: rgba(255,255,255,0.68);
}

.ai-consent-actions .primary {
  border: 1px solid rgba(150, 36, 29, 0.18);
  color: #fffaf2;
  background: linear-gradient(145deg, #c34a3e, #9e2f28);
  box-shadow: 0 10px 22px rgba(159, 46, 39, 0.20);
}

@media (max-width: 380px) {
  .ai-deep-action { grid-template-columns: 1fr; }
  .ai-deep-action > button { width: 100%; }
  .ai-consent-sheet { padding: 10px; }
  .ai-consent-panel { padding: 18px; border-radius: 24px; }
  .ai-consent-actions { grid-template-columns: 1fr; }
}

.fortune-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.fortune-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 252, 255, 0.85);
  border: 1px solid rgba(172, 210, 242, 0.65);
}

.fortune-item.main-summary {
  background: linear-gradient(135deg, rgba(238, 247, 255, 0.95), rgba(219, 239, 255, 0.75));
  border-color: rgba(147, 197, 253, 0.85);
}

.fortune-item h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: #1e3a8a;
}

.fortune-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #2563eb;
}

.fortune-item p {
  margin: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.7;
  font-weight: 500;
  white-space: pre-line;
}

.score span,
.years,
.bazi-facts b,
#flowScore,
#currentAge,
#profileScore,
.ohlc-item b {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
}

.fortune-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 480px) {
  .fortune-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ══ 100年微缩时间轴与滑动窗口 ══ */
.mini-timeline-container {
  margin: 14px 0 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(241, 248, 255, 0.88);
  border: 1px solid rgba(172, 210, 242, 0.75);
}

.mini-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}

.mini-timeline-head span {
  color: #64748b;
  font-weight: 700;
}

.mini-timeline-head b {
  color: #4f7290;
  font-weight: 800;
}

.mini-timeline-track {
  position: relative;
  height: 38px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(172, 210, 242, 0.65);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.mini-timeline-track svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mini-window-slider {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 11%;
  background: rgba(79, 181, 255, 0.18);
  border: 1.5px solid #68bdf6;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(79, 181, 255, 0.24);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.1s ease-out;
}

.mini-window-slider:active {
  cursor: grabbing;
  background: rgba(79, 181, 255, 0.28);
}

.mini-slider-text {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #68bdf6;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(220, 244, 255, 0.98), rgba(168, 222, 255, 0.94));
  box-shadow: 0 4px 9px rgba(79, 181, 255, 0.18);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: #1f6fa9;
  white-space: nowrap;
  pointer-events: none;
}

.mini-window-slider.at-start {
  justify-content: flex-start;
}

.mini-window-slider.at-end {
  justify-content: flex-end;
}

/* 主图边沿越界指示器 */
.edge-indicator {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.edge-indicator:hover {
  transform: scale(1.08);
}


/* ── 同步冲突后保留的本机草稿 ── */
.conflict-draft {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(194, 51, 77, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 241, 243, 0.92);
}

.conflict-draft p {
  margin: 0 0 10px;
  color: #a32340;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}

.conflict-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.conflict-draft-actions button {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: #c2334d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.conflict-draft-actions button.ghost {
  background: rgba(194, 51, 77, 0.12);
  color: #a32340;
}

/*
  出生地那一行的说明文字。它和「出生小时」下面的时辰提示不一样：
  时辰提示是绝对定位挂在输入框下方的，这一行是普通流内元素——
  出生地在表单最后一行，不需要为对齐上下两列而脱离文档流。
*/
.setup-form .setup-place small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════════════════════
   YEEX UI readability pass v3
   Refined editorial blue, restrained glass, mobile-first type and spacing.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-number: "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --text-primary: #10263d;
  --text-secondary: #526c83;
  --text-muted: #5f7890;
  --text-accent: #146cc1;
  --accent: #2f97ec;
  --accent-soft: #e9f5fd;
  --surface: #ffffff;
  --surface-soft: #f4f9fd;
  --stroke: #d6e5f0;
  --gold: #c58b19;
  --danger: #c23b55;
  --el-wood: #15803d;
  --el-fire: #c2410c;
  --el-earth: #854d0e;
  --el-metal: #8a6a1f;
  --el-water: #1d4ed8;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 26px;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}

.app-scroll {
  scroll-padding-block: 18px 96px;
  padding-block-end: calc(26px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.brand-subtitle,
.status-state,
.live-hint span {
  font-size: 12px;
  font-weight: 600;
}

.card {
  padding: 16px;
  border-color: rgba(214, 229, 240, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 26px rgba(27, 82, 126, 0.075);
}

.card header h2,
.card > h2 {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card p,
.bazi-analysis-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
}

.hero,
.profile-hero,
.birth-hero {
  background:
    radial-gradient(circle at 86% 21%, rgba(255, 218, 100, 0.72) 0 9%, rgba(255, 218, 100, 0.16) 10% 24%, transparent 25%),
    linear-gradient(145deg, #1b78bc 0%, #1769ad 52%, #164f91 100%);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 14px 34px rgba(19, 79, 130, 0.2);
}

.hero h1,
.profile-hero h2,
.birth-hero h2 {
  color: #fff;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
}

.hero p,
.profile-hero p,
.birth-hero p {
  color: rgba(255, 255, 255, 0.93);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
}

.hero .eyebrow,
.hero-mini-stats span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
}

.score span {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.score b,
.score .score-level {
  font-weight: 650;
}

.share-trigger-btn,
.hero button,
.full-report-action,
.tabs a,
button.primary,
button.ghost {
  min-height: 44px;
}

.share-trigger-btn {
  padding-inline: 14px;
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
  background: rgba(7, 48, 86, 0.22);
  font-size: 12px;
  font-weight: 600;
}

.metric-grid {
  gap: 10px;
}

.metric-grid article {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 16px rgba(27, 82, 126, 0.055);
}

.metric-grid span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.metric-grid b {
  color: var(--text-primary);
  font-weight: 700;
}

.bazi-facts small,
.bazi-grid-cell small,
.calculation-method-list small,
.calculation-method-note,
.full-report-action small,
.hidden-stems small,
.setup-form .setup-place small,
.mini-timeline-head,
.life-range-summary small,
.life-range-summary span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.bazi-facts b,
.calculation-method-list b,
.full-report-action b,
.bazi-grid-cell b {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
}

.calculation-method-card header strong {
  color: var(--text-accent);
  border-color: rgba(20, 108, 193, 0.22);
  background: #edf6fd;
  font-size: 12px;
  font-weight: 650;
}

.calculation-method-list article,
.bazi-facts article,
.bazi-grid-cell,
.fortune-item {
  border-color: var(--stroke);
  background: var(--surface-soft);
  box-shadow: none;
}

.fortune-item h3,
.fortune-item h4 {
  color: var(--text-primary);
  font-weight: 700;
}

.fortune-item h3 { font-size: 15px; }
.fortune-item h4 { font-size: 14px; }

.fortune-item p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 500;
}

.full-report-action {
  border-color: var(--stroke);
  background: var(--surface-soft);
}

.full-report-action span {
  color: var(--text-brand, #146cc1);
}

.full-report-action small {
  opacity: 1;
}

.page[data-page="kline"] .years {
  display: flex;
  grid-template-columns: none;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 6px;
  font-size: 11px;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
}

.page[data-page="kline"] .years::-webkit-scrollbar { display: none; }

.page[data-page="kline"] .years span {
  flex: 0 0 48px;
  min-width: 48px;
  padding: 4px 2px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-weight: 600;
  scroll-snap-align: center;
}

.chart-axis-label,
.pred-label,
.cycle-band-label,
.extreme-marker text {
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 600;
  fill: #526c83;
}

.cycle-band-label { font-size: 9px; }
.chart-legend { color: var(--text-secondary); font-size: 12px; }

.life-range-summary b,
.year-detail-card header b,
.ohlc-item b {
  font-family: var(--font-number);
  color: var(--text-primary);
  font-weight: 700;
}

.year-jump {
  gap: 8px;
  scrollbar-width: none;
}

.year-jump::-webkit-scrollbar { display: none; }
.year-jump button { min-height: 56px; }
.year-jump button b { font-size: 13px; font-weight: 650; }
.year-jump button small { font-size: 11px; font-weight: 500; }

.year-detail-card header span,
.year-detail-card p,
.ohlc-item small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
}

.mini-timeline-container {
  padding: 10px;
  border-color: var(--stroke);
  background: var(--surface-soft);
}

.mini-timeline-head b {
  color: var(--text-secondary);
  font-weight: 650;
}

.mini-slider-text {
  color: #155f99;
  font-size: 10px;
  font-weight: 700;
}

.tabs {
  border-color: rgba(214, 229, 240, 0.88);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(27, 82, 126, 0.11);
}

.tabs a {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.tabs .active {
  color: #146cc1;
  background: #e7f4fd;
}

.tabs .tab-icon { color: inherit; }

@media (max-width: 480px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .stage {
    height: 100dvh;
    min-height: 0;
    padding: 0;
  }

  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
  }
}

@media (max-width: 360px) {
  .phone {
    padding: 8px;
  }

  .app-scroll {
    padding-block-end: calc(22px + env(safe-area-inset-bottom));
  }

  .card {
    padding: 12px;
    border-radius: 16px;
  }

  .hero {
    padding: 14px;
    border-radius: 18px;
  }

  .hero h1,
  .profile-hero h2,
  .birth-hero h2 {
    font-size: 20px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid article {
    min-height: 82px;
    padding: 12px;
  }

  .page[data-page="kline"] .chart svg {
    min-height: 240px;
  }

  .mini-timeline-track { height: 32px; }
  .fortune-breakdown-card { padding: 12px; }
}

/* Hero facts and complete year navigator v4. */
.hero-mini-stats {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(92px, 0.85fr);
  width: min(100%, 244px);
  gap: 8px;
  margin: 2px 0 9px;
}

.hero-mini-stats span {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.14);
  text-align: left;
}

.hero-mini-stats small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
}

.hero-mini-stats b {
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
  word-break: keep-all;
  overflow-wrap: normal;
}

#heroMindValue {
  display: grid;
  gap: 1px;
}

#heroMindValue .pillar-pair-line {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  white-space: nowrap;
  text-align: left;
}

.year-jump {
  position: relative;
  gap: 8px;
  padding: 4px calc(50% - 38px) 9px;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.year-jump::-webkit-scrollbar { display: none; }

.year-jump button {
  flex: 0 0 76px;
  width: 76px;
  min-width: 76px;
  min-height: 64px;
  padding: 8px 5px;
  border-color: var(--stroke);
  border-radius: 14px;
  background: #f7fbfe;
  scroll-snap-align: center;
  cursor: pointer;
}

.year-jump button b {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.year-jump button small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.year-jump button.current {
  border-color: rgba(20, 108, 193, 0.42);
  background: #edf7fe;
}

.year-jump button.active {
  border-color: #1769aa;
  background: #1769aa;
  box-shadow: 0 8px 18px rgba(23, 105, 170, 0.22);
}

.year-jump button.active b,
.year-jump button.active small { color: #fff; }

.year-detail-card header b.member-lock-badge {
  min-width: 54px;
  padding: 5px 12px;
  border: 1px solid #e5b940;
  background: linear-gradient(135deg, #9f201b 0%, #d04435 52%, #a7201a 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 174, 0.42),
    0 6px 14px rgba(166, 41, 29, 0.24),
    0 0 0 2px rgba(229, 185, 64, 0.09);
  text-shadow: 0 1px 1px rgba(106, 20, 15, 0.5);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 360px) {
  .page[data-page="kline"] #heroSection .hero-copy { max-width: 100%; }
  .hero-mini-stats { width: calc(100% - 58px); grid-template-columns: minmax(0, 1.35fr) minmax(88px, .9fr); }
  .hero-mini-stats span { padding-inline: 8px; }
  .hero-mini-stats b { font-size: 11px; }
}

/* 云端会员卡：朱砂红主视觉，鎏金保留在边缘和主要操作。 */
.membership-promo {
  border-color: rgba(239, 193, 83, 0.72);
  background:
    radial-gradient(circle at 91% 4%, rgba(255, 217, 111, 0.28), transparent 31%),
    linear-gradient(145deg, #991f1a 0%, #c83b30 52%, #a6221c 100%);
  box-shadow:
    0 14px 32px rgba(160, 38, 29, 0.2),
    inset 0 1px 0 rgba(255, 237, 181, 0.32);
}

.membership-promo::after {
  border-color: rgba(255, 218, 116, 0.28);
}

.membership-promo-mark {
  border-color: rgba(255, 225, 139, 0.58);
  background: linear-gradient(145deg, #ffe9a8, #dfae3e);
  box-shadow: 0 5px 12px rgba(104, 25, 17, 0.2);
}

.membership-promo-mark path { stroke: #982018; }

.membership-promo-kicker {
  color: #ffe7a3;
  font-size: 12px;
  font-weight: 700;
}

.membership-promo h3 {
  color: #fff;
  font-weight: 700;
}

.membership-promo p,
.membership-promo-footer small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 500;
}

.membership-promo-footer {
  border-top-color: rgba(255, 226, 143, 0.3);
}

.membership-promo-button {
  min-height: 44px;
  border-color: rgba(255, 232, 164, 0.72);
  background: linear-gradient(135deg, #f7d77d, #d6a537);
  color: #693e0c;
  box-shadow:
    0 8px 18px rgba(100, 28, 16, 0.22),
    inset 0 1px 0 rgba(255, 249, 220, 0.84);
  font-size: 13px;
  font-weight: 700;
}

.membership-promo-button i {
  background: rgba(255, 249, 220, 0.36);
}
