/* BahasaKu — fresh tropical palette: teal dominant, hibiscus red & songket gold accents */
:root {
  --teal: #0e9f8a;
  --teal-deep: #0b6e60;
  --teal-ink: #0b3d3a;
  --teal-soft: #e2f4f0;
  --red: #e5484d;
  --red-soft: #fdeaea;
  --gold: #f5b942;
  --gold-deep: #c98a12;
  --gold-soft: #fdf3dc;
  --blue: #2f7fd1;
  --blue-soft: #e7f1fb;
  --bg: #faf7f0;
  --surface: #ffffff;
  --overlay: #fffdf8;
  --ink: #1f332f;
  --ink-2: #4a625c;
  --ink-3: #7d938d;
  --line: #e4ded0;
  --scrim: rgba(11, 61, 58, 0.45);
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 61, 58, 0.07), 0 10px 30px rgba(11, 61, 58, 0.06);
  --shadow-lg: 0 6px 24px rgba(11, 61, 58, 0.14), 0 20px 50px rgba(11, 61, 58, 0.12);
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
/* custom scrollbar in palette */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--teal-soft); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 6px; border: 2px solid var(--teal-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--teal-deep); }
* { scrollbar-width: thin; scrollbar-color: var(--teal) var(--teal-soft); }

a { color: var(--teal-deep); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255, 253, 248, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--teal-ink); letter-spacing: 0.2px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--teal-deep)); color: #fff; display: grid; place-items: center; font-size: 16px; box-shadow: 0 3px 8px rgba(14, 159, 138, 0.35); }
.brand small { font-weight: 600; color: var(--ink-3); font-size: 12px; margin-left: 2px; }
#nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-link { padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: all 0.15s; }
.nav-link:hover { background: var(--teal-soft); color: var(--teal-deep); }
.nav-link.active { background: var(--teal-ink); color: #fff; }
#sound-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; transition: all 0.15s; }
#sound-toggle:hover { border-color: var(--teal); }
#sound-toggle.muted { background: var(--red-soft); border-color: var(--red); }
#nav-burger { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 17px; }
main { padding-top: 60px; min-height: calc(100vh - 140px); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #0b3d3a 0%, #0b6e60 55%, #0e9f8a 100%); color: #fff; }
.hero-bg { position: absolute; inset: 0; opacity: 0.5; background:
  radial-gradient(600px 300px at 85% 20%, rgba(245, 185, 66, 0.35), transparent 60%),
  radial-gradient(500px 300px at 10% 90%, rgba(229, 72, 77, 0.28), transparent 60%),
  radial-gradient(400px 250px at 60% 80%, rgba(47, 127, 209, 0.22), transparent 60%); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.13) 1px, transparent 1.5px); background-size: 26px 26px; }
