:root {
  --bg:        #f6f0e6;
  --bg-2:      #f1e8d9;
  --card:      #fffdfa;
  --ink:       #2b2620;
  --ink-soft:  #4d463d;
  --muted:     #978d7f;
  --hair:      #ebe1d2;
  --hair-2:    #e0d4c1;
  --clay:      #c0573b;
  --clay-deep: #a4452c;
  --clay-soft: #f7e7dc;
  --clay-tint: #fbf0e8;
  --amber:     #dd9a44;
  --green:     #4f8a5b;

  --shadow-sm: 0 1px 2px rgba(43,38,32,.05), 0 1px 3px rgba(43,38,32,.05);
  --shadow-md: 0 6px 22px rgba(43,38,32,.09);
  --shadow-fab: 0 8px 20px rgba(176,72,44,.34);

  --serif: "Fraunces", "Iowan Old Style", Georgia, "Songti SC", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, select, input { touch-action: manipulation; font-family: inherit; }

html, body { margin: 0; height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(120% 80% at 85% -10%, var(--bg-2) 0%, rgba(241,232,217,0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- header ---------------- */
.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) 18px 12px;
  background: rgba(246,240,230,.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hair);
  z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand .logo { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.brand .badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: #fff;
  background: linear-gradient(160deg, var(--clay), var(--clay-deep));
  padding: 2px 6px; border-radius: 6px; transform: translateY(-2px);
}
.brand .zh { font-size: 12.5px; font-weight: 500; color: var(--muted); }

.track-wrap { position: relative; min-width: 0; flex: 0 1 auto; }
.track-select {
  appearance: none; -webkit-appearance: none;
  max-width: 60vw; padding: 9px 32px 9px 14px;
  border: 1px solid var(--hair-2); border-radius: 11px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-sm);
  cursor: pointer; text-overflow: ellipsis;
}
.track-wrap .chev {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; pointer-events: none;
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- generic view ---------------- */
.view { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------------- sentence list ---------------- */
.sentences { padding: 14px 14px 18px; scroll-padding: 80px 0; }
.hint { color: var(--muted); text-align: center; padding: 48px 16px; font-size: 15px; }

.sentence {
  position: relative; display: flex; gap: 13px;
  padding: 16px 14px 17px 16px; margin: 10px 0;
  background: var(--card); border: 1px solid var(--hair); border-radius: 16px;
  box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.sentence::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--clay); transform: scaleY(0);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.sentence:active { transform: scale(.99); }
@media (hover: hover) { .sentence:hover { box-shadow: var(--shadow-md); border-color: var(--hair-2); } }

.sentence .idx {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%;
  background: var(--bg-2); color: var(--muted); font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s;
}
.sentence .body { flex: 1 1 auto; min-width: 0; }
.sentence .fr {
  font-family: var(--serif); font-size: 20px; line-height: 1.52; letter-spacing: -.005em;
  color: var(--ink-soft); word-break: break-word; transition: color .2s;
}
.sentence .zh {
  max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
  font-size: 14.5px; line-height: 1.5; color: var(--clay-deep);
  border-left: 2px solid var(--clay-soft); padding-left: 0;
  transition: max-height .26s ease, opacity .22s ease, margin .26s ease, padding .26s ease;
}
.sentence.show-tr .zh { max-height: 320px; opacity: 1; margin-top: 9px; padding-left: 10px; }
/* 显示译文 global toggle; a row's .hide-tr opts back out */
body.show-all-tr .sentence:not(.hide-tr) .zh { max-height: 320px; opacity: 1; margin-top: 9px; padding-left: 10px; }
body.show-all-tr .sentence:not(.hide-tr) .tr-toggle { background: var(--clay); border-color: var(--clay); color: #fff; }

.sentence .actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tr-toggle {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--hair-2);
  background: var(--card); color: var(--muted);
  font-family: var(--serif); font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.sentence.show-tr .tr-toggle { background: var(--clay); border-color: var(--clay); color: #fff; }

.sentence .eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.sentence .eq span { width: 3px; height: 100%; background: var(--clay); border-radius: 2px; transform-origin: bottom; animation: eq 900ms ease-in-out infinite; }
.sentence .eq span:nth-child(2) { animation-delay: .2s; }
.sentence .eq span:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
body.playing .sentence.active .eq { display: flex; }

.sentence .prog {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--clay), var(--amber)); border-radius: 0 3px 3px 0;
  transition: width .12s linear;
}
.sentence.active { background: var(--clay-tint); border-color: var(--clay-soft); box-shadow: var(--shadow-md); }
.sentence.active::before { transform: scaleY(1); }
.sentence.active .idx { background: var(--clay); color: #fff; }
.sentence.active .fr { color: var(--ink); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .sentence, .sentence::before, .sentence .prog, .sentence .zh { transition: none; }
  .sentence .eq span { animation: none; }
}

/* ---------------- audio controls ---------------- */
.controls {
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(255,253,250,.7), var(--card) 38%);
  border-top: 1px solid var(--hair);
  padding: 10px 16px 12px; box-shadow: 0 -8px 24px rgba(43,38,32,.05); z-index: 4;
}
.row { display: flex; align-items: center; gap: 12px; }
.row + .row { margin-top: 11px; }
.row.time .t { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); width: 38px; text-align: center; }

.seek { flex: 1 1 auto; height: 22px; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.seek::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(var(--clay),var(--clay)) 0/var(--fill,0%) 100% no-repeat, var(--hair-2); }
.seek::-moz-range-track { height: 5px; border-radius: 999px; background: var(--hair-2); }
.seek::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--clay); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: #fff; border: 2.5px solid var(--clay); box-shadow: 0 1px 4px rgba(164,69,44,.4); }
.seek::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2.5px solid var(--clay); box-shadow: 0 1px 4px rgba(164,69,44,.4); }

.row.primary { justify-content: center; gap: 22px; }
.ctrl { width: 50px; height: 50px; border: none; border-radius: 50%; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, transform .08s; }
.ctrl svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctrl:active { transform: scale(.92); }
@media (hover: hover) { .ctrl:hover { background: var(--clay-soft); } }
.ctrl.play { width: 64px; height: 64px; background: radial-gradient(120% 120% at 30% 20%, #cf6347, var(--clay) 55%, var(--clay-deep)); color: #fff; box-shadow: var(--shadow-fab); }
.ctrl.play svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.ctrl.play:active { transform: scale(.95); }

.row.toggles { flex-wrap: wrap; justify-content: center; gap: 9px; }
.chip.toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--hair-2); background: var(--card); color: var(--ink-soft); border-radius: 999px; padding: 9px 15px 9px 12px; font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm); transition: background .16s, color .16s, border-color .16s; }
.chip.toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip.toggle[aria-pressed="true"] { background: linear-gradient(160deg, var(--clay), var(--clay-deep)); border-color: var(--clay-deep); color: #fff; box-shadow: 0 4px 12px rgba(176,72,44,.28); }

.speeds { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border: 1px solid var(--hair-2); border-radius: 999px; padding: 3px; }
.speed { border: none; background: transparent; cursor: pointer; border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); transition: color .15s, background .15s; }
.speed.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }

