:root {
  --paper: #f7f2ea;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #221d18;
  --ink-2: #4d453c;
  --muted: #94897b;
  --red: #c73e2a;
  --red-dark: #a02f1f;
  --red-deep: #7c2317;
  --gold: #e2a93d;
  --line: #e7ddcd;
  --lvl0: #221d18;
  --lvl1: #3e9464; --lvl2: #2f7fa8; --lvl3: #7b5fc0;
  --lvl4: #cf7622; --lvl5: #c73e2a; --lvl6: #6d4434;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -100px, #fdf8ef 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
}
a { color: var(--red); text-decoration: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- header (floating glass bar) ---------- */
.top { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 14px 0 6px; padding: 9px 10px 9px 12px;
  background: rgba(255,253,249,.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 22px rgba(70,45,25,.08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800;
  font-size: .98rem; color: var(--ink); letter-spacing: .01em;
  flex: 1 1 auto; min-width: 0; }
.brand .seal { flex: 0 0 auto; display: inline-flex; align-items: center;
  justify-content: center; width: 36px; height: 36px; background:
  linear-gradient(150deg, #de5335, var(--red-dark)); color: #fff;
  border-radius: 6px; font-family: var(--serif); font-weight: 900;
  font-size: 1.2rem; box-shadow: 0 3px 10px rgba(199,62,42,.35);
  transform: rotate(-4deg); transition: transform .18s; }
.brand:hover .seal { transform: rotate(0deg); }
.brand .bname { display: block; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-width: 0; }
.nav-menu { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.nav-burger, .nav-close { display: none; border: none; background: transparent;
  font-size: 1.25rem; color: var(--ink-2); cursor: pointer; padding: 6px 10px;
  font-family: inherit; }
.nav-backdrop { display: none; }
.nl { display: none; }              /* desktop: icons + tooltips only */
.nav-menu > .nav-link[href*="words"] .nl { display: inline; } /* keep "Words" text */

.menu-head { display: none; }
@media (max-width: 719px) {
  /* backdrop-filter 会让内部 position:fixed 的抽屉被困在导航条的层叠上下文里
     (被正文盖住),移动端关掉它,抽屉才能真正悬浮于全页之上 */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-burger { display: block; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 110;
    background: rgba(25,18,12,.55); opacity: 0; pointer-events: none;
    transition: opacity .22s; display: block;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .nav-backdrop.show { opacity: 1; pointer-events: auto; }
  .nav-menu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 120;
    width: min(80vw, 310px);
    background: linear-gradient(175deg, var(--card) 60%, var(--paper-2));
    box-shadow: -12px 0 40px rgba(0,0,0,.25);
    flex-direction: column; align-items: stretch; gap: 3px;
    padding: 16px 16px 18px; transform: translateX(105%);
    transition: transform .28s cubic-bezier(.4,.1,.2,1); overflow-y: auto; }
  .nav-menu.open { transform: none; }
  /* items glide in after the panel, top to bottom */
  .nav-menu > * { opacity: 0; transform: translateX(16px);
    transition: opacity .3s ease, transform .3s ease; }
  .nav-menu.open > * { opacity: 1; transform: none; }
  .nav-menu.open > *:nth-child(2) { transition-delay: .05s; }
  .nav-menu.open > *:nth-child(3) { transition-delay: .09s; }
  .nav-menu.open > *:nth-child(4) { transition-delay: .13s; }
  .nav-menu.open > *:nth-child(5) { transition-delay: .17s; }
  .nav-menu.open > *:nth-child(6) { transition-delay: .21s; }
  .nav-menu.open > *:nth-child(7) { transition-delay: .25s; }
  .nav-menu.open > *:nth-child(8) { transition-delay: .29s; }
  .nav-menu.open > *:nth-child(9) { transition-delay: .33s; }
  .nav-close { display: block; position: absolute; top: 14px; right: 12px;
    z-index: 2; width: 34px; height: 34px; padding: 0; border-radius: 8px;
    font-size: 1.05rem; background: var(--paper-2); color: var(--ink-2); }
  .nl { display: inline; }
  .menu-head { display: flex; align-items: center; gap: 11px;
    padding: 6px 4px 16px; margin-bottom: 12px;
    border-bottom: 1px solid var(--line); }
  .mh-seal { flex: 0 0 auto; display: inline-flex; align-items: center;
    justify-content: center; width: 44px; height: 44px;
    background: linear-gradient(150deg, #de5335, var(--red-dark)); color: #fff;
    border-radius: 8px; font-family: var(--serif); font-weight: 900;
    font-size: 1.5rem; box-shadow: 0 4px 12px rgba(199,62,42,.35);
    transform: rotate(-4deg); }
  .mh-t b { display: block; font-size: 1rem; line-height: 1.3; }
  .mh-t i { display: block; font-style: normal; font-size: .74rem;
    color: var(--muted); }
  .nav-menu .nav-link { width: 100%; text-align: left; padding: 12px 12px;
    font-size: .97rem; border-radius: 8px; }
  .nav-menu .nav-cta { width: 100%; justify-content: center; margin-top: auto;
    padding: 12px; }
  #t-auth { background: linear-gradient(180deg, #e0512f, var(--red-dark));
    color: #fff; text-align: center; font-weight: 700; margin-bottom: 10px;
    box-shadow: 0 5px 16px rgba(199,62,42,.35); }
  #t-auth.signed { background: var(--paper-2); color: var(--ink);
    box-shadow: none; }
}
.nav-link { padding: 8px 12px; border-radius: 8px; font-size: .9rem;
  font-weight: 650; color: var(--ink-2); transition: all .15s;
  border: none; background: transparent; cursor: pointer; font-family: inherit; }
.nav-link:hover { background: #f6efe3; color: var(--ink); }
.nav-cta { display: inline-flex; align-items: center; gap: 6px;
  background: #1877f2; color: #fff; padding: 8px 15px; border-radius: 8px;
  font-weight: 700; font-size: .87rem;
  box-shadow: 0 4px 14px rgba(24,119,242,.35); transition: transform .15s; }
.nav-cta:hover { transform: translateY(-1px); color: #fff; }
@media (max-width: 480px) {
  .brand .bname { font-size: .9rem; }
  .nav-link { padding: 8px 9px; font-size: .87rem; }
}

/* ---------- hero carousel ---------- */
.carousel { position: relative; margin: 14px 0 6px; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: 10px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 16px 44px rgba(70,35,26,.25); }
.hero-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always;
  position: relative; overflow: hidden; text-align: center;
  padding: 30px 24px 44px; color: #f7efe3;
  background: linear-gradient(150deg, #2c211b 0%, #46231a 55%, #6d2417 100%); }
.slide::before { content: attr(data-char); position: absolute; right: -22px;
  top: -38px; font-family: var(--serif); font-size: 9.5rem; font-weight: 900;
  color: rgba(255,255,255,.06); pointer-events: none; line-height: 1; }
.slide.feat { background: linear-gradient(150deg, #26201b 0%,
  color-mix(in srgb, var(--sc) 34%, #26201b) 58%, var(--sc) 130%); }
.slide h1 { font-size: clamp(1.35rem, 4.6vw, 2.1rem); line-height: 1.25;
  letter-spacing: -.01em; font-weight: 800; }
.slide h1 .zh { font-family: var(--serif); color: var(--gold); font-weight: 900; }
.slide p { color: #dbcdb9; margin: 9px auto 0; font-size: .93rem;
  max-width: 440px; }
.slide .cta { margin-top: 15px; display: inline-block;
  background: linear-gradient(180deg, #e0512f, var(--red-dark));
  color: #fff; padding: 9px 20px; border-radius: 8px; font-weight: 700;
  font-size: .9rem; box-shadow: 0 6px 18px rgba(199,62,42,.4);
  transition: transform .15s; }
.slide .cta:hover { transform: translateY(-2px); }
.slide.feat .cta { background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.slide.feat .cta:hover { background: rgba(255,255,255,.26); }
.feat-tag { display: inline-block; font-size: .72rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: #fff;
  background: rgba(255,255,255,.16); border-radius: 8px; padding: 3px 12px; }
.feat-zh { font-family: var(--serif); font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 900; color: #fff; margin-top: 10px; }
.feat-py { color: var(--gold); font-size: .95rem; margin-top: 2px; }
.dots { position: absolute; left: 0; right: 0; bottom: 13px; display: flex;
  gap: 6px; justify-content: center; z-index: 5; }
.dot { width: 7px; height: 7px; border-radius: 999px; border: none; padding: 0;
  background: rgba(255,255,255,.35); cursor: pointer; transition: all .25s; }
.dot.on { background: #fff; width: 20px; }

/* ---------- level filter (segmented control) ---------- */
.levels { display: flex; justify-content: center; margin: 30px 0 4px;
  padding: 0 2px; }
.seg { position: relative; display: inline-flex; gap: 3px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 5px;
  box-shadow: 0 5px 16px rgba(70,45,25,.08);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar { display: none; }
.seg-ind { position: absolute; top: 5px; bottom: 5px; left: 0; width: 0;
  border-radius: 6px; background: var(--lvl0); opacity: 0;
  box-shadow: 0 3px 10px rgba(40,30,20,.25);
  transition: left .28s cubic-bezier(.5,.1,.2,1),
    width .28s cubic-bezier(.5,.1,.2,1), background-color .28s; }
.seg-ind.ready { opacity: 1; }
.lvl-chip { position: relative; z-index: 1; border: none;
  background: transparent; border-radius: 6px;
  padding: 8px 14px; font-size: .87rem; font-weight: 700; color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: color .28s, background .15s; font-family: inherit; }
.lvl-chip .n { margin-left: 5px; font-size: .7rem; opacity: .6;
  font-weight: 700; }
.lvl-chip:hover { color: var(--ink); background: #f6efe3; }
.lvl-chip.on { color: #fff;
  box-shadow: 0 3px 10px rgba(40,30,20,.25); }
.lvl-chip.on .n { opacity: .85; }
.lvl-chip[data-l="0"].on { background: var(--lvl0); }
.lvl-chip[data-l="1"].on { background: var(--lvl1); }
.lvl-chip[data-l="2"].on { background: var(--lvl2); }
.lvl-chip[data-l="3"].on { background: var(--lvl3); }
.lvl-chip[data-l="4"].on { background: var(--lvl4); }
.lvl-chip[data-l="5"].on { background: var(--lvl5); }
.lvl-chip[data-l="6"].on { background: var(--lvl6); }
/* once JS drives the sliding indicator, the chip itself goes transparent */
.seg.hasind .lvl-chip.on { background: transparent; box-shadow: none; }
.seg.hasind .lvl-chip:hover:not(.on) { background: #f6efe3; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 14px; padding: 22px 0 44px; }
@media (min-width: 580px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { position: relative; display: flex; gap: 16px; align-items: flex-start;
  background: linear-gradient(170deg, #fffefb, #fdf9f1);
  border: 1px solid var(--line); border-radius: 10px; padding: 18px;
  color: var(--ink);
  transition: box-shadow .18s, transform .18s, border-color .18s; }
.card:hover { box-shadow: 0 16px 38px rgba(70,45,25,.14);
  transform: translateY(-3px); border-color: var(--lc, var(--red)); }
.card[data-l="1"] { --lc: var(--lvl1); } .card[data-l="2"] { --lc: var(--lvl2); }
.card[data-l="3"] { --lc: var(--lvl3); } .card[data-l="4"] { --lc: var(--lvl4); }
.card[data-l="5"] { --lc: var(--lvl5); } .card[data-l="6"] { --lc: var(--lvl6); }
.card .tile { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 900; font-size: 2rem; color: #fff;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--lc) 82%, white) 0%, var(--lc) 60%,
    color-mix(in srgb, var(--lc) 78%, black) 100%);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--lc) 45%, transparent),
    inset 0 1px 0 rgba(255,255,255,.35);
  transform: rotate(-4deg); transition: transform .18s;
  text-shadow: 0 2px 6px rgba(0,0,0,.25); }
.card:hover .tile { transform: rotate(0deg) scale(1.05); }
.card .card-main { flex: 1; min-width: 0; }
.card .zh-title { font-family: var(--serif); font-size: 1.42rem; font-weight: 700;
  line-height: 1.3; }
.card .py-title { color: var(--muted); font-size: .85rem; margin-top: 0; }
.card .en-title { font-size: .93rem; margin-top: 6px; color: var(--ink-2); }
.card .meta { margin-top: 11px; display: flex; align-items: center; gap: 9px;
  font-size: .78rem; color: var(--muted); }
.card .go { margin-left: auto; font-weight: 700; font-size: .85rem;
  color: var(--muted); transition: color .15s, transform .15s; }
.card:hover .go { color: var(--lc, var(--red)); transform: translateX(3px); }
.badge { display: inline-block; color: #fff; border-radius: 4px;
  padding: 2.5px 9px; font-size: .74rem; font-weight: 800; letter-spacing: .03em; }
.badge.l1 { background: var(--lvl1); } .badge.l2 { background: var(--lvl2); }
.badge.l3 { background: var(--lvl3); } .badge.l4 { background: var(--lvl4); }
.badge.l5 { background: var(--lvl5); } .badge.l6 { background: var(--lvl6); }

/* ---------- reader ---------- */
.reader-banner { position: relative; overflow: hidden; margin-top: 14px;
  border-radius: 10px; padding: 28px 26px 26px; color: #fff;
  background: linear-gradient(150deg, #26201b 0%,
    color-mix(in srgb, var(--sc) 34%, #26201b) 58%, var(--sc) 130%);
  box-shadow: 0 14px 38px rgba(40,25,15,.22); }
.reader-banner::before { content: attr(data-char); position: absolute;
  right: -20px; top: -34px; font-family: var(--serif); font-size: 9rem;
  font-weight: 900; color: rgba(255,255,255,.07); pointer-events: none;
  line-height: 1; }
.reader-banner h1 { font-family: var(--serif);
  font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 900; margin-top: 10px; }
.b-py { color: var(--gold); font-size: 1rem; margin-top: 2px; }
.b-en { color: rgba(255,255,255,.72); font-size: .9rem; margin-top: 7px; }

.paper-card { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 20px 14px; margin-top: 8px;
  box-shadow: 0 10px 30px rgba(70,45,25,.07); }
.caption { font-size: .8rem; color: var(--muted); padding: 12px 4px 6px;
  border-top: 1px solid var(--line); margin-top: 4px; }
.reader-foot { display: flex; justify-content: space-between;
  align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 46px; }
.reader-foot .tbtn { text-decoration: none; display: inline-block; }
.toolbar { position: sticky; top: 10px; z-index: 20;
  background: rgba(255,253,249,.88); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(70,45,25,.10);
  padding: 9px 10px; margin: 14px 0 6px;
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.tb-play { display: inline-flex; align-items: center; gap: 7px; border: none;
  background: linear-gradient(180deg, #e0512f, var(--red-dark)); color: #fff;
  border-radius: 8px; padding: 9px 17px; font-size: .88rem; font-weight: 800;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 5px 14px rgba(199,62,42,.35); transition: all .12s; }
.tb-play:hover { transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(199,62,42,.45); }
.tb-play:active { transform: scale(.96); }
.tbtn { border: none; background: #f3ecdd; color: var(--ink-2);
  border-radius: 8px; padding: 9px 15px; font-size: .86rem; font-weight: 700;
  cursor: pointer; transition: all .12s; font-family: inherit; }
.tbtn:hover { background: #ece2cd; color: var(--ink); }
.tbtn.on { background: #fdeae2; color: var(--red-dark);
  box-shadow: inset 0 0 0 1.5px var(--red); }
.tbtn:active { transform: scale(.96); }
select.tb-voice { max-width: 150px; appearance: none; -webkit-appearance: none;
  background-color: #fff; border: 1px solid var(--line);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394897b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  background-size: 16px; padding-right: 28px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.text-body { padding: 10px 0 4px; }
.sent { padding: 14px 6px; border-bottom: 1px dashed var(--line);
  border-radius: 0; transition: background .15s; }
.sent:last-of-type { border-bottom: none; }
.sent:hover { background: #fdf8ee; border-radius: 8px; }
.sent.playing { background: #fdf3df; border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--gold); }
.zh-line { font-family: var(--serif);
  font-size: clamp(1.28rem, 3.8vw, 1.5rem); line-height: 2.5;
  font-weight: 600; }
.nb { display: inline-block; white-space: nowrap; }
ruby rt { font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: .72rem; color: var(--red-dark); opacity: .92; font-weight: 500;
  letter-spacing: .01em; }
body.no-pinyin ruby rt { display: none; }
.w { cursor: pointer; border-radius: 4px; padding: 0 1px;
  transition: background .12s; }
.w:hover, .w.hl { background: #f7e4b5; }
.punct { color: var(--ink-2); }
.s-play { border: none; background: #f4ecdd; width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: .8rem; color: var(--red-dark);
  vertical-align: middle; margin-left: 8px; transition: all .12s; }
.s-play:hover { background: var(--red); color: #fff; }
.en-line { display: none; color: var(--muted); font-size: .97rem;
  margin-top: 2px; padding-left: 2px; border-left: 3px solid var(--gold);
  padding-left: 10px; }
body.show-en .en-line { display: block; }

/* ---------- vocab ---------- */
.vocab { margin: 26px 0 22px; }
.vocab h2 { font-size: 1.05rem; margin-bottom: 12px; letter-spacing: .02em; }
.vocab h2 .zh { font-family: var(--serif); color: var(--red); margin-left: 6px; }
.vgrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .vgrid { grid-template-columns: 1fr 1fr; } }
.vitem { display: flex; gap: 13px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 14px;
  transition: box-shadow .15s, transform .15s; }
.vitem:hover { box-shadow: 0 8px 20px rgba(70,45,25,.09);
  transform: translateY(-1px); }
.vitem .s-play { flex: 0 0 auto; width: 36px; height: 36px; margin: 0; }
.vtext { min-width: 0; }
.vzh { font-family: var(--serif); font-size: 1.28rem; font-weight: 700;
  margin-right: 8px; }
.vpy { color: var(--red-dark); font-size: .87rem; }
.ven { display: block; color: var(--ink-2); font-size: .88rem; margin-top: 1px; }

/* ---------- word popover ---------- */
#pop { position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: 20px; z-index: 50;
  background: linear-gradient(160deg, #2e2620, #1c1712);
  color: #fff; border-radius: 10px; padding: 14px 22px; display: none;
  box-shadow: 0 16px 44px rgba(0,0,0,.35); max-width: min(92vw, 440px);
  text-align: center; opacity: 0;
  transition: opacity .18s, transform .18s; }
#pop.show { display: block; opacity: 1;
  transform: translateX(-50%) translateY(0); }
#pop .p-zh { font-family: var(--serif); font-size: 1.65rem; font-weight: 800; }
#pop .p-py { color: var(--gold); font-size: 1.02rem; margin: 0 10px; }
#pop .p-en { display: block; font-size: .93rem; opacity: .88; margin-top: 4px; }
#pop button { background: rgba(255,255,255,.14); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 8px; font-size: .95rem;
  cursor: pointer; margin-left: 6px; vertical-align: middle; }
#pop button:hover { background: var(--red); }

/* ---------- quiz ---------- */
.quiz { margin: 2px 0 26px; }
.quiz h2 { font-size: 1.05rem; margin-bottom: 12px; letter-spacing: .02em; }
.quiz h2 .zh { font-family: var(--serif); color: var(--red); margin-left: 6px; }
.qitem { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px 18px; margin-bottom: 10px; }
.qq { font-weight: 700; margin-bottom: 10px; font-size: .96rem; }
.qopts { display: flex; flex-direction: column; gap: 8px; }
.qopt { text-align: left; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; padding: 10px 14px; font-size: .92rem;
  font-family: inherit; cursor: pointer; transition: all .12s;
  color: var(--ink-2); }
.qopt:hover { border-color: var(--gold); background: #fefaf1; }
.qitem.ans .qopt { cursor: default; }
.qitem.ans .qopt:hover { border-color: var(--line); background: #fff; }
.qopt.ok { background: #e7f4ec; border-color: #3e9464; color: #25623f;
  font-weight: 700; }
.qopt.ok:hover { background: #e7f4ec; border-color: #3e9464; }
.qopt.bad { background: #fdebe7; border-color: var(--red);
  color: var(--red-dark); }
.qopt.bad:hover { background: #fdebe7; border-color: var(--red); }
.qresult { background: linear-gradient(150deg, #26201b, #46231a);
  color: #f7efe3; border-radius: 8px; padding: 13px 18px; font-size: .95rem;
  text-align: center; margin-top: 4px; }
.qresult b { color: var(--gold); }

/* ---------- progress / streak ---------- */
.progress-strip { display: flex; justify-content: space-between;
  align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px;
  margin: 16px 0 0; font-size: .9rem; color: var(--ink-2);
  box-shadow: 0 6px 18px rgba(70,45,25,.06); }
.progress-strip .fire { font-weight: 800; color: var(--red-dark); }
.done-flag { color: #3e9464; font-weight: 800; }
.card.done .tile { opacity: .55; filter: saturate(.6); }
.today-flag { position: absolute; top: -9px; right: 14px;
  background: linear-gradient(180deg, #f0bd58, var(--gold)); color: #4a3608;
  border-radius: 8px; padding: 3px 11px; font-size: .73rem; font-weight: 800;
  box-shadow: 0 4px 10px rgba(226,169,61,.45); }

/* ---------- grammar note ---------- */
.grammar { margin: 2px 0 26px; }
.grammar h2 { font-size: 1.05rem; margin-bottom: 12px; letter-spacing: .02em; }
.grammar h2 .zh { font-family: var(--serif); color: var(--red); margin-left: 6px; }
.gitem { background: linear-gradient(160deg, #fdf6e7, #fbf0d8);
  border: 1px solid #efdcae; border-radius: 8px; padding: 16px 18px;
  margin-bottom: 10px; }
.gp { font-weight: 800; color: #6d4f16; font-size: .98rem; }
.gitem p { margin-top: 7px; font-size: .92rem; color: #6b5a33; }
.gx { margin-top: 9px; font-size: .95rem; color: #4a3d20;
  border-left: 3px solid var(--gold); padding-left: 10px;
  font-family: var(--serif); }

/* ---------- search ---------- */
.searchbar { margin: 22px 0 -14px; }
#search { width: 100%; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 12px 20px; font-size: .95rem;
  font-family: inherit; color: var(--ink); outline: none;
  box-shadow: 0 5px 16px rgba(70,45,25,.06); transition: border-color .15s; }
#search:focus { border-color: var(--red); }
#search::placeholder { color: var(--muted); }

/* ---------- words page ---------- */
.wlist { display: grid; gap: 10px; padding: 20px 0 44px;
  grid-template-columns: 1fr; }
@media (min-width: 640px) { .wlist { grid-template-columns: 1fr 1fr; } }
.wlist .vitem { align-items: flex-start; }
.wlist .vtext { flex: 1; }
.wlist .badge { vertical-align: 2px; margin-left: 4px; }
.wlist .wstar { flex: 0 0 auto; margin-top: 2px; }
.wstar { border: none; background: none; font-size: 1.25rem; cursor: pointer;
  color: #cdbfa8; transition: color .12s, transform .12s; padding: 2px 4px; }
.wstar:hover { transform: scale(1.15); }
.wstar.saved { color: var(--gold); }
#pop .wstar { color: rgba(255,255,255,.5); }
#pop .wstar.saved { color: var(--gold); }

/* ---------- wordbook / flashcards ---------- */
.wb-actions { margin: 4px 0 6px; }
.wb-empty { color: var(--muted); padding: 26px 0 40px; }
.deck { margin: 14px 0 44px; }
.deck-card { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; min-height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 26px;
  text-align: center; box-shadow: 0 12px 32px rgba(70,45,25,.10); }
.deck-card .dz { font-family: var(--serif); font-size: 3rem; font-weight: 900; }
.deck-card .dp { color: var(--red-dark); font-size: 1.15rem; }
.deck-card .de { color: var(--ink-2); }
.deck-card .dhint { color: var(--muted); font-size: .85rem; }
.deck-btns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ---------- dark mode ---------- */
html[data-theme="dark"] {
  --paper: #17130f; --paper-2: #1e1913; --card: #221c16;
  --ink: #ece2d3; --ink-2: #c8bba7; --muted: #8d8172; --line: #372e24;
}
html[data-theme="dark"] body {
  background: radial-gradient(1200px 500px at 80% -100px, #201a13 0%, transparent 60%),
    var(--paper); }
html[data-theme="dark"] .top,
html[data-theme="dark"] .toolbar { background: rgba(30,25,19,.85); }
html[data-theme="dark"] .tbtn { background: #2d261e; color: var(--ink-2); }
html[data-theme="dark"] .tbtn:hover { background: #362e24; color: var(--ink); }
html[data-theme="dark"] .tbtn.on { background: #3c241c; color: #ff9a7d; }
html[data-theme="dark"] select.tb-voice,
html[data-theme="dark"] .qopt,
html[data-theme="dark"] #search { background-color: #221c16; color: var(--ink-2); }
html[data-theme="dark"] .qopt.ok { background: #1d2f24; color: #8fd3a8; }
html[data-theme="dark"] .qopt.bad { background: #35201a; color: #ff9a7d; }
html[data-theme="dark"] .sent:hover { background: #272017; }
html[data-theme="dark"] .sent.playing { background: #2e2517; }
html[data-theme="dark"] .card { background: linear-gradient(170deg, #241e17, #201a14); }
html[data-theme="dark"] .s-play { background: #33291f; color: #e0a276; }
html[data-theme="dark"] { --lvl0: #5a4a35; }
html[data-theme="dark"] .seg { background: #221c16; }
html[data-theme="dark"] .lvl-chip:hover,
html[data-theme="dark"] .seg.hasind .lvl-chip:hover:not(.on) { background: #2d261e; }
html[data-theme="dark"] ruby rt { color: #e0876a; }
html[data-theme="dark"] .gitem { background: linear-gradient(160deg, #2a2315, #251e10);
  border-color: #453a1e; }
html[data-theme="dark"] .gp { color: #e2b45c; }
html[data-theme="dark"] .gitem p { color: #bfae87; }
html[data-theme="dark"] .gx { color: #d3c39c; }

/* ---------- progress page ---------- */
.pg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 4px 0 24px; }
@media (max-width: 560px) { .pg-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 8px; text-align: center; }
.stat .s-i { font-size: 1.25rem; }
.stat .s-n { font-size: 1.7rem; font-weight: 800; font-family: var(--serif);
  line-height: 1.2; }
.stat .s-l { color: var(--muted); font-size: .78rem; }
.pgsec { margin: 0 0 26px; }
.pgsec h2 { font-size: 1.05rem; margin-bottom: 12px; }
.pgsec h2 .zh { font-family: var(--serif); color: var(--red); margin-left: 6px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .badges { grid-template-columns: repeat(2, 1fr); } }
.bd { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 10px; text-align: center;
  opacity: .45; filter: grayscale(1); }
.bd.got { opacity: 1; filter: none; border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(226,169,61,.2); }
.bd-i { font-size: 1.7rem; }
.bd-n { font-weight: 800; font-size: .88rem; margin-top: 4px; }
.bd-d { color: var(--muted); font-size: .74rem; margin-top: 2px; }
.cal { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px; margin-bottom: 40px; }
.cal-head { display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
  text-align: center; }
.cal-dow { color: var(--muted); font-size: .7rem; font-weight: 800; }
.cal-day { padding: 7px 0; border-radius: 6px; font-size: .84rem;
  color: var(--ink-2); }
.cal-day.on { background: var(--lvl1); color: #fff; font-weight: 800; }
.cal-day.td { outline: 2px solid var(--gold); }
.ps-link { font-weight: 800; }

/* ---------- auth modal ---------- */
#auth-modal { position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(25,18,12,.55); backdrop-filter: blur(4px); }
#auth-modal.show { display: flex; }
.am-box { position: relative; background: var(--card); border-radius: 10px;
  padding: 26px 24px 22px; width: min(92vw, 380px);
  box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.am-box h3 { font-size: 1.15rem; }
.am-box h3 span { color: var(--red); }
.am-sub { color: var(--muted); font-size: .88rem; margin: 4px 0 16px; }
.am-close { position: absolute; top: 12px; right: 12px; border: none;
  background: none; font-size: 1rem; color: var(--muted); cursor: pointer; }
.am-btn { display: flex; align-items: center; justify-content: center;
  gap: 9px; width: 100%; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; padding: 11px 14px; font-size: .93rem;
  font-weight: 700; font-family: inherit; cursor: pointer; margin-bottom: 9px;
  transition: all .12s; color: var(--ink); }
.am-btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.am-f { background: #1877f2; border-color: #1877f2; color: #fff; }
.am-f:hover { border-color: #1877f2; }
.am-e { background: var(--red); border-color: var(--red); color: #fff; }
.am-div { display: flex; align-items: center; gap: 10px; margin: 13px 0 11px;
  color: var(--muted); font-size: .78rem; }
.am-div::before, .am-div::after { content: ""; flex: 1; height: 1px;
  background: var(--line); }
.am-in { width: 100%; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; padding: 10px 14px; font-size: .93rem;
  font-family: inherit; color: var(--ink); margin-bottom: 9px; outline: none; }
.am-in:focus { border-color: var(--red); }
.am-err { background: #fdebe7; color: var(--red-dark); border-radius: 6px;
  padding: 8px 12px; font-size: .84rem; margin-bottom: 9px; }
.am-links { display: flex; justify-content: space-between; margin-top: 2px; }
.am-links button { border: none; background: none; color: var(--muted);
  font-size: .84rem; cursor: pointer; font-family: inherit; }
.am-links button:hover { color: var(--red); }
html[data-theme="dark"] .am-btn, html[data-theme="dark"] .am-in {
  background: #2a231c; color: var(--ink); }
html[data-theme="dark"] .am-f { background: #1877f2; color: #fff; }
html[data-theme="dark"] .am-e { background: var(--red); color: #fff; }

/* ---------- footer / about / notice ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 44px;
  color: var(--muted); font-size: .9rem; text-align: center; }
.footer a { margin: 0 9px; font-weight: 600; }
.about { padding: 36px 0 44px; max-width: 640px; }
.about h1 { font-family: var(--serif); font-size: 2rem; margin-bottom: 14px; }
.about p { margin-bottom: 13px; color: var(--ink-2); }
.notice { background: #fbf3df; border: 1px solid #efdcae; color: #7a5c22;
  border-radius: 8px; padding: 12px 16px; font-size: .86rem; margin: 16px 0; }

/* ---------- members-only gate (progress / wordbook) ---------- */
.gate { max-width: 430px; margin: 56px auto 70px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 42px 28px 34px; box-shadow: 0 14px 40px rgba(70,45,25,.1);
  animation: gate-in .35s ease both; }
@keyframes gate-in { from { opacity: 0; transform: translateY(14px); } }
.gate-seal { display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 10px; margin-bottom: 14px;
  background: linear-gradient(150deg, #de5335, var(--red-dark)); color: #fff;
  font-family: var(--serif); font-weight: 900; font-size: 2rem;
  box-shadow: 0 6px 18px rgba(199,62,42,.35); transform: rotate(-4deg); }
.gate h2 { font-size: 1.25rem; }
.gate h2 .zh { font-family: var(--serif); color: var(--red); margin-left: 4px; }
.gate p { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.gate-btn { margin-top: 20px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #e0512f, var(--red-dark)); color: #fff;
  border-radius: 8px; padding: 13px 30px; font-weight: 700; font-size: .95rem;
  font-family: inherit; box-shadow: 0 6px 18px rgba(199,62,42,.4);
  transition: transform .15s; }
.gate-btn:hover { transform: translateY(-2px); }
.gate-sub { font-size: .78rem !important; margin-top: 14px !important; }
html[data-theme="dark"] .gate { box-shadow: 0 14px 40px rgba(0,0,0,.35); }