.hero-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: 72px 20px 60px; }
.hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--gold); margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.22; font-weight: 800; }
.grad-text { background: linear-gradient(90deg, #f5b942, #ffd98a, #7fe3d2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 16px; max-width: 640px; color: #d7ece7; font-size: 16px; }
.hero-sub b { color: #ffe9b8; }
.hero-cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-demo { margin-top: 26px; font-size: 14px; color: #b9dcd4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-demo .mw { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.3); }
.hero-demo .mw:hover { background: var(--gold); color: var(--teal-ink); border-color: var(--gold); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border-radius: 11px; font-size: 15px; font-weight: 700; border: 1.5px solid transparent; transition: all 0.15s; }
.btn.primary { background: linear-gradient(135deg, var(--red), #c73a3f); color: #fff; box-shadow: 0 4px 14px rgba(229, 72, 77, 0.35); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(229, 72, 77, 0.45); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--teal-ink); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal-deep); }
.hero .btn.ghost { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.35); color: #fff; }
.hero .btn.ghost:hover { background: rgba(255,255,255,0.2); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.done-btn { background: var(--teal-soft); color: var(--teal-deep); border-color: var(--teal); }
.btn.again { background: var(--red-soft); color: var(--red); border-color: #f3c2c4; flex-direction: column; gap: 2px; }
.btn.good { background: var(--teal-soft); color: var(--teal-deep); border-color: #b5e2d9; flex-direction: column; gap: 2px; }
.btn small { font-weight: 500; font-size: 11px; opacity: 0.75; }

/* ---------- clickable words ---------- */
.mw { background: var(--teal-soft); border: 1px solid #c4e6de; color: var(--teal-ink); border-radius: 7px; padding: 1px 7px; font-size: 0.96em; font-weight: 600; font-family: inherit; line-height: 1.5; transition: all 0.13s; }
.mw:hover { background: var(--teal); color: #fff; border-color: var(--teal); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(14, 159, 138, 0.3); }
.mw.unk { background: var(--gold-soft); border-color: #ecd9a8; color: #7a5c10; }
.mw.unk:hover { background: var(--gold); color: var(--teal-ink); border-color: var(--gold); }
.speak-btn { border: none; background: transparent; font-size: 15px; padding: 2px 5px; border-radius: 6px; opacity: 0.65; transition: all 0.13s; vertical-align: middle; }
.speak-btn:hover { opacity: 1; background: var(--gold-soft); transform: scale(1.12); }
.speak-btn.mini { font-size: 12px; padding: 1px 3px; }

/* ---------- word popover ---------- */
.word-pop { position: fixed; z-index: 200; width: 312px; max-width: calc(100vw - 16px); background: var(--overlay); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; opacity: 0; transform: translateY(6px); transition: all 0.16s; }
.word-pop.in { opacity: 1; transform: translateY(0); }
.pop-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pop-word { font-size: 21px; font-weight: 800; color: var(--teal-ink); flex: 1; }
.pop-close { border: none; background: transparent; color: var(--ink-3); font-size: 13px; padding: 4px; border-radius: 6px; }
.pop-close:hover { background: var(--red-soft); color: var(--red); }
.pop-en { font-size: 15px; font-weight: 700; color: var(--ink); }
.pop-zh { font-size: 13.5px; color: var(--ink-2); margin-top: 1px; }
.pop-meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--teal-soft); color: var(--teal-deep); }
.badge.ghost { background: var(--gold-soft); color: var(--gold-deep); }
.badge.root-badge { background: var(--blue-soft); color: var(--blue); }
.pop-root { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pop-root-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--ink-3); margin-bottom: 6px; }
.pop-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 7px; }
.chip.pre { background: var(--red-soft); color: var(--red); }
.chip.root { background: var(--teal-soft); color: var(--teal-deep); }
.chip.suf { background: var(--blue-soft); color: var(--blue); }
.chip.big { font-size: 15px; padding: 4px 12px; }
.chip.root.big .mw { background: transparent; border: none; padding: 0; color: inherit; font-size: inherit; }
.pop-root-mean { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.pop-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pop-link { display: inline-block; font-size: 12.5px; font-weight: 700; margin-top: 8px; margin-right: 12px; color: var(--teal-deep); }
.pop-link:hover { text-decoration: underline; }

/* ---------- home sections ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: -34px; position: relative; z-index: 5; padding-bottom: 8px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 13px; }
.stat-ring { position: relative; width: 64px; height: 64px; flex: none; }
.stat-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--teal-ink); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--teal-deep); line-height: 1; min-width: 52px; }
.stat-num small { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat-label { font-size: 14px; font-weight: 700; }
.stat-sub { font-size: 11.5px; color: var(--ink-3); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel-tag { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--gold-deep); margin-bottom: 8px; }
.daily-ms { font-size: 20px; font-weight: 700; color: var(--teal-ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.daily-ms .mw { font-size: 18px; }
.daily-en { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.daily-zh { font-size: 13px; color: var(--ink-3); }
.sec-title { font-size: 22px; font-weight: 800; margin: 40px 0 16px; color: var(--teal-ink); }
.sec-title small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 10px; }
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.path-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: all 0.16s; display: block; color: var(--ink); }
.path-card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow-lg); }
.path-card.done { border-color: #b5e2d9; background: linear-gradient(160deg, #fff, var(--teal-soft)); }
.path-idx { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.path-card.done .path-idx { background: var(--teal); color: #fff; }
.path-icon { font-size: 26px; }
.path-title { font-size: 16px; font-weight: 800; margin-top: 8px; color: var(--teal-ink); }
.path-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; min-height: 38px; }
.path-min { font-size: 11px; color: var(--ink-3); margin-top: 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 48px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: all 0.16s; color: var(--ink); border-top: 4px solid var(--teal); }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tool-card.t-verb { border-top-color: var(--red); }
.tool-card.t-dict { border-top-color: var(--teal); }
.tool-card.t-card { border-top-color: var(--gold); }
.tool-card.t-quiz { border-top-color: var(--blue); }
.tool-card.t-phr { border-top-color: #9b6dd6; }
.tool-card.t-var { border-top-color: #3aa675; }
.tool-icon { font-size: 28px; }
.tool-card h3 { font-size: 17px; font-weight: 800; margin: 8px 0 6px; color: var(--teal-ink); }
.tool-card p { font-size: 13px; color: var(--ink-2); }

/* ---------- page head / lessons ---------- */
.page-head { padding-top: 40px; padding-bottom: 8px; }
.page-head h1 { font-size: 30px; font-weight: 800; color: var(--teal-ink); }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 720px; }
.lesson-page { padding-top: 32px; padding-bottom: 48px; }
.back-link { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.back-link:hover { color: var(--teal-deep); }
.les-title-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.les-icon { font-size: 40px; }
.les-title-row h1 { font-size: 26px; font-weight: 800; color: var(--teal-ink); }
.les-title-row p { font-size: 13.5px; color: var(--ink-2); }
.les-title-row .btn { margin-left: auto; }
.les-body { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.les-p { margin: 12px 0; font-size: 15px; }
.les-h { font-size: 18px; font-weight: 800; color: var(--teal-deep); margin: 26px 0 10px; padding-left: 12px; border-left: 4px solid var(--gold); }
.tip { display: flex; gap: 10px; background: var(--gold-soft); border: 1px solid #ecd9a8; border-radius: 11px; padding: 13px 15px; margin: 16px 0; font-size: 13.5px; color: #5c4a12; }
.tip-icon { flex: none; }
.les-link { margin: 14px 0; }
.table-scroll { overflow-x: auto; margin: 12px 0; border-radius: 11px; border: 1px solid var(--line); }
.les-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.les-table th { background: var(--teal-ink); color: #fff; text-align: left; padding: 9px 13px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.les-table td { padding: 9px 13px; border-top: 1px solid var(--line); vertical-align: top; }
.les-table tbody tr:nth-child(even) { background: #fbfaf5; }
.les-table tbody tr:hover { background: var(--teal-soft); }
.ex-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.ex-item { background: var(--overlay); border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; }
.ex-ms { font-size: 16px; font-weight: 700; color: var(--teal-ink); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ex-en { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.ex-zh { font-size: 12.5px; color: var(--ink-3); }
.dialog { background: linear-gradient(160deg, var(--teal-soft), #f2faf7); border: 1px solid #c4e6de; border-radius: 13px; padding: 18px; margin: 14px 0; }
.dialog-title { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--teal-deep); margin-bottom: 12px; }
.dialog-line { display: flex; gap: 12px; margin-bottom: 12px; }
.dialog-s { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }
.dialog-line:nth-child(odd) .dialog-s { background: var(--gold-deep); }
.audio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.audio-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 11px; padding: 11px 13px; transition: all 0.14s; position: relative; }
.audio-chip:hover { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-2px); }
.audio-ms { font-size: 16px; font-weight: 800; color: var(--teal-ink); }
.audio-note { font-size: 11px; color: var(--ink-3); }
.audio-ico { position: absolute; top: 10px; right: 10px; font-size: 13px; opacity: 0.55; }
.vocab-box { margin-top: 24px; padding-top: 18px; border-top: 2px dashed var(--line); }
.vocab-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--ink-3); margin-bottom: 10px; }
.vocab-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.les-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* ---------- verbs page ---------- */
.tabs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.tab { padding: 9px 18px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; color: var(--ink-2); transition: all 0.14s; }
.tab:hover { border-color: var(--teal); }
.tab.active { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }
.tab-body { margin-top: 18px; margin-bottom: 48px; }
.ana-input-row { display: flex; gap: 10px; }
.ana-input-row input { flex: 1; padding: 13px 16px; font-size: 17px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); outline: none; transition: border 0.14s; }
.ana-input-row input:focus { border-color: var(--teal); }
.ana-examples { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 18px; }
.ex-chip { padding: 5px 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--teal-deep); transition: all 0.13s; }
.ex-chip:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.ana-empty { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--ink-3); font-size: 14.5px; }
.ana-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; animation: rise 0.25s ease; }
.ana-card.miss { border-color: #f3c2c4; background: #fffafa; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ana-word { font-size: 26px; font-weight: 800; color: var(--teal-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ana-word .mw { font-size: 24px; }
.ana-tag { font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 3px 10px; border-radius: 20px; background: var(--gold-soft); color: var(--gold-deep); }
.ana-break { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 10px; }
.ana-plus { font-size: 20px; font-weight: 800; color: var(--ink-3); }
.ana-mean { font-size: 15.5px; color: var(--ink); }
.ana-sub { font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.ana-rule { font-size: 13px; color: var(--ink-2); background: var(--blue-soft); border-radius: 9px; padding: 8px 12px; margin-top: 8px; }
.ana-alts { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ana-alt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.ana-alt-mean { color: var(--ink-2); }
.ana-actions { margin-top: 16px; }
.ana-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }
.ana-form { display: flex; align-items: center; gap: 7px; background: var(--overlay); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; flex-wrap: wrap; }
.ana-form-kind { font-size: 11.5px; color: var(--ink-3); }
.family-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.family-bar label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.family-bar select { padding: 9px 13px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--teal-ink); outline: none; max-width: 320px; }
.family-bar select:focus { border-color: var(--teal); }
.family-root-mean { font-size: 13.5px; color: var(--ink-2); }
.family-table td:first-child { white-space: nowrap; }
.rules-intro { font-size: 14.5px; color: var(--ink-2); margin-bottom: 16px; }
.rule-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.rule-block h4 { font-size: 15.5px; font-weight: 800; color: var(--teal-deep); margin-bottom: 8px; }
.rule-block ul { list-style: none; }
.rule-block li { font-size: 13.5px; color: var(--ink-2); padding: 4px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* ---------- dictionary ---------- */
.dict-bar { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.dict-bar input { flex: 1; padding: 12px 16px; font-size: 15px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; }
.dict-bar input:focus { border-color: var(--teal); }
.dict-count { font-size: 13px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.cat-chip { padding: 5px 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: all 0.13s; }
.cat-chip:hover { border-color: var(--teal); color: var(--teal-deep); }
.cat-chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.dict-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.dict-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 15px; transition: all 0.13s; }
.dict-row:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.dict-w { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.dict-w .mw { font-size: 15px; }
.dict-mean { display: flex; flex-direction: column; min-width: 0; }
.dict-en { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dict-zh { font-size: 12.5px; color: var(--ink-3); }
.dict-meta { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.more-row { text-align: center; margin: 10px 0 44px; }

/* ---------- flashcards ---------- */
.srs-boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 20px; }
.srs-box { border-radius: 12px; padding: 14px; text-align: center; border: 1px solid var(--line); background: var(--surface); }
.srs-box.b1 { border-top: 4px solid var(--red); }
.srs-box.b2 { border-top: 4px solid #ef8a4d; }
.srs-box.b3 { border-top: 4px solid var(--gold); }
.srs-box.b4 { border-top: 4px solid #6fbf73; }
.srs-box.b5 { border-top: 4px solid var(--teal); }
.srs-n { font-size: 24px; font-weight: 800; color: var(--teal-ink); }
.srs-l { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.srs-d { font-size: 11px; color: var(--ink-3); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 48px; }
.deck-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 15px 16px; transition: all 0.14s; text-align: left; }
.deck-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.deck-card b { font-size: 15px; color: var(--teal-ink); }
.deck-card span { font-size: 12px; color: var(--ink-3); }
.deck-card em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--red); margin-top: 6px; }
.fc-wrap { max-width: 560px; margin-bottom: 48px; }
.fc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 26px; min-height: 300px; cursor: pointer; transition: border 0.15s; }
.fc-card:hover { border-color: var(--teal); }
.fc-face { display: none; animation: rise 0.22s ease; }
.fc-card:not(.flipped) .fc-front { display: block; }
.fc-card.flipped .fc-back { display: block; }
.fc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.fc-box { font-size: 11px; font-weight: 800; color: var(--gold-deep); background: var(--gold-soft); padding: 2px 9px; border-radius: 20px; }
.fc-progress { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.fc-word { font-size: 40px; font-weight: 800; color: var(--teal-ink); text-align: center; margin: 26px 0 14px; letter-spacing: 0.5px; }
.fc-front { text-align: center; }
.fc-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; }
.fc-en { font-size: 22px; font-weight: 800; color: var(--ink); text-align: center; }
.fc-zh { font-size: 16px; color: var(--ink-2); text-align: center; margin-top: 4px; }
.fc-root { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.fc-rate { display: flex; gap: 12px; margin-top: 22px; }
.fc-rate .btn { flex: 1; padding: 13px; }
.fc-flip-hint { text-align: center; margin-top: 16px; }
.fc-bar { height: 7px; border-radius: 5px; background: var(--teal-soft); margin-top: 18px; overflow: hidden; }
.fc-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 5px; transition: width 0.3s; }
.fc-abort { text-align: center; margin-top: 12px; }
.fc-abort-btn { border: none; background: transparent; color: var(--ink-3); font-size: 12.5px; text-decoration: underline; padding: 4px 8px; }
.fc-abort-btn:hover { color: var(--red); }
.fc-summary { max-width: 620px; margin: 10px auto 48px; text-align: center; }
.fc-sum-num { font-size: 44px; font-weight: 800; color: var(--teal-deep); }
.fc-sum-list { margin: 18px 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.fc-sum-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; }
.fc-sum-row.ok { background: var(--teal-soft); }
.fc-sum-row.no { background: var(--red-soft); }
.fc-sum-row span { flex: 1; color: var(--ink-2); }
.fc-sum-row b { color: var(--teal-deep); }
.fc-sum-row.no b { color: var(--red); }
.fc-sum-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- quiz ---------- */
.quiz-wrap { max-width: 680px; padding-top: 36px; padding-bottom: 48px; }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.quiz-progress { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.quiz-score { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--gold-deep); }
.quiz-q { font-size: 34px; font-weight: 800; color: var(--teal-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-q .mw { font-size: 30px; }
.quiz-q-text { word-break: break-word; }
.quiz-ask { font-size: 15px; color: var(--ink-2); margin: 8px 0 20px; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 13px 16px; font-size: 15.5px; font-weight: 600; color: var(--ink); transition: all 0.13s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
.quiz-opt-key { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-deep); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.quiz-opt.right { border-color: var(--teal); background: var(--teal-soft); }
.quiz-opt.right .quiz-opt-key { background: var(--teal); color: #fff; }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.quiz-opt.wrong .quiz-opt-key { background: var(--red); color: #fff; }
.quiz-opt.dim { opacity: 0.5; }
.quiz-feedback { margin: 16px 0; padding: 12px 15px; border-radius: 11px; font-size: 14.5px; font-weight: 700; }
.quiz-feedback.ok { background: var(--teal-soft); color: var(--teal-deep); }
.quiz-feedback.no { background: var(--red-soft); color: var(--red); }
.quiz-hint { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.quiz-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; margin-bottom: 48px; }
.quiz-mode { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: left; transition: all 0.15s; box-shadow: var(--shadow); }
.quiz-mode:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow-lg); }
.quiz-mode-icon { font-size: 26px; }
.quiz-mode h3 { font-size: 18px; font-weight: 800; color: var(--teal-ink); margin: 10px 0 6px; }
.quiz-mode p { font-size: 13px; color: var(--ink-2); min-height: 60px; }
.quiz-mode-best { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 800; color: var(--gold-deep); background: var(--gold-soft); padding: 3px 11px; border-radius: 20px; }
.quiz-done { text-align: center; }
.quiz-final { font-size: 52px; font-weight: 800; color: var(--teal-deep); }
.quiz-best { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.quiz-wrong { margin: 20px 0; text-align: left; }
.quiz-wrong h4 { font-size: 14px; color: var(--red); margin-bottom: 8px; }
.quiz-wrong-row { display: flex; align-items: center; gap: 10px; background: var(--red-soft); border-radius: 9px; padding: 8px 12px; margin-bottom: 6px; font-size: 13.5px; flex-wrap: wrap; }
.quiz-wrong-row span { font-weight: 700; color: var(--teal-deep); }
.quiz-wrong-row em { font-style: normal; color: var(--ink-3); font-size: 12px; }

/* ---------- phrases ---------- */
.phrase-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; margin-bottom: 48px; }
.phrase-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.phrase-group-title { font-size: 16px; font-weight: 800; color: var(--teal-ink); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gold-soft); }
.phrase-row { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.phrase-row:last-child { border-bottom: none; }
.phrase-ms { font-size: 15px; font-weight: 700; color: var(--teal-ink); display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.phrase-mean { display: flex; flex-direction: column; margin-top: 3px; }
.phrase-en { font-size: 12.5px; color: var(--ink-2); }
.phrase-zh { font-size: 12px; color: var(--ink-3); }

/* ---------- toast / footer ---------- */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--teal-ink); color: #fff; padding: 11px 22px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all 0.22s; z-index: 300; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
footer { border-top: 1px solid var(--line); background: var(--overlay); padding: 26px 20px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
footer b { color: var(--teal-deep); }

/* ---------- motion layer ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes blobDrift {
  0% { transform: translate3d(-4%, -2%, 0) scale(1); }
  50% { transform: translate3d(5%, 4%, 0) scale(1.12); }
  100% { transform: translate3d(-4%, -2%, 0) scale(1); }
}
@keyframes blobDrift2 {
  0% { transform: translate3d(3%, 2%, 0) scale(1.05); }
  50% { transform: translate3d(-5%, -4%, 0) scale(0.94); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.05); }
}
@keyframes pulseOk { 0% { box-shadow: 0 0 0 0 rgba(14, 159, 138, 0.45); } 100% { box-shadow: 0 0 0 14px rgba(14, 159, 138, 0); } }
@keyframes shakeNo { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes flipIn { from { opacity: 0; transform: perspective(900px) rotateX(-14deg) translateY(8px); } to { opacity: 1; transform: perspective(900px) rotateX(0) translateY(0); } }
.hero-bg::before { content: ""; position: absolute; inset: -20%; background:
  radial-gradient(420px 300px at 30% 30%, rgba(127, 227, 210, 0.28), transparent 65%),
  radial-gradient(520px 360px at 75% 65%, rgba(245, 185, 66, 0.22), transparent 65%);
  filter: blur(30px); animation: blobDrift 16s ease-in-out infinite; }
.hero-bg::after { inset: -20%; animation: blobDrift2 22s ease-in-out infinite; }
.hero-kicker { animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) 0.05s both; }
.hero h1 { animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.14s both; }
.hero-sub { animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.26s both; }
.hero-cta { animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.38s both; }
.hero-demo { animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.5s both; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1); }
.reveal.revealed { opacity: 1; transform: none; }
.btn:active { transform: scale(0.97); }
.mw:active { transform: scale(0.94); }
.quiz-opt.right { animation: pulseOk 0.55s ease-out; }
.quiz-opt.wrong { animation: shakeNo 0.4s ease; }
.fc-card { perspective: 900px; }
.fc-card.flipped .fc-back { animation: flipIn 0.45s cubic-bezier(0.2, 0.7, 0.3, 1); transform-origin: top center; }
.fc-card:not(.flipped) .fc-front { animation: fadeUp 0.3s ease both; }
#nav { transition: box-shadow 0.25s ease; }
#nav.scrolled { box-shadow: 0 4px 18px rgba(11, 61, 58, 0.1); }
.ana-card { animation: fadeUp 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.word-pop.in .pop-root { animation: fadeUp 0.3s ease 0.05s both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .quiz-modes { grid-template-columns: 1fr; }
  .quiz-mode p { min-height: 0; }
  .phrase-groups { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  #nav-burger { display: block; margin-left: auto; }
  #nav-links { position: fixed; top: 60px; left: 0; right: 0; background: var(--overlay); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 14px; gap: 4px; display: none; box-shadow: var(--shadow-lg); }
  #nav-links.open { display: flex; }
  .nav-link { padding: 11px 14px; }
  #sound-toggle { margin-left: 0; }
  .nav-inner { gap: 10px; }
  .dict-row { grid-template-columns: 1fr; gap: 5px; }
  .dict-meta { justify-content: flex-start; }
  .les-body { padding: 18px; }
  .les-title-row .btn { margin-left: 0; }
  .hero-inner { padding: 52px 20px 48px; }
  .srs-boxes { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .srs-box { padding: 9px 4px; }
  .srs-n { font-size: 18px; }
}
@media (max-width: 520px) {
  .tool-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; gap: 9px; }
  .stat-num { font-size: 24px; min-width: 40px; }
  .fc-word { font-size: 32px; }
  .quiz-q { font-size: 26px; }
  .quiz-q .mw { font-size: 24px; }
  .ana-input-row { flex-direction: column; }
  .brand small { display: none; }
}

/* ---------- ads & sponsorship ---------- */
.ad-wrap { margin: 4px auto 12px; }
.ad-slot { min-height: 92px; }
.ad-slot.ad-vertical { min-height: 300px; }
.quiz-done .ad-slot, .fc-summary .ad-slot { margin: 16px 0 4px; }
.lesson-page > .ad-slot { margin-top: 22px; }
.phrase-groups .ad-slot { margin: 2px 0; }
.ad-native { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); text-align: left; transition: transform 0.15s ease, box-shadow 0.15s ease; overflow: hidden; }
.ad-native:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(11, 61, 58, 0.12); }
.ad-native.tone-teal { background: linear-gradient(120deg, #eefaf6 0%, #ffffff 55%, #e6f6f1 100%); border-color: #bfe6db; }
.ad-native.tone-gold { background: linear-gradient(120deg, #fdf6e4 0%, #ffffff 55%, #fbf1d8 100%); border-color: #ecd9a8; }
.ad-native.tone-blue { background: linear-gradient(120deg, #eef5fc 0%, #ffffff 55%, #e4effa 100%); border-color: #bcd7ef; }
.ad-label { position: absolute; top: 8px; right: 10px; font-size: 10px; letter-spacing: 1px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: rgba(255, 255, 255, 0.7); }
.ad-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 23px; flex: none; }
.tone-teal .ad-icon { background: #d3f1e8; }
.tone-gold .ad-icon { background: #f9e8bf; }
.tone-blue .ad-icon { background: #d6e8f8; }
.ad-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ad-tag { font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.tone-teal .ad-tag { color: var(--teal-deep); }
.tone-gold .ad-tag { color: #9a6b0a; }
.tone-blue .ad-tag { color: #1d5fa8; }
.ad-title { font-size: 15px; font-weight: 700; line-height: 1.4; }
.ad-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.ad-cta { flex: none; font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px; white-space: nowrap; color: #fff; }
.tone-teal .ad-cta { background: var(--teal); }
.tone-gold .ad-cta { background: var(--gold); color: var(--teal-ink); }
.tone-blue .ad-cta { background: var(--blue); }
.ad-native:hover .ad-cta { filter: brightness(1.07); }
.ad-vertical .ad-native { grid-template-columns: 1fr; gap: 10px; align-items: start; padding: 18px; }
.ad-vertical .ad-cta { justify-self: start; }
.dict-side { display: none; }
@media (min-width: 1200px) {
  .dict-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
  .dict-side { display: block; position: sticky; top: 84px; }
}
.privacy-body { max-width: 780px; padding-bottom: 30px; }
.privacy-body h3 { margin: 22px 0 8px; font-size: 16px; color: var(--teal-ink); }
footer a { color: var(--teal-deep); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .ad-native { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
  .ad-cta { grid-column: 1 / -1; justify-self: start; }
  .ad-vertical .ad-cta { grid-column: auto; }
}
@media (max-width: 520px) {
  .ad-icon { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; }
  .ad-title { font-size: 13.5px; }
  .ad-desc { font-size: 12px; }
  .ad-slot { min-height: 0; }
}