:root {
  --ink: #1d2430;
  --muted: #5c6775;
  --accent: #0f2a43;
  --accent-2: #ff8a3d;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(29, 36, 48, 0.12);
  --shadow: 0 12px 40px rgba(28, 40, 36, 0.12);
  --font-display: "ZCOOL XiaoWei", "Songti SC", serif;
  --font-body: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #e8f0ea;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9efe4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f3e2d0 0%, transparent 50%),
    linear-gradient(180deg, #eef5f0 0%, #e7ece6 100%);
}

.top {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.brand-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo { display: none !important; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.pill {
  background: rgba(15, 110, 86, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}
.pill b { color: var(--accent); }
.banner {
  background: #eef6f2;
  border-radius: 12px;
  padding: 12px 14px;
  color: #1f4d3e;
  line-height: 1.5;
  margin: 0 0 14px;
}
.footer-actions { display: grid; gap: 8px; margin-top: 16px; }
.footer-actions button {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.footer-actions button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(15, 110, 86, 0.3);
}
.footer-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.actions button.recording { background: #b42318; color: #fff; border-color: #b42318; }
.actions button.speaking,
button.speaking,
button.linkish.speaking {
  background: #1565c0 !important;
  color: #fff !important;
  border-color: #1565c0 !important;
}
.user-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.user-box .who {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.hidden { display: none !important; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.auth-gate .ghost-share, .share-mini {
  border: 1px solid rgba(15, 110, 86, 0.28);
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.share-flash { outline: 2px solid var(--accent-2); box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.25); }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tab {
  position: relative;
  border: 1px solid rgba(15, 110, 86, 0.28);
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.tab-review { padding-right: 18px; }
.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.wechat-badge {
  position: absolute;
  top: -7px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #ee0a24;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.wechat-badge.is-zero,
.wechat-badge[hidden] { display: none !important; }
.tab-main { padding-right: 16px; }
.done-check {
  position: absolute;
  top: -7px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.done-check.is-zero,
.done-check[hidden] { display: none !important; }
.badge {
  display: inline-block;
  min-width: 1.2em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
}
.auth-gate h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 28px;
}
.auth-gate p { color: var(--muted); line-height: 1.55; }
.auth-gate button, .auth-body > button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.auth-gate button.ghost-share {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(15, 110, 86, 0.28);
}
.auth-body {
  padding: 14px 16px 18px;
  display: grid;
  gap: 8px;
}
.auth-body label { font-size: 13px; color: var(--muted); }
.auth-body input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}
.auth-switch { display: flex; gap: 8px; margin-bottom: 4px; }
.auth-err { color: #b42318; min-height: 1.2em; margin: 0; font-size: 13px; }
.code-line { display: flex; gap: 8px; align-items: center; }
.code-line input { flex: 1; min-width: 0; }
.code-line button {
  margin: 0;
  border-radius: 10px;
  padding: 10px 12px;
  white-space: nowrap;
  background: #fff;
  color: #2bb673;
  border: 1px solid #2bb673;
  font-weight: 700;
  cursor: pointer;
}
.code-line button:disabled { opacity: 0.55; cursor: not-allowed; }
.code-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; min-height: 1.2em; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.5; }
.agree input { width: 16px; height: 16px; margin-top: 3px; accent-color: #2bb673; }
.agree a, .legal-links a, .consent-foot a { color: #1f9d57; font-weight: 700; }
.legal-links { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.auth-body > button.text-link {
  background: transparent;
  color: var(--muted);
  margin-top: 0;
  padding: 4px;
}
dialog.sheet {
  width: min(520px, 100vw);
  margin: auto auto 0;
  border-radius: 16px 16px 0 0;
  max-height: 86vh;
}
.consent-body, .consent-foot { margin: 0; padding: 14px 16px 0; color: #5c6775; font-size: 14px; line-height: 1.65; }
.consent-foot { padding-top: 12px; padding-bottom: 4px; }
.consent-actions { display: flex; gap: 12px; padding: 14px 16px 18px; }
.consent-actions button { flex: 1; border-radius: 8px; padding: 12px 8px; font-weight: 700; font-size: 16px; cursor: pointer; }
.consent-no { background: #fff; color: #2bb673; border: 1px solid #2bb673; }
.consent-yes { background: #2bb673; color: #fff; border: 0; }
dialog.sheet header button { font-size: 22px; line-height: 1; color: #98a2b3; }
.plan-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.stat {
  background: rgba(15, 110, 86, 0.06);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }
.progress-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(15, 110, 86, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
}
.progress-tag.mastered { color: #fff; background: var(--accent); }
.progress-tag.due { color: #fff; background: var(--accent-2); }
.progress-tag.pending { color: #fff; background: #E53935; }
.progress-tag.done-today { color: #0F2A43; background: #FFC300; }
.progress-tag.count { color: var(--accent); background: rgba(15, 42, 67, 0.06); margin-left: 4px; }
.progress-tag.note-chip {
  border: 0;
  cursor: pointer;
  margin-left: 4px;
  color: var(--accent);
  background: rgba(15, 42, 67, 0.08);
  font-weight: 800;
}
.progress-tag.note-chip.note-empty {
  color: #E53935;
  background: rgba(229, 57, 53, 0.12);
}
button.remember-confirm {
  background: transparent;
  color: #E53935;
  border: 1px solid #E53935;
  font-weight: 800;
}
.notes-list { max-height: 38vh; overflow: auto; margin: 10px 0; }
.note-item { padding: 8px 0; border-bottom: 1px solid rgba(15, 42, 67, 0.08); }
.note-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #6b7c8d; }
.note-body { margin-top: 4px; line-height: 1.45; }
#notesInput { width: 100%; box-sizing: border-box; }
button.linkish {
  border: 0;
  background: transparent;
  color: var(--accent-2, #ff8a3d);
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(29, 36, 48, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 50;
  max-width: 90vw;
}
.timer-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.timer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.timer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.timer-label { font-weight: 700; color: var(--accent); }
.timer-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.timer-bar .day-sub {
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 0;
}
.timer-bar button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.sentence-card { text-align: left; }
.sentence-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.sentence-en {
  font-family: var(--font-body);
  font-size: clamp(20px, 4.4vw, 28px);
  font-weight: 700;
  line-height: 1.45;
}
.sentence-zh { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.zh-reading {
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.5;
}
.ipa-line { margin-top: 4px; color: #2f5d8c; font-weight: 600; }
.zh-reading-note { margin: 8px 0 0; font-size: 12px; color: #8a7355; }
.level-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 8px;
}
.level-row::-webkit-scrollbar { display: none; }
.level-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--accent);
}
.level-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.level-chip span { display: none; }
.method-box {
  background: rgba(15, 42, 67, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}
.method-title { font-weight: 700; color: var(--accent); display: block; margin-bottom: 4px; }
.cut-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cut-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 120px;
  cursor: pointer;
}
.cut-word { display: block; font-weight: 700; }
.cut-parts, .cut-type, .cut-zh, .cut-ipa, .cut-tip {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.actions button.recording { background: #b42318; }
.review-h {
  margin: 8px 4px 8px;
  font-size: 15px;
  color: var(--accent);
}
.brand-cn {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 56px);
  line-height: 1.1;
  letter-spacing: 0.04em;
}
.brand-en {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.day-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.day-title {
  font-family: var(--font-display);
  font-size: 28px;
  text-align: center;
}
.day-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.nav-btn, .jump button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.jump input {
  width: 88px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
.jump .ghost, button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(15, 110, 86, 0.35);
}

.method {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.list { display: grid; gap: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.word-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.word {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ipa { color: #2f5d8c; font-weight: 600; }
.meaning { margin: 6px 0 10px; color: var(--muted); }
.story {
  background: rgba(15, 110, 86, 0.06);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 0 12px 12px 0;
  margin: 8px 0;
  line-height: 1.55;
}
.story b { color: var(--accent); }
.mnemonic-block {
  margin-top: 12px;
}
.mnemonic-img {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 4px;
  border-radius: 14px;
  border: 2px solid rgba(15, 110, 86, 0.18);
  cursor: zoom-in;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 16, 24, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
}
.img-lightbox.hidden { display: none; }
.img-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 8px;
}
.img-lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}
.img-lightbox-hint {
  margin-top: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}
.meta-line {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
}
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.actions button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(15, 110, 86, 0.3);
}

dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(920px, 94vw);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 28, 24, 0.45); }
dialog form header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
dialog form header button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
}
.letter-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.letter-item strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}
.letter-item span { color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .word { font-size: 24px; }
  .nav-btn { padding: 8px 10px; font-size: 13px; }
}
