/* 小小陈学英语 · 自律版
 * 暖色治愈风:奶油底 + 焦糖橙 + 抹茶绿点缀
 * 字体:中文 Noto Sans SC,标题 ZCOOL KuaiLe(快乐体);英文 Quicksand / Sora
 */

:root {
  --bg:        #fffaf2;
  --bg-2:      #fdebd3;
  --paper:     #ffffff;
  --ink:       #3b2f25;
  --ink-2:     #7a6655;
  --line:      #f0d8b8;
  --primary:   #e08a4f;        /* 焦糖橙 */
  --primary-2: #c66b2f;
  --accent:    #7ab07a;        /* 抹茶绿 */
  --danger:    #d96666;
  --good:      #6fae6f;
  --shadow:    0 10px 30px -12px rgba(170, 100, 50, 0.30);
  --shadow-sm: 0 4px 12px -6px rgba(170, 100, 50, 0.22);
  --radius:    20px;
  --max:       880px;
  --t-mono:    "Sora", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  --t-en:      "Quicksand", "Sora", -apple-system, "Segoe UI", sans-serif;
  --t-cn:      "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --t-fun:     "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--t-cn);
  font-weight: 500;
  background:
    radial-gradient(1200px 600px at 20% -10%, #ffe7c7 0%, transparent 60%),
    radial-gradient(800px 500px at 110% 10%, #f8d4b3 0%, transparent 60%),
    radial-gradient(700px 500px at -10% 90%, #fff1d6 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 顶栏 */
.app { max-width: var(--max); margin: 0 auto; padding: 0 16px 96px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6px; position: sticky; top: 0;
  background: linear-gradient(180deg, rgba(255,250,242,0.92), rgba(255,250,242,0.55));
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 10;
}
.topbar__brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--t-fun); font-weight: 400; font-size: 22px; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--primary) 0%, #d96b3a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar__logo { font-size: 24px; filter: drop-shadow(0 2px 4px rgba(224,138,79,0.4)); }
.topbar__name { letter-spacing: 1px; }
.nav { display: flex; gap: 2px; padding: 4px; background: rgba(255,255,255,0.5); border-radius: 999px; border: 1px solid var(--line); }
.nav__item {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav__item:hover { color: var(--ink); background: rgba(224, 138, 79, 0.1); }
.nav__item--active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 4px 12px -2px rgba(224, 138, 79, 0.5);
}

.tabbar { display: none; }

/* 视图 */
.view { padding: 12px 4px 24px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(224, 138, 79, 0.55);
}
.btn--primary:hover  { filter: brightness(1.05); box-shadow: 0 10px 22px -8px rgba(224, 138, 79, 0.65); }
.btn--primary:active { filter: brightness(0.95); }
.btn--ghost   { background: rgba(255,255,255,0.7); color: var(--ink-2); border: 1px solid var(--line); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: rgba(224, 138, 79, 0.08); color: var(--ink); border-color: var(--primary); }
.btn--danger  { background: linear-gradient(135deg, #e07575, #c75252); color: #fff; box-shadow: 0 6px 18px -6px rgba(217, 102, 102, 0.55); }
.btn--sm      { padding: 7px 14px; font-size: 13px; }
.btn--big     { padding: 15px 32px; font-size: 17px; font-family: var(--t-fun); letter-spacing: 2px; }

/* 输入 */
.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.input:hover, textarea.input:hover { border-color: rgba(224, 138, 79, 0.4); }
.input:focus, textarea.input:focus {
  outline: 0; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(224, 138, 79, 0.15);
}
.field { display: block; margin: 20px 0; }
.field__label { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.field__help  { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* Toast */
#toast-host { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: linear-gradient(135deg, rgba(59, 47, 37, 0.95), rgba(80, 60, 45, 0.95));
  color: #fff;
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; transform: translateY(-12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}
.toast--show { opacity: 1; transform: translateY(0) scale(1); }

/* ========== 首页 ========== */
.home__hello { padding: 8px 0 18px; }
.home__date { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.home__title {
  font-family: var(--t-fun);
  font-size: clamp(26px, 5.5vw, 34px); font-weight: 400;
  margin: 4px 0 6px; letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--primary), #d96b3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home__sub   { color: var(--ink-2); margin: 0; font-size: 14px; }

.home__streak {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px; background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 12px 0 18px;
  position: relative; overflow: hidden;
}
.home__streak::before {
  content: '🔥'; position: absolute; right: -6px; top: -8px;
  font-size: 60px; opacity: 0.18; transform: rotate(15deg);
}
.home__streakNum {
  font-family: var(--t-fun); font-weight: 400;
  font-size: 56px; line-height: 1; color: var(--primary);
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}
.home__streakLabel { color: var(--ink-2); font-weight: 600; }

.home__cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(170, 100, 50, 0.35); }
.card:hover::after { opacity: 1; }
.card__icon {
  font-size: 32px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff7e8, #ffe2c0);
  border-radius: 14px; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.card__body { flex: 1; min-width: 0; }
.card__title { font-size: 17px; font-weight: 700; }
.card__desc  { color: var(--ink-2); font-size: 13px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__progress { font-size: 12px; color: var(--primary-2); font-weight: 600; margin-top: 2px; }
.card__check { font-size: 22px; color: var(--ink-2); transition: transform 0.2s; }
.card--done .card__check { color: var(--good); transform: scale(1.15); }
.card--done { background: linear-gradient(180deg, #fffaf0, #f5ead4); }
.card--done .card__icon { background: linear-gradient(135deg, #d8e8d8, #b8d8b8); }

.home__totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.card--total {
  flex-direction: column; align-items: center;
  padding: 18px 4px;
  background: linear-gradient(180deg, #ffffff, #fff7e8);
}
.card__totalValue {
  font-family: var(--t-en); font-weight: 700;
  font-size: 26px; color: var(--primary);
  letter-spacing: -0.5px;
}
.card__totalLabel { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

.home__checkin {
  display: block; margin: 14px auto 0; min-width: 220px;
  animation: gentle-pulse 2.4s ease-in-out infinite;
}
@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 6px 18px -6px rgba(224, 138, 79, 0.55); }
  50%      { box-shadow: 0 10px 28px -6px rgba(224, 138, 79, 0.75); }
}

/* ========== 句子练习(中译英) ========== */
.typing { padding: 12px 0; }

.typing__levels {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 6px;
  background: rgba(255,255,255,0.5); border: 1px solid var(--line);
  border-radius: 999px; backdrop-filter: blur(4px);
}
.typing__levelPill {
  flex: 1; min-width: 60px;
  padding: 8px 12px; border-radius: 999px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.typing__levelPill:hover { background: rgba(224, 138, 79, 0.1); color: var(--ink); }
.typing__levelPill--active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(224, 138, 79, 0.5);
}
.typing__levelPill--all { flex: 0 0 auto; }
.typing__header { display: flex; gap: 10px; margin-bottom: 18px; }
.typing__stat {
  flex: 1; background: var(--paper); padding: 12px 12px; border-radius: 14px;
  box-shadow: var(--shadow-sm); text-align: center;
  border: 1px solid rgba(240, 216, 184, 0.4);
}
.typing__statLabel { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.typing__statValue {
  display: block; font-size: 24px; font-weight: 700; color: var(--primary);
  margin-top: 2px; font-family: var(--t-en); letter-spacing: -0.5px;
}

.typing__prompt {
  background:
    radial-gradient(circle at 0% 0%, #fff5dc 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #ffe9c8 0%, transparent 50%),
    linear-gradient(180deg, #fffaf0, #fff);
  border: 1px solid var(--line);
  padding: 32px 24px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center; position: relative;
}
.typing__prompt::before {
  content: '"'; position: absolute; top: -8px; left: 14px;
  font-family: Georgia, serif; font-size: 60px; color: var(--primary);
  opacity: 0.18; line-height: 1;
}
.typing__promptZh {
  font-family: var(--t-fun); font-weight: 400;
  font-size: clamp(22px, 4.6vw, 30px);
  line-height: 1.4; letter-spacing: 1.5px;
  color: var(--ink);
}
.typing__promptLevel {
  display: inline-block; margin-top: 10px;
  font-size: 11px; padding: 3px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; letter-spacing: 2px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(224, 138, 79, 0.4);
}

.typing__promptLabel { color: var(--ink-2); font-size: 13px; margin: 18px 0 8px; font-weight: 500; }

.typing__input {
  width: 100%; font-size: clamp(18px, 3.4vw, 22px);
  padding: 16px 18px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--paper);
  font-family: var(--t-en); font-weight: 600;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(170,100,50,0.06);
  letter-spacing: 0.3px;
}
.typing__input::placeholder { color: var(--ink-2); font-weight: 500; opacity: 0.6; }
.typing__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(224,138,79,0.15), 0 4px 14px rgba(170,100,50,0.10);
  background: #fff;
}
.typing__input--ok  { border-color: var(--accent); background: linear-gradient(180deg, #fff, #f3faf3); box-shadow: 0 0 0 4px rgba(122, 176, 122, 0.18); }
.typing__input--err { border-color: var(--danger); background: linear-gradient(180deg, #fff, #fdf2f2); box-shadow: 0 0 0 4px rgba(217, 102, 102, 0.15); }

.typing__live {
  background: var(--paper); padding: 12px 16px; border-radius: 12px;
  margin-top: 10px; box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary);
}
.typing__liveScore { font-weight: 700; font-family: var(--t-en); }
.typing__liveRef   { color: var(--ink-2); font-family: var(--t-en); font-size: 14px; margin-top: 4px; }

.typing__actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.typing__feedback {
  margin-top: 14px; padding: 16px 18px;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: fade-up 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.typing__fbHead { font-size: 18px; font-weight: 800; }
.typing__fbHead--ok  { color: var(--accent); }
.typing__fbHead--mid { color: var(--primary-2); }
.typing__fbHead--low { color: var(--danger); }
.typing__fbEn, .typing__fbYou { font-family: var(--t-en); font-weight: 600; margin-top: 6px; }
.typing__fbEn  { color: var(--ink); }
.typing__fbYou { color: var(--ink-2); }

.typing__done {
  font-family: var(--t-fun); font-size: 28px; font-weight: 400;
  color: var(--primary); letter-spacing: 1.5px;
}
.typing__doneSub  { color: var(--accent); font-weight: 600; margin-top: 6px; font-size: 16px; }

.hidden { display: none !important; }

/* ---------- 三块讲解面板 ---------- */
.explainer { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; animation: fade-up 0.4s 0.05s both; }
.explainer__top {
  background: linear-gradient(135deg, #fff5e2 0%, #fff 100%);
  padding: 18px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid rgba(224, 138, 79, 0.15);
  position: relative; overflow: hidden;
}
.explainer__top::after {
  content: ''; position: absolute; right: -30px; bottom: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 138, 79, 0.15), transparent 70%);
}
.explainer__zh { font-size: 14px; color: var(--ink-2); font-weight: 500; width: 100%; }
.explainer__en {
  font-family: var(--t-en); font-size: 20px; font-weight: 700; flex: 1; min-width: 0;
  word-break: break-word; color: var(--ink); letter-spacing: 0.3px;
}

.explainer__section {
  background: var(--paper); padding: 16px 20px; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 3px solid var(--primary);
  transition: transform 0.2s;
}
.explainer__section:hover { transform: translateX(2px); }
.explainer__section:nth-child(odd)  { border-left-color: var(--accent); }
.explainer__section h4 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.explainer__p { margin: 0; color: var(--ink-2); line-height: 1.75; font-size: 14px; }

.explainer__table {
  display: flex; flex-direction: column; gap: 4px; margin-top: 6px;
}
.explainer__row {
  display: grid; grid-template-columns: 1.2fr 0.8fr 1fr 1.6fr; gap: 8px;
  padding: 8px 12px; border-radius: 8px; font-size: 14px;
  transition: background 0.15s;
}
.explainer__row:nth-child(odd)  { background: rgba(224,138,79,0.06); }
.explainer__row:hover:not(:first-child) { background: rgba(224,138,79,0.12); }
.explainer__row:first-child {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 1px;
}
.explainer__row:first-child .explainer__cell { color: #fff; }
.explainer__cell { min-width: 0; word-break: break-word; }
.explainer__word {
  font-family: var(--t-en); font-weight: 700; color: var(--primary-2);
  display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.3px;
}
.explainer__row:first-child .explainer__word { color: #fff; }
.explainer__wordPlay {
  background: transparent; border: 0; cursor: pointer; padding: 0;
  font-size: 11px; opacity: 0.65; transition: opacity 0.15s, transform 0.15s;
}
.explainer__wordPlay:hover { opacity: 1; transform: scale(1.2); }
.explainer__row:not(:first-child) .explainer__wordPlay { color: var(--primary-2); }
.explainer__row:first-child .explainer__wordPlay { color: #fff; }

@media (max-width: 640px) {
  .explainer__row { grid-template-columns: 1fr 1fr; }
  .explainer__row > .explainer__cell:nth-child(3),
  .explainer__row > .explainer__cell:nth-child(4) { grid-column: span 1; }
}

/* ========== 撒花特效 ========== */
#confetti-host {
  position: fixed; inset: 0; pointer-events: none;
  z-index: 9998; overflow: hidden;
}
.confetti__piece {
  position: absolute; display: block;
  will-change: transform, opacity;
  animation: confetti-fall var(--dur, 2200ms) cubic-bezier(0.2, 0.6, 0.4, 1) var(--delay, 0ms) forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translate(var(--cx, 0), var(--cy, 60vh)) rotate(var(--rot, 360deg)); opacity: 0; }
}
.confetti__burst {
  position: absolute; width: 12px; height: 12px;
  border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgba(224, 138, 79, 0.6);
  animation: confetti-burst 1s ease-out forwards;
  pointer-events: none;
}
@keyframes confetti-burst {
  0%   { box-shadow: 0 0 0 0 rgba(224, 138, 79, 0.6); opacity: 1; }
  100% { box-shadow: 0 0 0 120px rgba(224, 138, 79, 0); opacity: 0; }
}

/* ========== 跟读录音 ========== */
.speech { padding: 12px 0; }
.speech__header { margin-bottom: 14px; }
.speech__title { margin: 0 0 4px; font-size: 24px; font-family: var(--t-fun); font-weight: 400; letter-spacing: 1px; }
.speech__sub { margin: 0; color: var(--ink-2); }
.speech__card {
  background:
    radial-gradient(circle at 0% 0%, #fff5dc 0%, transparent 50%),
    linear-gradient(180deg, #fffaf0, #fff);
  padding: 30px 24px; border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center; margin: 12px 0; border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.speech__en { font-family: var(--t-en); font-size: clamp(22px, 4.6vw, 32px); font-weight: 700; letter-spacing: 0.3px; }
.speech__zh { color: var(--ink-2); margin-top: 8px; font-size: 16px; }
.speech__status { text-align: center; color: var(--ink-2); margin: 8px 0; font-weight: 500; }
.speech__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.speech__result { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 12px 0; }
.speech__heard { color: var(--ink-2); margin-bottom: 10px; }
.speech__bar { height: 10px; background: #f3e2cb; border-radius: 999px; overflow: hidden; }
.speech__barFill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.speech__score { text-align: center; margin-top: 12px; font-size: 22px; font-weight: 800; font-family: var(--t-en); }
.speech__score--ok  { color: var(--good); }
.speech__score--mid { color: var(--primary-2); }
.speech__score--low { color: var(--danger); }
.speech__fallback { display: flex; gap: 8px; margin-top: 12px; }
.speech__input { flex: 1; }

/* ========== 打卡日历 ========== */
.calendar { padding: 12px 0; }
.calendar__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar__title { margin: 0; font-family: var(--t-fun); font-weight: 400; font-size: 22px; letter-spacing: 1px; }
.calendar__streak { font-size: 14px; color: var(--ink-2); }
.calendar__streakNum { color: var(--primary); font-weight: 800; font-size: 22px; margin-right: 4px; font-family: var(--t-en); }
.calendar__nav { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 14px; }
.calendar__month { font-weight: 700; min-width: 130px; text-align: center; font-family: var(--t-fun); font-size: 20px; letter-spacing: 1.5px; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar__weekday { text-align: center; font-size: 12px; color: var(--ink-2); padding: 4px 0; font-weight: 600; }
.calendar__cell {
  background: var(--paper); border: 1.5px solid transparent; border-radius: 12px; padding: 6px 4px;
  min-height: 56px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, border-color 0.15s;
  box-shadow: 0 1px 3px rgba(170,100,50,0.08);
  font-family: inherit; color: var(--ink);
}
.calendar__cell:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(170,100,50,0.20); border-color: var(--line); }
.calendar__cell--dim { opacity: 0.35; }
.calendar__cell--today { outline: 2px solid var(--primary); outline-offset: -2px; }
.calendar__cell--selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(224, 138, 79, 0.6);
}
.calendar__cell--done { background: linear-gradient(180deg, #fff, #fff0d8); }
.calendar__cellNum { font-weight: 700; font-family: var(--t-en); }
.calendar__dot { display: flex; gap: 2px; }
.calendar__dotItem { width: 6px; height: 6px; border-radius: 50%; }
.calendar__dotItem--words { background: var(--primary); }
.calendar__dotItem--sent  { background: var(--accent); }
.calendar__dotItem--rec   { background: #c9a16e; }
.calendar__mood { font-size: 11px; color: var(--ink-2); }

.calendar__editor { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 16px; border: 1px solid var(--line); }
.calendar__editorDate { font-weight: 700; margin-bottom: 10px; font-size: 15px; }
.calendar__editorText { width: 100%; resize: vertical; min-height: 80px; }
.calendar__editorActions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ========== 设置 ========== */
.settings { padding: 12px 0; }
.settings__title { margin-top: 0; font-family: var(--t-fun); font-weight: 400; font-size: 24px; letter-spacing: 1.5px; }
.settings__danger { background: linear-gradient(180deg, rgba(217, 102, 102, 0.06), rgba(217, 102, 102, 0.12)); padding: 16px; border-radius: var(--radius); margin-top: 28px; border: 1px solid rgba(217, 102, 102, 0.2); }
.settings__danger h3 { margin: 0 0 10px; color: var(--danger); }
.settings__about  { color: var(--ink-2); margin-top: 24px; font-size: 14px; line-height: 1.7; }
.settings__about p { margin: 6px 0; }

/* ========== 打字游戏 ========== */
.typer { padding: 12px 0; }

.typer__select { padding: 8px 4px; }
.typer__selectTitle {
  font-family: var(--t-fun); font-weight: 400;
  font-size: 32px; letter-spacing: 2px; margin: 0 0 6px;
  background: linear-gradient(135deg, var(--primary), #d96b3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.typer__selectSub { color: var(--ink-2); margin: 0 0 18px; font-size: 14px; }
.typer__levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .typer__levels { grid-template-columns: repeat(4, 1fr); } }
.typer__level {
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px 16px; text-align: left;
  cursor: pointer; font-family: inherit; color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-sm);
}
.typer__level:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--primary);
}
.typer__level:active { transform: translateY(0) scale(0.98); }
.typer__levelName {
  font-family: var(--t-fun); font-weight: 400; font-size: 22px;
  color: var(--primary); letter-spacing: 1.5px; margin-bottom: 4px;
}
.typer__levelDesc { color: var(--ink-2); font-size: 12px; }
.typer__tip { margin-top: 16px; color: var(--ink-2); font-size: 13px; text-align: center; }

/* 游戏内 */
.typer__arena {
  position: relative; height: 70vh; min-height: 460px;
  background:
    radial-gradient(circle at 50% 0%, #fff5dc 0%, transparent 60%),
    linear-gradient(180deg, #fffaf0 0%, #fff5e2 100%);
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden;
}
.typer__hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; gap: 8px; padding: 12px;
  background: linear-gradient(180deg, rgba(255,250,242,0.95), rgba(255,250,242,0.6));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.typer__hudItem {
  flex: 1; background: var(--paper); padding: 8px 6px; border-radius: 10px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.typer__hudLabel { font-size: 10px; color: var(--ink-2); font-weight: 600; letter-spacing: 1px; }
.typer__hudVal {
  display: block; margin-top: 2px;
  font-family: var(--t-en); font-weight: 700; font-size: 20px;
  color: var(--primary); letter-spacing: -0.5px;
}
.typer__hudItem:nth-child(2) .typer__hudVal { color: var(--primary-2); }
.typer__hudItem:nth-child(3) .typer__hudVal { color: #c75252; }
.typer__hudItem:nth-child(4) .typer__hudVal { color: var(--ink); font-size: 14px; }
.typer__hudItem:nth-child(5) .typer__hudVal { color: var(--accent); }

.typer__stage {
  position: absolute; left: 0; right: 0; top: 60px; bottom: 0;
  overflow: hidden;
}

.typer__bubble {
  position: absolute; padding: 8px 16px;
  background: linear-gradient(135deg, #fff, #fff7e8);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(170,100,50,0.20);
  font-family: var(--t-en); font-weight: 700; font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  will-change: top, transform, opacity;
}
.typer__bubbleWord { letter-spacing: 0.5px; }
.typer__hit {
  color: var(--ink-2);
  text-decoration: line-through;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  margin-right: 1px;
}
.typer__bubble--pop {
  animation: typer-pop 0.22s ease-out forwards;
}
@keyframes typer-pop {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.typer__bubble--miss {
  animation: typer-miss 0.3s ease-in forwards;
}
@keyframes typer-miss {
  0%   { transform: translateX(0); opacity: 1; border-color: var(--danger); background: #fdf2f2; }
  20%  { transform: translateX(-8px); }
  40%  { transform: translateX(8px); }
  60%  { transform: translateX(-6px); }
  80%  { transform: translateX(6px); }
  100% { transform: translateX(0); opacity: 0; }
}

.typer__overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 250, 242, 0.85);
  backdrop-filter: blur(8px);
  animation: fade-up 0.3s ease-out;
}
.typer__overBox {
  background: var(--paper); padding: 32px 36px; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; max-width: 360px; width: calc(100% - 40px);
  border: 1px solid var(--line);
}
.typer__overTitle {
  font-family: var(--t-fun); font-size: 28px; color: var(--primary);
  letter-spacing: 1.5px; margin-bottom: 8px;
}
.typer__overScore {
  font-family: var(--t-en); font-size: 64px; font-weight: 700;
  color: var(--primary); line-height: 1; margin: 8px 0;
  text-shadow: 0 2px 0 rgba(255,255,255,0.5);
}
.typer__overSub { color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }
.typer__overActions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .typer__arena { height: 64vh; }
}

/* ========== 移动端 ========== */
@media (max-width: 640px) {
  .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar__item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--ink-2); font-size: 11px;
  }
  .tabbar__item span { font-size: 22px; }
  .tabbar__item--active { color: var(--primary); }
  .app { padding-bottom: 90px; }
  .home__totals { grid-template-columns: repeat(2, 1fr); }
  .typing__header { flex-wrap: wrap; }
  .typing__stat { flex: 1 1 calc(50% - 4px); }
}
