/* 我们的小世界 · 基础样式
 * 基础：变量 / reset / 布局 / 导航 / 按钮 / 通用展示区块
 * 由 index.html 内联样式拆分而来，规则顺序与原文件完全一致（样式优先级不变）。
 */
:root {
  --bg: #F6EFE7; --card: #FFFDF9; --primary: #C97B63; --primary-deep: #A85E48;
  --sage: #8BA888; --lavender: #B8A5C9; --text: #3E3430; --muted: #8A7E77;
  --line: #E5D8C8; --warm: #E8B4A0; --danger: #B06060;

  /* 语义扩展层：把原先散落的硬编码色收敛成变量，深色模式只需覆盖这一层 */
  --on-primary: #FFFDF9;   /* 主色按钮上的文字 */
  --surface-2: #FFF;       /* 卡片内的次级白底（输入框、列表项） */
  --soft-warm: #FDF4EE;    /* 浅暖底 */
  --soft-warm-2: #F9E8DC;
  --soft-lavender: #F4EFF8;
  --soft-lavender-2: #EDE4F5;
  --soft-green: #EEF3EE;
  --soft-red: #FBEDED;
  --soft-gold-a: #F5D5A5;
  --soft-gold-b: #D4A050;
  --ink-purple: #6B5A80;   /* 紫底上的深字 */
  --ink-green: #4F6B4C;
  --ink-red: #8B4040;
  --soft-red-2: #F9D5D5;
  --lavender-soft-a: #C8B8D8;
  --soft-lavender-3: #E4DCEF;
  --warm-soft-a: #F0D4B8;
  --overlay-solid: #000;
  /* 他 / 她的身份色。
     原先全产品用了两套完全不同的配色：首页趋势图是蓝粉(#5B8FD6/#E88AA8)，
     日记温度曲线和 TA 的温度点却是珊瑚薰衣草(#C97B63/#B8A5C9)。
     同一个"他/她"三套颜色，视觉上是断裂的。这里统一成一套并变量化。 */
  --who-he: #C97B63;
  --who-she: #B8A5C9;
  --faint: #B8A5A5;          /* 未解锁/锁定态的灰 */
  --heat-0: #F0E8DC;         /* 年度热力图梯度：无记录 */
  --heat-1: #F5D5C5;
  --heat-2: #E0A98F;
  --heat-3: #D48A70;
  --heat-4: #B85E48;
  --shadow: rgba(62,52,48,0.08);
  --overlay: rgba(62,52,48,0.45);
  /* 页面背景的两层柔光，深色下需要换成更暗的色调 */
  --glow-a: rgba(201,123,99,0.10);
  --glow-b: rgba(184,165,201,0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 400; line-height: 1.7; -webkit-font-smoothing: antialiased; touch-action: manipulation; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 20% 0%, var(--glow-a), transparent 50%), radial-gradient(ellipse at 100% 100%, var(--glow-b), transparent 50%), var(--bg); }
.app { max-width: 480px; margin: 0 auto; padding: 24px 22px 100px; min-height: 100vh; min-height: 100dvh; position: relative; }
.serif { font-family: "Noto Serif SC", serif; }
.screen { display: none; animation: fadeIn 0.25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.brand { font-family: "Noto Serif SC", serif; font-size: 18px; font-weight: 600; color: var(--primary-deep); letter-spacing: 1px; }
.quit { font-size: 14px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 12px 14px; min-height: 44px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card);
  border-top: 1.5px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  transition: transform 0.3s ease;
}
.bottom-nav.hidden { transform: translateX(-50%) translateY(100%); }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 11px; color: var(--muted);
  padding: 6px 0;
}
.nav-item.active { color: var(--primary-deep); }
.nav-item .icon { font-size: 22px; line-height: 1; }
/* 五个 tab 时每项约 75px（iPhone SE 这类窄屏），字号略收，避免文字折行 */
@media (max-width: 380px){
  .nav-item { font-size: 10px; letter-spacing: -0.2px; }
  .nav-item .icon { font-size: 19px; }
}

