/* 阿序英语 Web v1.0 — 暗色优先，学习靛蓝 + 进度绿 */
:root {
  --bg: #0B0E1A;
  --surface: #151A2E;
  --surface-2: #1D2440;
  --border: rgba(148, 163, 214, 0.14);
  --text: #EEF1FB;
  --text-mut: #9AA3C7;
  --indigo: #6366F1;
  --violet: #A855F7;
  --green: #22C55E;
  --red: #EF4444;
  --grad: linear-gradient(90deg, #6366F1, #A855F7);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F6FE;
    --surface: #FFFFFF;
    --surface-2: #EEF1FB;
    --border: rgba(49, 46, 129, 0.12);
    --text: #171B33;
    --text-mut: #545C82;
    --shadow: 0 10px 30px rgba(79, 70, 229, 0.10);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.screen { display: flex; flex-direction: column; flex: 1; }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

/* ---------- 首页 ---------- */
.home-top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; color: var(--indigo); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.streak-pill {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
}
.streak-pill svg { width: 15px; height: 15px; }

.home-hero { text-align: center; margin-top: 12vh; }
.home-date { color: var(--text-mut); font-size: 14px; margin-bottom: 6px; }
.home-title { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 26px; }
.home-counts { display: flex; gap: 12px; justify-content: center; margin-bottom: 30px; }
.count-card {
  flex: 1; max-width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow);
}
.count-num { font-size: 26px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.count-label { font-size: 12.5px; color: var(--text-mut); }
.home-note { color: var(--text-mut); font-size: 13px; margin-top: 14px; }

.home-week { display: flex; gap: 8px; justify-content: center; margin-top: auto; padding-top: 30px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-mut); }
.week-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); }
.week-dot.on { background: var(--green); border-color: var(--green); }

/* ---------- 按钮 ---------- */
.btn {
  border-radius: 16px;
  font-weight: 700;
  transition: transform 0.1s ease, filter 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
}
.btn:active { transform: scale(0.97); filter: brightness(0.92); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-big { width: 100%; max-width: 340px; font-size: 18px; padding: 16px; }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- 学习页 ---------- */
.study-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.icon-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--text-mut);
  transition: background 0.2s ease;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.study-stats { display: flex; gap: 14px; font-size: 13.5px; color: var(--text-mut); flex: 1; justify-content: center; }
.spacer { width: 44px; }
.timebar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 22px; }
.timebar-fill { height: 100%; border-radius: 999px; background: var(--grad); width: 0; transition: width 0.6s ease; }

.card-area { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.fcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: card-in 0.24s ease;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fcard { animation: none; }
  .btn, .icon-btn { transition: none; }
}
.tag-new {
  display: inline-block;
  font-size: 12.5px; font-weight: 600;
  color: #fff;
  background: var(--grad);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}
.word {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.12;
  word-break: break-word;
}
.word.sm { font-size: 24px; font-weight: 700; line-height: 1.4; }
.ipa { color: var(--text-mut); font-size: 16px; margin-top: 4px; font-family: Georgia, serif; }
.zh { font-size: 22px; font-weight: 700; margin-top: 16px; }
.example {
  margin-top: 18px;
  text-align: left;
  background: var(--surface-2);
  border-left: 3px solid var(--indigo);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 17px;
  line-height: 1.55;
}
.example-zh { color: var(--text-mut); font-size: 13.5px; margin-top: 6px; padding: 0 14px; text-align: left; }

.audio-btn {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 20px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14.5px; font-weight: 600;
  transition: transform 0.1s ease, background 0.2s ease;
  min-height: 44px;
}
.audio-btn:active { transform: scale(0.96); }
.audio-btn svg { width: 17px; height: 17px; color: var(--indigo); }
.audio-btn.playing svg { color: var(--green); }

.repeat-hint {
  text-align: center;
  color: var(--text-mut);
  font-size: 14px;
  margin: 18px 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.repeat-hint svg { width: 15px; height: 15px; }

.action-area { padding-top: 10px; display: flex; flex-direction: column; align-items: center; }
.action-area .repeat-hint { width: 100%; }
.grade-row { display: flex; gap: 12px; width: 100%; max-width: 480px; }
.grade-btn { flex: 1; min-height: 60px; font-size: 18px; border-radius: 18px; color: #fff; font-weight: 700; }
.grade-again { background: linear-gradient(180deg, #EF5350, #DC3D39); box-shadow: 0 8px 20px rgba(220, 61, 57, 0.28); }
.grade-good { background: linear-gradient(180deg, #26BD68, #1CA457); box-shadow: 0 8px 20px rgba(28, 164, 87, 0.28); }
.grade-sub { display: block; font-size: 11.5px; font-weight: 500; opacity: 0.85; margin-top: 2px; }

/* ---------- 完成页 ---------- */
.done-wrap { text-align: center; animation: card-in 0.3s ease; }
.done-ring {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
}
.done-ring svg { width: 44px; height: 44px; color: var(--green); }
.done-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.done-stat { color: var(--text-mut); font-size: 15px; margin-bottom: 4px; }
.done-note { color: var(--text-mut); font-size: 13.5px; }
.done-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: center; }

.sync-dot { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; font-size: 11px; color: var(--text-mut); opacity: 0.7; }

/* ---- 今日一句 ---- */
.sent-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 340px;
  margin: 18px auto 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, border-color 0.2s ease;
}
.sent-entry:active { transform: scale(0.98); }
.sent-entry-top { display: flex; justify-content: space-between; align-items: center; }
.sent-entry-title { font-weight: 700; font-size: 15px; }
.sent-entry-time { font-size: 12.5px; color: var(--green); font-weight: 600; }
.sent-entry-sub { font-size: 12.5px; color: var(--text-mut); }
.skeleton {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--indigo);
  background: rgba(99, 102, 241, 0.10);
  border-radius: 10px;
  padding: 8px 12px;
  display: inline-block;
}
.sent-note {
  margin-top: 12px;
  text-align: left;
  color: var(--text-normal, inherit);
  font-size: 15px;
  line-height: 1.65;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
}