/* ---------------- tab bar ---------------- */
.tabbar {
  flex: 0 0 auto; display: flex; align-items: stretch;
  background: rgba(255,253,250,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--hair);
  padding-bottom: var(--safe-b); z-index: 6;
}
.tab {
  position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; border: none; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 11px; font-weight: 600; transition: color .15s;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--clay); }
.tab.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--clay); }
.tab-count { position: absolute; top: 5px; right: calc(50% - 24px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------------- selection chip ---------------- */
.sel-add {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 132px); z-index: 30;
  max-width: 86vw; border: none; border-radius: 999px;
  background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff;
  font-size: 14px; font-weight: 600; padding: 11px 18px; box-shadow: var(--shadow-fab);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sel-add:active { transform: translateX(-50%) scale(.96); }

/* ---------------- vocab ---------------- */
.vocab { padding: 14px 14px calc(18px + var(--safe-b)); }
.vocab-add {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center;
  padding: 6px 2px 12px; background: linear-gradient(var(--bg) 70%, rgba(246,240,230,0));
}
.vocab-add input {
  flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 16px;
  border: 1px solid var(--hair-2); border-radius: 13px; background: var(--card);
  font-size: 16px; color: var(--ink); box-shadow: var(--shadow-sm);
}
.vocab-add input:focus { outline: 2px solid var(--clay-soft); border-color: var(--clay); }
.btn-add { flex: 0 0 auto; width: 46px; height: 46px; border: none; border-radius: 13px; background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-fab); }
.btn-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.btn-add:active { transform: scale(.94); }
.vocab-tip { margin: 2px 2px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.vocab-list { display: flex; flex-direction: column; gap: 10px; }
.vocab-empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; line-height: 1.6; }
.vocab-card {
  display: flex; align-items: center; gap: 10px; padding: 13px 12px 13px 16px;
  background: var(--card); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.vc-main { flex: 1 1 auto; min-width: 0; }
.vc-word { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); word-break: break-word; }
.vc-zh { margin-top: 3px; font-size: 13.5px; color: var(--muted); word-break: break-word; }
.vc-zh.editable { cursor: text; }
.vc-zh.loading { color: var(--clay); font-style: italic; }
.vc-btn { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--hair-2); border-radius: 11px; background: var(--card); color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.vc-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vc-btn.speak:active { background: var(--clay); border-color: var(--clay); color: #fff; }
.vc-btn.del { color: #b24a3a; }
.vc-btn.del:active { background: #fbe9e5; }
.vc-btn.speaking { background: var(--clay); border-color: var(--clay); color: #fff; }

/* ---------------- quiz ---------------- */
.quiz { padding: 18px 16px calc(18px + var(--safe-b)); }
.quiz-content { max-width: 560px; margin: 0 auto; }
.quiz-hero { text-align: center; padding: 28px 8px 8px; }
.quiz-hero h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 8px; color: var(--ink); }
.quiz-hero p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 22px; }
.btn-primary { border: none; border-radius: 14px; background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; font-size: 16px; font-weight: 600; padding: 14px 26px; cursor: pointer; box-shadow: var(--shadow-fab); }
.btn-primary:active { transform: scale(.97); }
.btn-ghost { border: 1px solid var(--hair-2); border-radius: 14px; background: var(--card); color: var(--ink-soft); font-size: 15px; font-weight: 600; padding: 13px 22px; cursor: pointer; box-shadow: var(--shadow-sm); }

.quiz-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.quiz-progress .bar { flex: 1 1 auto; height: 7px; border-radius: 999px; background: var(--hair-2); overflow: hidden; }
.quiz-progress .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--clay), var(--amber)); border-radius: 999px; transition: width .3s ease; }
.quiz-progress .count { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.quiz-card { background: var(--card); border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--shadow-md); padding: 26px 20px; text-align: center; }
.quiz-prompt-label { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.quiz-prompt { font-size: 23px; font-weight: 600; color: var(--ink); margin: 8px 0 6px; line-height: 1.4; }
.quiz-speak { margin: 4px auto 18px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--hair-2); background: var(--bg-2); color: var(--clay); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.quiz-speak svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quiz-input { width: 100%; height: 52px; text-align: center; border: 2px solid var(--hair-2); border-radius: 13px; background: #fff; font-family: var(--serif); font-size: 22px; color: var(--ink); }
.quiz-input:focus { outline: none; border-color: var(--clay); }
.quiz-input.ok { border-color: var(--green); background: #eef6ef; }
.quiz-input.no { border-color: var(--clay); background: var(--clay-tint); }
.quiz-feedback { min-height: 24px; margin: 12px 0 4px; font-size: 14.5px; font-weight: 600; }
.quiz-feedback.ok { color: var(--green); }
.quiz-feedback.no { color: var(--clay-deep); }
.quiz-feedback .ans { font-family: var(--serif); }
.quiz-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }
.quiz-actions .btn-primary, .quiz-actions .btn-ghost { flex: 1 1 0; }
.quiz-score { font-family: var(--serif); font-size: 40px; font-weight: 600; color: var(--clay); text-align: center; margin: 10px 0 4px; }

/* ---------------- larger screens ---------------- */
@media (min-width: 720px) {
  .sentences, .vocab, .controls > .row { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
  .controls { display: flex; flex-direction: column; }
  .sentence .fr { font-size: 21px; }
}

/* ---------------- footer credit ---------------- */
.credit { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 8px 10px; cursor: pointer; }
.credit b { color: var(--ink-soft); font-weight: 600; }
.credit:active { opacity: .6; }

/* one-time toast (e.g. browser has no French TTS voice) */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 78px);
  transform: translateX(-50%) translateY(6px);
  max-width: min(92vw, 440px); z-index: 50;
  background: var(--ink); color: var(--card);
  padding: 12px 16px; border-radius: 14px;
  font: 500 14px/1.55 var(--sans);
  box-shadow: 0 10px 30px rgba(43, 38, 32, .22);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Zeus Insights modal ---------------- */
:root { --zeus-red: #e1251b; }
.zeus-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(15,15,17,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.zeus-card {
  position: relative; width: 100%; max-width: 372px; max-height: 92dvh; overflow: hidden auto;
  background: #2b2b2f; color: #fff; border-radius: 24px; border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: zeusIn .32s cubic-bezier(.2,.7,.3,1);
}
@keyframes zeusIn { from { opacity: 0; transform: translateY(20px) scale(.965); } to { opacity: 1; transform: none; } }
.zeus-x {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.3); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.zeus-x svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.zeus-x:active { background: rgba(0,0,0,.55); }

.zeus-hero { display: flex; align-items: center; justify-content: center; min-height: 56px; overflow: hidden; }
.zeus-wordmark { width: 100%; display: block; object-fit: contain; }
.zeus-fallback { display: inline-flex; align-items: center; gap: 11px; padding: 28px 0; }
.zeus-zap { width: 28px; height: 32px; fill: var(--zeus-red); }
.zeus-name { font-family: var(--sans); font-weight: 800; font-size: 26px; letter-spacing: .03em; color: #fff; }
.zeus-name span { font-weight: 400; letter-spacing: .2em; opacity: .85; }

.zeus-body { padding: 20px 18px 22px; text-align: center; }
.zeus-tag { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: .2em; color: #84848b; }
.zeus-title { margin: 13px 0 9px; font-size: 22px; font-weight: 600; letter-spacing: .01em; color: #fff; }
.zeus-title span { color: var(--zeus-red); }
.zeus-sub { margin: 0 0 20px; font-size: 13px; line-height: 1.75; color: #a5a5ac; }

.zeus-contacts { display: flex; flex-direction: column; gap: 9px; }
.zc-row { display: flex; align-items: stretch; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; overflow: hidden; transition: border-color .15s; }
.zc-row:active { border-color: rgba(255,255,255,.16); }
.zc-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 10px 12px; text-decoration: none; color: inherit; }
.zc-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.06); display: inline-flex; align-items: center; justify-content: center; }
.zc-ic svg { width: 16px; height: 16px; fill: none; stroke: #c3c3ca; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.zc-text { display: flex; flex-direction: column; min-width: 0; text-align: left; gap: 1px; }
.zc-label { font-size: 11px; color: #84848b; }
.zc-value { font-size: 13px; font-weight: 600; color: #e8e8ec; overflow-wrap: break-word; line-height: 1.35; }
.zc-link { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.32); }
.zc-copy { flex: 0 0 auto; border: none; border-left: 1px solid rgba(255,255,255,.08); background: transparent; color: #adadb4; font-size: 12px; padding: 0 16px; cursor: pointer; transition: background .15s, color .15s; }
.zc-copy:active { background: var(--zeus-red); color: #fff; }

.zeus-ok { width: 100%; margin-top: 22px; border: none; border-radius: 14px; background: var(--zeus-red); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .06em; padding: 14px; cursor: pointer; box-shadow: 0 10px 24px rgba(225,37,27,.3); transition: transform .08s; }
.zeus-ok:active { transform: scale(.985); }
.zeus-never { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; font-size: 12.5px; color: #84848b; cursor: pointer; }
.zeus-never input { width: 15px; height: 15px; accent-color: var(--zeus-red); }

/* ---------------- header help button ---------------- */
.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.help-btn { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--hair-2); border-radius: 50%; background: var(--card); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.help-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.help-btn:active { background: var(--clay-soft); color: var(--clay); }

/* ---------------- first-run guide (carousel) ---------------- */
.guide-overlay { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,15,17,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.guide-card { position: relative; width: 100%; max-width: 380px; height: min(86dvh, 600px); display: flex; flex-direction: column; background: #2b2b2f; border-radius: 24px; border: 1px solid rgba(255,255,255,.06); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: zeusIn .32s cubic-bezier(.2,.7,.3,1); }
.guide-x { position: absolute; top: 12px; right: 12px; z-index: 4; width: 32px; height: 32px; border: none; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.guide-x svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.guide-x:active { background: rgba(0,0,0,.55); }

.guide-track { flex: 1 1 auto; min-height: 0; display: flex; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.guide-slide { flex: 0 0 100%; width: 100%; height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 24px; text-align: center; color: #fff; }
.guide-slide.guide-zeus { padding: 0; justify-content: flex-start; }
.guide-zeus .zeus-body { width: 100%; }
.guide-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: #fff; }
.guide-text { margin: 0; font-size: 13.5px; line-height: 1.7; color: #a8a8af; max-width: 300px; }
.guide-text b { color: #e7e7ea; font-weight: 600; }

.guide-shot { width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 9px; background: var(--bg); border-radius: 18px; padding: 16px; margin-bottom: 22px; box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.guide-welcome { align-items: center; gap: 16px; padding: 26px 16px; }
.gw-logo { display: flex; align-items: baseline; gap: 8px; }
.gw-l { font-family: var(--serif); font-weight: 600; font-size: 28px; color: var(--ink); }
.gw-b { font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(160deg, var(--clay), var(--clay-deep)); padding: 2px 7px; border-radius: 7px; }
.gw-icons { display: flex; gap: 20px; }
.gw-icons svg { width: 26px; height: 26px; fill: none; stroke: var(--clay); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.gs-card { position: relative; display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--hair); border-radius: 11px; padding: 10px 11px; }
.gs-card.gs-on { background: var(--clay-tint); border-color: var(--clay-soft); }
.gs-card.gs-on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--clay); border-radius: 11px 0 0 11px; }
.gs-idx { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); color: var(--muted); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.gs-idx.on { background: var(--clay); color: #fff; }
.gs-fr { flex: 1 1 auto; text-align: left; font-family: var(--serif); font-size: 13.5px; color: var(--ink-soft); }
.gs-tr { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--hair-2); color: var(--muted); font-family: var(--serif); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.gs-tr.on { background: var(--clay); border-color: var(--clay); color: #fff; }
.gs-bar { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 5px; }
.gs-mini { width: 28px; height: 8px; border-radius: 999px; background: var(--hair-2); }
.gs-fab { width: 34px; height: 34px; border-radius: 50%; background: var(--clay); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.gs-fab svg { width: 16px; height: 16px; fill: currentColor; }

.gv-card { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--hair); border-radius: 11px; padding: 9px 10px; }
.gv-main { flex: 1 1 auto; text-align: left; min-width: 0; }
.gv-w { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); }
.gv-z { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.gv-b { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--hair-2); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; }
.gv-b svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gq-card { width: 100%; background: var(--card); border: 1px solid var(--hair); border-radius: 13px; padding: 16px 14px; text-align: center; }
.gq-label { font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.gq-prompt { font-size: 18px; font-weight: 600; color: var(--ink); margin: 5px 0 12px; }
.gq-input { border: 2px solid var(--clay); border-radius: 9px; padding: 8px; font-family: var(--serif); font-size: 16px; color: var(--ink); background: #fff; }
.gq-caret { display: inline-block; width: 2px; height: 15px; background: var(--clay); margin-left: 1px; vertical-align: -2px; }
.gq-btn { margin-top: 10px; background: var(--clay); color: #fff; border-radius: 9px; padding: 8px; font-size: 13px; font-weight: 600; }

.guide-arrow { position: absolute; top: 46%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, opacity .2s; }
.guide-arrow svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.guide-arrow:active { background: rgba(255,255,255,.3); }
.guide-arrow[disabled] { opacity: 0; pointer-events: none; }
.guide-prev { left: 10px; }
.guide-next { right: 10px; }
.guide-dots { flex: 0 0 auto; display: flex; gap: 7px; justify-content: center; padding: 12px 0 14px; }
.guide-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.26); transition: background .2s, width .2s; cursor: pointer; }
.guide-dots i.on { width: 18px; border-radius: 4px; background: var(--zeus-red); }

/* ---------------- home button + A1/A2 level switch (player header) ---------------- */
.home-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--hair-2); border-radius: 50%;
  background: var(--card); color: var(--muted); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
  align-self: center;
}
.home-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-btn:active { background: var(--clay-soft); color: var(--clay); }

.brand { align-items: center; }
.brand .logo { line-height: 1; }
.lv-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--hair-2); border-radius: 999px; padding: 2px;
}
.lv-btn {
  border: none; background: transparent; border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.lv-btn.active { background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; box-shadow: var(--shadow-sm); }

@media (max-width: 460px) {
  /* the player header is crowded on phones; the landing header is not */
  body:not(.home) .brand .zh { display: none; }
  body:not(.home) .brand .logo { font-size: 19px; }
  .brand { gap: 7px; }
  .track-select { max-width: 44vw; }
}

/* ---------------- landing page (index.html) ---------------- */
.brand-mark { width: 26px; height: 26px; object-fit: contain; align-self: center; }
.brand .x { font-family: var(--sans); font-weight: 400; font-size: 15px; color: var(--muted); }

.home-main { padding: 10px 16px calc(24px + var(--safe-b)); }
.hero { max-width: 640px; margin: 0 auto; padding: 26px 4px 18px; text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -.01em; color: var(--ink); margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0; }
.hero b { color: var(--ink-soft); font-weight: 600; }

.modules { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.module-card {
  display: flex; align-items: center; gap: 14px; padding: 17px 16px;
  background: var(--card); border: 1px solid var(--hair); border-radius: 18px;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
a.module-card:active { transform: scale(.985); }
@media (hover: hover) { a.module-card:hover { box-shadow: var(--shadow-md); border-color: var(--hair-2); } }

.mc-icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  background: radial-gradient(120% 120% at 30% 20%, #cf6347, var(--clay) 55%, var(--clay-deep));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(176,72,44,.24);
}
.mc-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-family: var(--serif); font-size: 18.5px; font-weight: 600; color: var(--ink); }
.mc-lv {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: #fff;
  background: linear-gradient(160deg, var(--clay), var(--clay-deep));
  padding: 2px 6px; border-radius: 6px;
}
.mc-desc { font-size: 13px; line-height: 1.55; color: var(--muted); }
.mc-go { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.module-card.soon { cursor: default; }
.module-card.soon .mc-icon { background: var(--bg-2); color: var(--muted); box-shadow: none; }
.module-card.soon .mc-title { color: var(--ink-soft); }
.soon-badge {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: var(--bg-2); border: 1px solid var(--hair-2);
  padding: 2px 8px; border-radius: 999px;
}
.home-credit { cursor: default; }
.home-credit:active { opacity: 1; }

@media (min-width: 720px) {
  .modules { display: grid; grid-template-columns: 1fr 1fr; max-width: 760px; }
  .modules .module-card:first-child { grid-column: 1 / -1; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 40px; }
}

/* ---------------- verb conjugation module (conjugation.html) ---------------- */
.beta-tag {
  font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--clay-deep); background: var(--clay-soft); border: 1px solid var(--hair-2);
  padding: 1px 6px; border-radius: 999px; vertical-align: middle;
}
.conj-search {
  flex: 0 0 auto; z-index: 4;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; background: rgba(246,240,230,.92);
  border-bottom: 1px solid var(--hair);
}
.cv { min-height: 100%; }
.conj-search .cs-icon { flex: 0 0 auto; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.conj-search input {
  flex: 1 1 auto; min-width: 0; border: none; background: transparent;
  font-size: 16px; color: var(--ink); padding: 6px 2px;
}
.conj-search input:focus { outline: none; }
.conj-body { max-width: 720px; margin: 0 auto; padding: 12px 14px calc(28px + var(--safe-b)); }

.conj-hello { color: var(--ink-soft); font-size: 14px; line-height: 1.7; padding: 8px 4px 14px; }
.conj-hello b { color: var(--clay-deep); font-weight: 600; }
.conj-hello-sub { color: var(--muted); font-size: 13px; }
.conj-msg { color: var(--muted); font-size: 14.5px; line-height: 1.6; padding: 24px 8px; text-align: center; }

.verb-card {
  display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; margin: 9px 0;
  background: var(--card); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .1s ease, border-color .2s;
}
.verb-card:active { transform: scale(.99); }
@media (hover: hover) { .verb-card:hover { border-color: var(--hair-2); } }
.verb-card.add { border-style: dashed; border-color: var(--clay); background: var(--clay-tint); }
.vk-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vk-inf { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--clay-deep); }
.vk-zh { font-size: 13.5px; color: var(--muted); }
.vk-sub { flex: 1 1 100%; font-size: 12.5px; color: var(--amber); margin-top: 2px; }
.vk-go { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.verb-card.add .vk-go { stroke: var(--clay); }

.conj-back { border: none; background: none; color: var(--clay-deep); font-size: 14.5px; font-weight: 600; padding: 6px 2px 12px; cursor: pointer; }
.conj-head { text-align: center; padding: 4px 8px 6px; }
.conj-inf { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); }
.conj-zh { font-size: 15px; color: var(--muted); margin-top: 2px; }
.conj-zh.editable { cursor: pointer; }
.conj-zh.editable:hover { color: var(--ink-soft); }
/* custom-verb gloss states (chips, total-list, detail) */
.zh-load { color: var(--clay); font-style: italic; }
.zh-fail { color: var(--clay); font-style: italic; }
.conj-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.conj-tag { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); background: var(--bg-2); border: 1px solid var(--hair-2); padding: 3px 9px; border-radius: 999px; }
.conj-tag.warn { color: var(--clay-deep); background: var(--clay-soft); border-color: #eccab9; }
.conj-note { margin: 12px 0 4px; padding: 10px 12px; background: #fdf3e7; border: 1px solid #f0d9b8; border-radius: 10px; color: #8a6418; font-size: 13px; line-height: 1.55; }
.conj-pp { margin: 14px 0 6px; font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.conj-pp b { font-family: var(--serif); color: var(--clay-deep); }

.conj-tense { margin: 18px 0 4px; }
.ct-title { display: flex; align-items: baseline; gap: 6px; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--clay-soft); padding-bottom: 7px; }
.ct-zh { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ct-mnemo { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin: 7px 0 2px; }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.ct-grid.imp { grid-template-columns: 1fr 1fr 1fr; }
.ct-cell { padding: 9px 11px; background: var(--bg-2); border-radius: 9px; border-left: 3px solid var(--clay-soft); font-size: 15.5px; line-height: 1.35; }
.cf-pron { color: var(--muted); font-size: 12.5px; }
.cf-form { font-family: var(--serif); color: var(--ink); }

@media (max-width: 380px) {
  .ct-grid { grid-template-columns: 1fr; }
  .ct-grid.imp { grid-template-columns: 1fr 1fr 1fr; }
}

/* section nav (replaces A1/A2 toggle) */
.sec-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border: 1px solid var(--hair-2); border-radius: 999px; padding: 2px; }
.sec-btn {
  border: none; background: transparent; border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.sec-btn.active { background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; box-shadow: var(--shadow-sm); }
.conj-sec { min-height: 100%; }

/* entry chooser overlay (guide-style) */
.sec-chooser { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(43,38,32,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.scc-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-md); padding: 22px 18px; }
.scc-head { text-align: center; margin-bottom: 16px; }
.scc-title { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.scc-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.scc-opt {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 14px 14px; margin: 10px 0; border: 1px solid var(--hair); border-radius: 15px;
  background: var(--bg); cursor: pointer; transition: transform .1s, border-color .2s, box-shadow .2s;
}
.scc-opt:active { transform: scale(.985); }
@media (hover: hover) { .scc-opt:hover { border-color: var(--hair-2); box-shadow: var(--shadow-sm); } }
.scc-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: radial-gradient(120% 120% at 30% 20%, #cf6347, var(--clay) 55%, var(--clay-deep)); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.scc-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.scc-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scc-tx b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.scc-tx i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.scc-go { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* rules cards */
.rule-card { padding: 14px 15px; margin: 10px 0; background: var(--card); border: 1px solid var(--hair); border-left: 4px solid var(--clay); border-radius: 13px; box-shadow: var(--shadow-sm); }
.rule-card.clickable { cursor: pointer; transition: border-color .2s; }
@media (hover: hover) { .rule-card.clickable:hover { border-color: var(--hair-2); } }
.rc-name { font-family: var(--serif); font-size: 16.5px; font-weight: 600; color: var(--ink); }
.rc-ex { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--clay-deep); background: var(--clay-soft); padding: 1px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.rc-desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); margin-top: 7px; }
.rc-tip { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-top: 7px; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; }

/* 总表 index chips */
.idx-group { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--clay-deep); margin: 18px 2px 10px; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.vchip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 6px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; }
.vchip:active { transform: scale(.97); }
@media (hover: hover) { .vchip:hover { border-color: var(--hair-2); } }
.ch-inf { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--clay-deep); text-align: center; line-height: 1.2; }
.ch-zh { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }

/* detail · person × tense table */
.tense-tabs { display: flex; gap: 8px; margin: 16px 0 10px; }
.tt-btn { flex: 1 1 0; padding: 9px 6px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--card); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; }
.tt-btn.active { background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; border-color: transparent; }
.tense-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ttable { width: 100%; border-collapse: collapse; }
.ttable th, .ttable td { border: 1px solid var(--hair); padding: 8px 5px; text-align: center; }
.ttable thead th { background: var(--bg-2); font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.ttable thead th i { display: block; font-style: normal; font-size: 9px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.ttable .tt-p { background: var(--clay-soft); color: var(--clay-deep); font-family: var(--sans); font-weight: 700; font-size: 12.5px; width: 42px; }
.ttable tbody td { font-family: var(--serif); font-size: 14px; color: var(--ink); }

/* detail · per-form speak buttons (Web Speech, tts.js) */
.say {
  position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 24px; height: 24px; margin-left: 3px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--clay); cursor: pointer;
}
/* invisible hit-area extension (36×36 effective) — table rows are ~40px apart,
   so neighbouring rows' extended areas don't overlap */
.say::after { content: ""; position: absolute; inset: -6px; }
.say svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.say:active, .say.speaking { background: var(--clay); color: #fff; }
.conj-inf .say { width: 32px; height: 32px; margin-left: 6px; }
.conj-inf .say svg { width: 19px; height: 19px; }

/* detail · impératif block */
.imp-box { margin: 18px 0 6px; }
.imp-h { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 9px; border-bottom: 2px solid var(--clay-soft); padding-bottom: 6px; }

/* detail · periphrase formulas */
.peri-box { margin: 18px 0 6px; }
.peri-h { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-bottom: 8px; }
.peri { padding: 11px 13px; margin: 8px 0; background: var(--bg-2); border-radius: 11px; border-left: 3px solid var(--clay-soft); }
.peri-name { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--ink); }
.peri-name span { font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: 5px; }
.peri-f { font-size: 13px; line-height: 1.75; color: var(--ink-soft); margin-top: 6px; }
.peri-f b { font-family: var(--serif); color: var(--clay-deep); }
.peri-f em { font-family: var(--serif); font-style: normal; font-weight: 600; color: var(--ink); }
.pf-mn { color: var(--muted); }
.pf-note { display: block; font-size: 11.5px; color: var(--amber); margin-top: 3px; }

/* detail · save custom verb */
.save-btn { display: block; width: 100%; margin: 22px 0 6px; padding: 13px; border: 1px dashed var(--clay); border-radius: 13px; background: var(--clay-tint); color: var(--clay-deep); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.save-btn.done { border-style: solid; color: var(--green); background: #eef6ef; border-color: #bfe0c4; }
.imp-h span { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }

/* add-custom bar (under the global search) */
.conj-addbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 14px 10px; }
.add-verb-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border: 1px solid var(--clay); border-radius: 999px; background: var(--clay-tint); color: var(--clay-deep); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.add-verb-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.addbar-hint { font-size: 11px; color: var(--muted); }

/* 常用词 · two columns */
.common-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.common-grid .verb-card { margin: 0; padding: 12px; }
.common-grid .vk-go { display: none; }
.common-grid .vk-main { flex-direction: column; align-items: flex-start; gap: 1px; }
.common-grid .vk-inf { font-size: 17px; }

/* 规则 · drill-down */
.rc-fr { font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.rule-card.clickable { position: relative; padding-right: 38px; cursor: pointer; }
.rule-card .rc-go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rule-card.uni { border-left-color: var(--amber); font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); }
.rc-desc.pad { padding: 2px 2px 6px; }
.end-tbl { width: auto; min-width: 62%; margin: 8px 0 14px; }
.end-tbl tbody td { font-family: var(--serif); font-size: 15px; }
.rc-exh { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--clay-deep); margin: 18px 0 9px; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-chip { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--clay-deep); background: var(--clay-tint); border: 1px solid var(--hair-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.ex-chip.plain { color: var(--ink-soft); background: var(--bg-2); cursor: default; }
/* 规则 home — grouped section headings (展示逻辑分层) */
.rule-sec { display: flex; align-items: baseline; gap: 9px; margin: 22px 4px 8px; }
.rule-sec:first-of-type { margin-top: 6px; }
.rs-tag { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--clay); padding: 3px 10px; border-radius: 999px; }
.rs-sub { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
/* family-detail key-change callout */
.fam-key { font-size: 13px; line-height: 1.6; color: var(--clay-deep); background: var(--clay-tint); border: 1px solid var(--hair-2); border-radius: 10px; padding: 9px 12px; margin: 6px 0 14px; }

/* 复合过去 · mountain mnemonic */
.mtn { background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 12px 12px 14px; box-shadow: var(--shadow-sm); }
.mtn-svg { display: block; width: 100%; height: 86px; margin-bottom: 6px; }
.mtn-band { padding: 7px 9px; margin: 6px 0; border-radius: 9px; border-left: 3px solid var(--hair-2); background: var(--bg-2); }
.mb-tag { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
.mb-verbs { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.mverb { font-size: 12.5px; color: var(--muted); }
.mverb b { font-family: var(--serif); font-size: 14px; color: var(--ink); margin-right: 3px; }
.band-peak { border-left-color: var(--amber); background: #fdf3e0; }
.band-up { border-left-color: var(--green); background: #eef6ef; }
.band-down { border-left-color: var(--clay); background: var(--clay-tint); }
.band-side { border-left-color: var(--hair-2); }
.band-life { border-left-color: #8a6db0; background: #f1ecf6; }

/* 复合过去 · supplementary rules */
.pc-rules { margin: 16px 0 6px; padding-left: 20px; }
.pc-rules li { font-size: 13px; line-height: 1.8; color: var(--ink-soft); margin: 7px 0; }
.pc-rules b { color: var(--clay-deep); }

/* 复合过去 · mountain (triangular, clickable) */
.mtn-legend { font-size: 11.5px; color: var(--muted); margin: -2px 0 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mtn-legend .lg-up { color: var(--green); font-weight: 600; }
.mtn-legend .lg-down { color: var(--clay); font-weight: 600; }
.mtn2 { position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 12px 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.mtn2-bg { position: absolute; left: 0; top: 10px; width: 100%; height: calc(100% - 20px); opacity: .45; z-index: 0; }
.mtn2-rows { position: relative; z-index: 1; }
.m-row { display: flex; justify-content: space-between; align-items: center; margin: 5px 0; }
.m-peak { justify-content: center; }
.m-lv1 { padding: 0 28%; } .m-lv2 { padding: 0 19%; } .m-lv3 { padding: 0 10%; } .m-lv4 { padding: 0 2%; }
.m-base { padding: 0; margin-top: 4px; }
.mtn3 { position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 10px 7px; box-shadow: var(--shadow-sm); overflow: hidden; }
.mtn3-bg { position: absolute; left: 0; bottom: 8px; width: 100%; height: calc(100% - 16px); opacity: .5; z-index: 0; }
.mtn3-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(33px, auto); gap: 3px 1px; align-items: center; }
.mv { justify-self: center; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; border: 1px solid var(--hair-2); border-radius: 8px; padding: 3px 7px; background: rgba(255,253,250,.96); box-shadow: 0 1px 2px rgba(43,38,32,.06); cursor: pointer; white-space: nowrap; }
.mv b { font-family: var(--serif); font-size: 12.5px; color: var(--ink); }
.mv em { font-style: normal; font-size: 8.5px; color: var(--muted); }
.mv.plain { cursor: default; }
.mtn-note { font-size: 11.5px; line-height: 1.55; color: var(--muted); margin: -2px 0 9px; }
.m-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 9px; margin-top: 10px; padding: 9px 11px; background: var(--bg-2); border-radius: 10px; }
.m-foot-tag { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.m-foot .mv { background: var(--card); }

.idx-group.mt { margin-top: 26px; }
.conj-msg.sm { padding: 14px 8px; font-size: 13.5px; }

/* conjugation guide carousel (reuses global .guide-* dark theme) */
.cg-shot { align-items: stretch; gap: 0; }
.cg-bigicon { display: flex; align-items: center; justify-content: center; height: 96px; }
.cg-bigicon svg { width: 52px; height: 52px; fill: none; stroke: var(--clay); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cg-row { display: flex; align-items: baseline; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--hair); }
.cg-row:last-child { border-bottom: none; }
.cg-row b { font-family: var(--serif); font-size: 15px; color: var(--clay-deep); min-width: 52px; }
.cg-row span { font-size: 12.5px; color: var(--muted); }
.cg-pick { justify-content: center; }
.cg-opts { width: 100%; max-width: 300px; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.cg-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; text-align: left; transition: background .15s; }
.cg-opt:active { background: rgba(255,255,255,.13); }
.cg-opt b { font-family: var(--serif); font-size: 16px; }
.cg-opt i { font-style: normal; font-size: 12px; color: #a8a8af; }

/* mountain base middle: venir / retourner / passer placed on the mountain */
.m-mid { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.mv-side { padding: 3px 7px; }
.mv-side b { font-size: 12px; }
.mv-side em { font-size: 9px; }

/* custom verb chip with a delete × */
.vchip.cust { position: relative; padding-top: 15px; }
.ch-del { position: absolute; top: 0; right: 3px; width: 20px; height: 20px; line-height: 18px; text-align: center; border-radius: 50%; color: var(--muted); font-size: 17px; font-weight: 400; }
.ch-del:active { background: var(--clay-soft); color: var(--clay-deep); }
@media (hover: hover) { .ch-del:hover { color: var(--clay-deep); } }

/* 测验 (conjugation quiz) — reuses global .quiz-* */
.quiz-person { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--clay-deep); margin: 2px 0 16px; }
.quiz-opt-label { font-size: 12.5px; color: var(--muted); margin: 18px 0 9px; text-align: center; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.quiz-opts + .quiz-opts { margin-top: 8px; }
.quiz-chip { padding: 8px 11px; border: 1px solid var(--hair-2); border-radius: 999px; background: var(--card); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.quiz-chip.on { background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; border-color: transparent; }
.quiz-start { display: block; width: 100%; max-width: 280px; margin: 22px auto 8px; }
.quiz-feedback .ans-full { color: var(--muted); font-weight: 400; margin-left: 6px; font-family: var(--serif); }

/* ===================== 本次更新 popup (changelog.js, all pages) ===================== */
/* z-index 95: below the Zeus card (100) and the first-run guides (110) */
.upd-overlay {
  position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(43,38,32,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.upd-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-md); padding: 20px 20px 18px; }
.upd-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.upd-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #fff; background: linear-gradient(160deg, var(--clay), var(--clay-deep)); padding: 3px 8px; border-radius: 999px; }
.upd-title { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); }
.upd-ver { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upd-list { margin: 0; padding: 0 0 0 18px; }
.upd-list li { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); margin: 7px 0; }
.upd-list li::marker { color: var(--clay); }
.upd-ok {
  display: block; width: 100%; margin-top: 16px; padding: 12px; border: none; border-radius: 13px;
  background: linear-gradient(160deg, var(--clay), var(--clay-deep)); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-sm);
}
.upd-ok:active { transform: scale(.98); }

/* ===================== 语法助手 (grammar.html) ===================== */
/* Chinese-first headings: same serif family, slightly smaller than French */
.conj-inf.zhc { font-size: 24px; }
.vk-inf.zhc { font-size: 16.5px; }
.rc-count { font-size: 11.5px; font-weight: 600; color: var(--clay-deep); margin-top: 8px; }
.gr-lv { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: var(--clay-deep); background: var(--clay-soft); padding: 2px 7px; border-radius: 999px; }

/* topic detail: example sentences (speakable) */
.gr-ex { margin: 10px 0 4px; }
.gx-item { padding: 9px 12px; margin: 8px 0; background: var(--bg-2); border-left: 3px solid var(--clay-soft); border-radius: 9px; }
.gx-fr { font-family: var(--serif); font-size: 15.5px; line-height: 1.45; color: var(--ink); }
.gx-zh { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.gr-rule { margin: 10px 0; font-size: 13px; }
.gr-tbl th, .gr-tbl td { font-size: 13px; }
/* grammar tables: unlike conjugation tables they may have many columns and
   long Chinese row labels — let them take their natural width and scroll
   horizontally inside .tense-wrap instead of crushing every column */
.gr-tbl { width: auto; min-width: 100%; }
.gr-tbl .tt-p { width: auto; min-width: 42px; white-space: nowrap; }
.conj-note.pitn { background: var(--clay-tint); border-color: #eccab9; color: var(--clay-deep); }

/* 易错 pitfall cards */
.pit-card {
  position: relative; padding: 13px 38px 13px 15px; margin: 9px 0;
  background: var(--card); border: 1px solid var(--hair); border-left: 4px solid var(--clay); border-radius: 13px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .2s;
}
@media (hover: hover) { .pit-card:hover { border-color: var(--hair-2); } }
.pit-card:active { transform: scale(.99); }
.pit-card .vk-go { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.pc-title { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.pc-text { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin-top: 6px; }

/* grammar quiz: multiple-choice options */
.gr-quiz { text-align: left; }
.gr-quiz .quiz-prompt-label, .gr-quiz .gr-q { text-align: center; }
.gr-q { font-family: var(--serif); font-size: 21px; }
.qz-opts { margin-top: 16px; }
.qz-opt {
  display: block; width: 100%; text-align: left; padding: 12px 14px; margin: 8px 0;
  border: 1px solid var(--hair-2); border-radius: 12px; background: var(--bg);
  font-family: var(--serif); font-size: 15.5px; color: var(--ink); cursor: pointer; transition: border-color .15s;
}
@media (hover: hover) { .qz-opt:not(:disabled):hover { border-color: var(--clay); } }
.qz-opt.ok { border-color: var(--green); background: #eef6ef; font-weight: 600; }
.qz-opt.no { border-color: var(--clay); background: var(--clay-tint); }
.qz-opt.dim { opacity: .5; }
.gr-fb { font-weight: 400; line-height: 1.6; }
.gr-fb .gr-why { color: var(--ink-soft); font-size: 13.5px; }
.gr-fb.ok .gr-why, .gr-fb.no .gr-why { font-weight: 400; }
.gr-full { font-family: var(--serif); font-size: 15.5px; color: var(--ink); margin-top: 8px; }