.back-btn {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 16px;
  z-index: 60;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 100px; padding: 8px 16px;
  font-family: inherit; font-size: 14px; color: var(--muted);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(62,52,48,0.08);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.back-btn.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.btn { display: block; width: 100%; padding: 16px 20px; border-radius: 20px; border: none; font-family: inherit; font-size: 16px; cursor: pointer; transition: transform 0.1s, opacity 0.15s; text-align: center; }
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: var(--on-primary); box-shadow: 0 8px 24px rgba(201,123,99,0.3); font-weight: 500; }
.btn-ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost.warn { border-color: rgba(184,165,201,0.5); color: var(--ink-purple); }
.btn-ghost.stubborn { border-color: rgba(139,168,136,0.5); color: var(--ink-green); }
.btn-ghost.calm { border-color: rgba(201,123,99,0.4); color: var(--primary-deep); }
.btn-label { font-size: 16px; font-weight: 500; display: block; }
.btn-sub { font-size: 13px; opacity: 0.75; margin-top: 4px; font-weight: 300; display: block; }

.section-block { background: var(--card); border-radius: 18px; padding: 18px; margin: 14px 0; }
.section-block h4 { margin: 0 0 12px; font-size: 15px; color: var(--primary-deep); font-weight: 600; }
.section-block h4 .sub { font-weight: 300; color: var(--muted); font-size: 13px; }

.hero-stats { text-align: center; margin-bottom: 16px; }
.hero-stats .big { font-family: "Noto Serif SC", serif; font-size: 26px; color: var(--primary-deep); }
.hero-stats .small { font-size: 13px; color: var(--muted); }
.streak-badge { display: inline-block; margin-top: 6px; padding: 4px 14px; border-radius: 100px; background: linear-gradient(135deg, var(--warm), var(--primary)); color: var(--surface-2); font-size: 13px; font-weight: 500; }

.daily-quote { background: linear-gradient(135deg, var(--soft-warm), var(--soft-warm-2)); border-radius: 18px; padding: 20px; margin: 14px 0; text-align: center; }
.daily-quote .q { font-family: "Noto Serif SC", serif; font-size: 17px; line-height: 1.9; color: var(--primary-deep); }
.daily-quote .tag { font-size: 12px; color: var(--muted); margin-top: 8px; }

.warning-banner { background: linear-gradient(135deg, var(--soft-red), var(--soft-red-2)); border-radius: 16px; padding: 14px 18px; margin: 14px 0; border-left: 3px solid var(--danger); }
.warning-banner .w-title { font-size: 14px; font-weight: 500; color: var(--danger); margin-bottom: 4px; }
.warning-banner .w-text { font-size: 13px; color: var(--ink-red); line-height: 1.7; }
.warning-banner .w-action { margin-top: 8px; font-size: 13px; color: var(--primary-deep); cursor: pointer; }
.warning-banner.soft { background: linear-gradient(135deg, var(--soft-lavender), var(--soft-lavender-2)); border-left-color: var(--lavender); }
.warning-banner.soft .w-title { color: var(--ink-purple); }
.warning-banner.soft .w-text { color: var(--ink-purple); }

.coin-orb { width: 90px; height: 90px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--soft-gold-a), var(--soft-gold-b) 75%); box-shadow: 0 8px 24px rgba(212,160,80,0.35); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--surface-2); }
.coin-orb .num { font-family: "Noto Serif SC", serif; font-size: 32px; line-height: 1; }
.coin-orb .lbl { font-size: 11px; margin-top: 2px; }
.coin-priv { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 10px; }
.coin-priv .locked { color: var(--faint); }
.coin-priv .unlocked { color: var(--sage); font-weight: 500; }

.compare-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: none; }
.compare-row .lbl { font-size: 13px; color: var(--muted); }
.compare-row .vals { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.compare-row .old { color: var(--muted); text-decoration: line-through; }
.compare-row .arrow { color: var(--muted); }
.compare-row .new { font-weight: 600; color: var(--sage); }
.compare-row .new.bad { color: var(--danger); }
