/* 发展汉语 · 高级学习中心 — Light Pastel Stationery Theme (Inspired by DailyChineseMaster) */
:root {
  --g1: #FFF9ED;
  --g2: #FFEFD4;
  --g3: #FFE9D6;
  --acc: #F5CE62;
  --acc-dark: #744d00;
  --acc-soft: #FFF6DA;
  --side-bg: rgba(255, 250, 238, 0.86);

  --ink: #2b2118;
  --ink2: #4a3f33;
  --soft: #665b4f;
  --line: #e2d9cc;

  --sf: #ffffff;
  --sf2: #FFF9EC;
  --sf3: #FAECCF;
  --card: rgba(255, 255, 255, 0.92);
  --note: #FFF8DF;

  --k-ok: #047857;
  --k-warn: #9A4A00;
  --k-bad: #B42318;
  --k-info: #1D4ED8;
  --k-hv: #7E22CE;

  --font-ui: 'Be Vietnam Pro', 'Noto Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --font-kai: 'Be Vietnam Pro', 'LXGW WenKai Screen', 'Noto Serif SC', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-sans-cn: 'Be Vietnam Pro', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-han: var(--font-sans-cn);

  --shadow: 0 6px 20px rgba(43, 33, 24, 0.06);
  --border-ink: 1.8px solid rgba(43, 33, 24, 0.84);
  --reader-size: 2.32rem;
  --ex-han-size: 1.56rem;
}

:root[data-theme="honey"], body[data-theme="honey"] {
  --g1: #FFF9ED; --g2: #FFEFD4; --g3: #FFE9D6;
  --acc: #F5CE62; --acc-dark: #744d00; --acc-soft: #FFF6DA;
  --side-bg: rgba(255, 250, 238, 0.86);
  --sf: #ffffff; --sf2: #FFF9EC; --sf3: #FAECCF; --card: rgba(255, 255, 255, 0.92); --note: #FFF8DF;
}
:root[data-theme="peach"], body[data-theme="peach"] {
  --g1: #FDF4F7; --g2: #FADFE9; --g3: #FDECF3;
  --acc: #F2B2C9; --acc-dark: #831843; --acc-soft: #FCEAF1;
  --side-bg: rgba(253, 242, 247, 0.86);
  --sf: #ffffff; --sf2: #FDF5F8; --sf3: #F7DFEA; --card: rgba(255, 255, 255, 0.92); --note: #FCF0F5;
}
:root[data-theme="matcha"], body[data-theme="matcha"] {
  --g1: #F4FAF1; --g2: #E3F3D9; --g3: #EDF8E6;
  --acc: #A9D896; --acc-dark: #1f5114; --acc-soft: #EAF6E4;
  --side-bg: rgba(242, 250, 238, 0.86);
  --sf: #ffffff; --sf2: #F5FAF2; --sf3: #E0EED8; --card: rgba(255, 255, 255, 0.92); --note: #EFF8EA;
}
:root[data-theme="sky"], body[data-theme="sky"] {
  --g1: #F2F8FF; --g2: #DFEFFE; --g3: #EAF5FF;
  --acc: #97C5F5; --acc-dark: #164882; --acc-soft: #E8F3FE;
  --side-bg: rgba(241, 248, 255, 0.86);
  --sf: #ffffff; --sf2: #F4F9FF; --sf3: #DCECFB; --card: rgba(255, 255, 255, 0.92); --note: #ECF5FF;
}
:root[data-theme="lavender"], body[data-theme="lavender"] {
  --g1: #F7F4FF; --g2: #EAE0FD; --g3: #F3EDFF;
  --acc: #C1ACF6; --acc-dark: #47258d; --acc-soft: #EFE9FE;
  --side-bg: rgba(246, 242, 255, 0.86);
  --sf: #ffffff; --sf2: #F8F5FF; --sf3: #E6DDFC; --card: rgba(255, 255, 255, 0.92); --note: #F2ECFE;
}

body.font-sans-han {
  --font-han: var(--font-sans-cn);
}
body:not(.font-sans-han) {
  --font-han: var(--font-kai);
}
/* Prevent pixelated Chinese glyphs on small chips/buttons */
.chip, .btn, .nav-item, .cc-tile-vi, .cc-mini-chip, .r-card-snippet, .w-tile-vi, .ex-opt-btn {
  font-family: var(--font-sans-cn);
}

/* Balanced scholarly Chinese sizes (large legible thin Hanzi strokes, compact Vietnamese glosses) */
body.han-sm { --reader-size: 1.54rem; --ex-han-size: 1.48rem; }
body.han-md { --reader-size: 1.82rem; --ex-han-size: 1.72rem; }
body.han-lg { --reader-size: 2.08rem; --ex-han-size: 1.96rem; }
body.han-xl { --reader-size: 2.38rem; --ex-han-size: 2.22rem; }

body.reader-fs .sidebar { display: none; }
body.reader-fs .main-wrap { padding: 0.65rem 1rem 2.5rem; }
body.reader-fs .content-inner { max-width: 100%; }

*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--g1);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  line-height: 1.55;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 254px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0.9rem 0.78rem;
  background: var(--side-bg, rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1.5px solid rgba(43, 33, 24, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brand-card {
  background: var(--sf);
  border: var(--border-ink);
  border-radius: 18px;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.08);
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--acc);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-han);
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-sans-cn);
  font-weight: 700;
  font-size: 0.90rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #111827;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--soft);
  font-weight: 600;
  margin-top: 0.12rem;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 0.25rem 0.45rem 0.1rem;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.55rem;
  border-radius: 13px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink2);
  transition: background 0.14s, border-color 0.14s, transform 0.12s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(43, 33, 24, 0.2);
}

.nav-item.active {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(43, 33, 24, 0.08);
}

.sh {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1.5px solid rgba(43, 33, 24, 0.26);
  background: var(--sf2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-han);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--acc-dark);
  flex-shrink: 0;
}

.nav-item.active .sh {
  background: var(--acc);
  border-color: var(--ink);
  color: var(--ink);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.1rem 0.44rem;
  border-radius: 999px;
  background: var(--sf3);
  border: 1px solid rgba(43, 33, 24, 0.2);
  color: var(--ink2);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1.5px solid rgba(43, 33, 24, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dev-logo-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.65rem;
  border-radius: 14px;
  border: 1.6px solid rgba(43, 33, 24, 0.72);
  background: linear-gradient(135deg, var(--sf) 0%, var(--acc-soft) 100%);
  box-shadow: 0 2px 6px rgba(43, 33, 24, 0.06);
}
.dev-logo-svg { flex-shrink: 0; }
.dev-logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.dev-logo-kicker { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; color: var(--soft); }
.dev-logo-name { font-size: 0.76rem; font-weight: 800; color: var(--acc-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.theme-label-row {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--acc-dark);
  text-align: center;
}

.theme-swatches {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.1rem 0.2rem;
}

.swatch {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 2px solid rgba(43, 33, 24, 0.42);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #1c1917;
  transition: transform 0.15s, box-shadow 0.15s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
  border: 2.8px solid var(--ink);
  transform: scale(1.14);
  box-shadow: 0 2px 10px rgba(43, 33, 24, 0.28);
}

.side-toggle-btn {
  width: 100%;
  padding: 0.44rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid rgba(43, 33, 24, 0.42);
  background: var(--sf);
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.14s, transform 0.12s;
}
.side-toggle-btn:hover { background: var(--acc-soft); }

.server-pill {
  font-size: 0.71rem;
  font-weight: 700;
  text-align: center;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1.5px dashed rgba(43, 33, 24, 0.28);
  background: var(--sf2);
  color: var(--soft);
}
.server-pill.online {
  border-style: solid;
  border-color: var(--k-ok);
  background: #ecfdf5;
  color: var(--k-ok);
}

/* Main Content */
.main-wrap {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1.05rem 2.8rem;
}

.content-inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Mobile Header & Bottom Bar */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid rgba(43, 33, 24, 0.16);
  padding: 0.55rem 0.9rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1.5px solid rgba(43, 33, 24, 0.18);
  padding: 0.35rem 0.3rem;
  justify-content: space-around;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  border: none;
  background: transparent;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--soft);
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
}
.mobile-tab.active {
  background: var(--acc);
  color: var(--ink);
}

/* Header & Cards */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.page-title {
  margin: 0;
  font-size: 1.44rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-sub {
  font-size: 0.88rem;
  color: var(--soft);
  font-weight: 500;
  margin-top: 0.2rem;
}

.card {
  background: var(--card);
  border: var(--border-ink);
  border-radius: 24px;
  padding: 1.05rem 1.2rem;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
}
.card-sub {
  margin: 0.22rem 0 0;
  font-size: 0.85rem;
  color: var(--soft);
  font-weight: 500;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.52rem;
  margin-bottom: 0.78rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.82rem;
}
@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Buttons & Chips */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: var(--sf);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, background 0.14s, box-shadow 0.14s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: var(--acc-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.dark { background: var(--ink); color: #ffffff; }
.btn.dark:hover:not(:disabled) { background: #1a140f; }
.btn.acc { background: var(--acc); color: var(--ink); }
.btn.acc:hover:not(:disabled) { filter: brightness(0.97); }
.btn.ok { background: #ecfdf5; border-color: var(--k-ok); color: var(--k-ok); }
.btn.warn { background: #fff7ed; border-color: var(--k-warn); color: var(--k-warn); }
.btn.sm { padding: 0.32rem 0.72rem; font-size: 0.78rem; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  border: 1.6px solid rgba(43, 33, 24, 0.75);
  background: var(--sf);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.chip:hover { transform: translateY(-1px); background: var(--sf3); }
.chip.on { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.chip.acc { background: var(--acc); color: var(--ink); border-color: var(--ink); }

/* Pastel Tag Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid rgba(43, 33, 24, 0.18);
}
.tag.lv { background: #fff0c7; color: #7a5000; }
.tag.ok { background: #dcfce7; color: #047857; border-color: #10b981; }
.tag.bad { background: #ffe4e6; color: #b91c1c; border-color: #f43f5e; }
.tag.pos { background: #ddf5e4; color: #065f46; }
.tag.hv { background: #f3e8ff; color: #6b21a8; }
.tag.rad { background: #e0f2fe; color: #075985; }
.tag.rose { background: #ffe4e6; color: #9f1239; }

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
}

.stat-tile {
  background: var(--sf);
  border: 1.6px solid var(--ink);
  border-radius: 18px;
  padding: 0.8rem 0.65rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s;
}
.stat-tile:hover { transform: translateY(-2px); background: var(--acc-soft); }
.stat-num { font-size: 1.48rem; font-weight: 800; line-height: 1.15; }
.stat-lbl { font-size: 0.74rem; color: var(--soft); font-weight: 700; margin-top: 0.18rem; }

/* Course Selector Cards & Quick Hub Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.78rem;
}
@media (max-width: 1120px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .course-grid, .book-grid { grid-template-columns: 1fr; }
}

.course-card, .book-card {
  background: var(--sf);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  text-align: left;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.08);
}
.course-card:hover, .book-card:hover {
  transform: translateY(-2px);
  background: var(--acc-soft);
  box-shadow: 0 6px 14px rgba(43, 33, 24, 0.1);
}
.course-card.on {
  background: linear-gradient(135deg, var(--acc-soft) 0%, var(--acc) 100%);
}

.course-top, .book-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
  width: 100%;
}

.status-pill, .badge-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1.4px solid rgba(43, 33, 24, 0.65);
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.course-card.on .status-pill {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.prog-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(43, 33, 24, 0.1);
  overflow: hidden;
  margin-top: 0.25rem;
}
.prog-fill {
  height: 100%;
  background: var(--k-ok);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Search & Input Bars */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: var(--sf);
  font-size: 0.95rem;
  outline: none;
}
.search-input:focus {
  box-shadow: 0 0 0 3px rgba(246, 196, 69, 0.35);
}

.select-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: var(--sf);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

/* Reading Library 3-col Grid */
.reading-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.78rem;
}

.r-card {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  text-align: left;
  transition: transform 0.14s, background 0.14s, box-shadow 0.14s;
}
.r-card:hover {
  transform: translateY(-2px);
  background: var(--sf2);
  box-shadow: 0 6px 18px rgba(43, 33, 24, 0.09);
}
.r-card.done {
  background: #f0fdf4;
  border-color: var(--k-ok);
}

.r-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.r-card-title {
  font-family: var(--font-han);
  font-size: 1.46rem;
  font-weight: 500;
  font-synthesis: none;
  color: var(--ink);
  line-height: 1.35;
}

.r-card-snippet {
  font-family: var(--font-han);
  font-size: 1.18rem;
  color: var(--soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* Unit Grouped Reading Library */
.unit-group-card {
  background: var(--card);
  border: var(--border-ink);
  border-radius: 22px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}
.unit-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1.5px solid var(--line);
}
.unit-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.65rem;
}
.sub-art-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
  border-radius: 14px;
  background: var(--sf3);
  border: 1.5px solid rgba(43, 33, 24, 0.25);
}
.sub-art-pill {
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1.5px solid rgba(43, 33, 24, 0.35);
  background: var(--sf);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sub-art-pill.on {
  background: var(--acc);
  border-color: var(--ink);
  font-weight: 800;
}

/* Reader Toolbar & Passage */
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 0.9rem;
}

.reader-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.reader-layout.split-scan {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
}

.reader-body-card {
  background: var(--sf);
  border: var(--border-ink);
  border-radius: 22px;
  padding: 1.25rem 1.4rem;
}

.reader-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.reader-title-zh {
  font-family: var(--font-han);
  font-size: 1.62rem;
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.reader-trans-box {
  background: var(--note);
  border: 1.6px solid rgba(43, 33, 24, 0.25);
  border-left: 5px solid var(--ink);
  border-radius: 16px;
  padding: 0.88rem 1.05rem;
  margin-bottom: 1rem;
  font-size: 0.80rem;
  line-height: 1.68;
  color: var(--ink2);
}
.reader-trans-box .tok {
  font-family: var(--font-han);
  font-size: 1.38rem;
  color: #111827;
}

.reader-text {
  font-family: var(--font-han);
  font-size: var(--reader-size);
  font-weight: 400;
  line-height: 1.85;
  color: #111827;
  word-break: break-word;
}
.reader-text.has-ruby,
body.show-pinyin-all .reader-text {
  line-height: 2.18;
}

.reader-para {
  margin: 0 0 0.65rem 0;
  text-indent: 0;
  text-align: justify;
  color: #111827;
}
.reader-para.no-indent { text-indent: 0; }
.reader-para-vi {
  margin: -0.25rem 0 0.85rem 0;
  padding: 0.38rem 0.72rem;
  border-left: 3.5px solid var(--k-ok);
  border-radius: 10px;
  background: var(--note);
  font-family: var(--font-ui);
  font-size: 0.80rem;
  line-height: 1.52;
  color: var(--ink2);
  text-indent: 0;
}

.tok {
  display: inline;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  color: inherit;
  font-weight: 400;
  font-synthesis: none;
  transition: background 0.12s;
  text-indent: 0;
}
.reader-text.has-ruby .tok,
body.show-pinyin-all .tok {
  display: ruby;
  ruby-position: over;
  ruby-align: center;
  padding: 0 0.08rem;
}
.tok:hover {
  background: var(--acc);
}
.tok.vocab-hit,
.tok.vocab-hit .rb {
  color: #dc2626;
  font-weight: 400;
  text-decoration: underline rgba(220, 38, 38, 0.34) 1.5px;
  text-underline-offset: 4px;
}
.reader-title-zh .tok.vocab-hit,
.reader-title-zh .tok.vocab-hit .rb {
  color: #111827;
  text-decoration: none;
}

.rt, .tok rt {
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 0.46em, 11.5px);
  font-weight: 600;
  color: #047857;
  line-height: 1.05;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
  display: none;
}
.reader-text.has-ruby .tok rt,
body.show-pinyin-all .tok rt,
body.show-pinyin-all .rt {
  display: ruby-text;
}
body.show-pinyin-all .ex-q-stem,
body.show-pinyin-all .footnote-item,
body.show-pinyin-all .gram-formula,
body.show-pinyin-all .gram-vi-box,
body.show-pinyin-all .gram-body-box,
body.show-pinyin-all .gram-ex-box,
body.show-pinyin-all .gram-err,
body.show-pinyin-all .reader-title-zh,
body.show-pinyin-all .cloze-story-body {
  line-height: 2.18;
}
body.show-pinyin-all .ex-opt-btn .tok rt,
body.show-pinyin-all .sub-art-pill .tok rt {
  font-size: 10px;
}
body.hide-vi-trans .vi-trans {
  display: none !important;
}
body:not(.show-pinyin-all) .py-opt {
  display: none !important;
}
.gram-vi-box {
  background: #ecfdf5;
  border-left: 2.5px solid #10b981;
  border-radius: 8px;
  padding: 0.56rem 0.85rem;
  margin: 0.45rem 0;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.92;
  color: #064e3b;
}
.gram-vi-box .tok {
  font-family: var(--font-han);
  font-size: 1.36rem;
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
}

/* Footnotes & Exercises */
.footnote-box {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--sf3);
  border: 1.5px solid rgba(43, 33, 24, 0.2);
  border-radius: 16px;
  font-size: 0.88rem;
}
.footnote-item {
  margin: 0.38rem 0;
  font-family: var(--font-ui);
  font-size: 0.80rem;
  line-height: 1.78;
}
.footnote-item .tok {
  font-family: var(--font-han);
  font-size: 1.42rem;
  color: #111827;
}

/* Evidence Highlight & Blank Slots inside Passage */
.evidence-hl {
  background: #fde047 !important;
  color: #1f1700 !important;
  padding: 0.08rem 0.28rem;
  border-radius: 7px;
  box-shadow: 0 0 0 3px #facc15, 0 4px 14px rgba(234, 179, 8, 0.45);
  animation: pulseEv 1.2s ease-out 1;
}
.reader-para.evidence-para-hl {
  background: linear-gradient(90deg, rgba(254, 240, 138, 0.72), rgba(254, 249, 195, 0.4));
  border-left: 4px solid #eab308;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
}
@keyframes pulseEv {
  0% { box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.75); }
  100% { box-shadow: 0 0 0 3px #facc15; }
}
.blank-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.05rem 0.45rem;
  margin: 0 0.15rem;
  border-bottom: 2.5px solid var(--acc-dark);
  background: var(--acc-soft);
  border-radius: 8px;
  font-weight: 800;
  color: var(--acc-dark);
  cursor: pointer;
  text-indent: 0;
}
.blank-slot.filled {
  background: #dcfce7;
  border-color: var(--k-ok);
  color: #065f46;
}
.blank-slot.evidence-hl {
  background: #fde047 !important;
  color: #1f1700 !important;
  border-color: #ca8a04;
}

.exercise-card {
  margin-top: 1.1rem;
  background: var(--sf2);
  border: 1.8px solid var(--ink);
  border-radius: 20px;
  padding: 1.15rem 1.3rem;
}

.exercise-raw {
  font-family: var(--font-han);
  font-size: var(--ex-han-size);
  line-height: 1.85;
  white-space: pre-wrap;
}

.ex-section {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1.5px dashed var(--line);
}
.ex-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.ex-sec-title {
  font-family: var(--font-han);
  font-size: var(--ex-han-size);
  font-weight: 400;
  font-synthesis: none;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.ex-sec-title .tok, .ex-q-card .tok, .ex-opt-btn .tok, .ex-pool-words .tok {
  font-weight: 300;
  font-synthesis: none;
}
.ex-q-card {
  background: var(--sf);
  border: 1.6px solid rgba(43, 33, 24, 0.25);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.7rem;
}
.ex-q-stem {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
  line-height: 1.95;
  margin-bottom: 0.55rem;
}
.ex-q-stem .tok {
  font-family: var(--font-han);
  font-size: var(--ex-han-size);
}
.ex-opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.45rem;
}
.ex-opt-btn {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-radius: 13px;
  border: 1.6px solid rgba(43, 33, 24, 0.35);
  background: var(--sf2);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.75;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.ex-opt-btn .tok {
  font-family: var(--font-han);
  font-size: calc(var(--ex-han-size) * 0.96);
}
.ex-opt-btn:hover { background: var(--acc-soft); border-color: var(--ink); }
.ex-opt-btn.picked-ok { background: #dcfce7; border: 2px solid var(--k-ok); color: #064e3b; }
.ex-opt-btn.picked-bad { background: #fee2e2; border: 2px solid var(--k-bad); color: #7f1d1d; }
.ex-opt-btn.picked-ans { background: #fef08a; border: 2px solid #ca8a04; color: #422006; }

.ex-match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0.75rem;
  align-items: start;
}
.ex-match-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.6rem;
  border-radius: 12px;
  border: 1.4px solid var(--line);
  background: var(--sf2);
}
.ex-match-row.row-ok { background: #ecfdf5; border-color: var(--k-ok); }
.ex-match-row.row-bad { background: #fff1f2; border-color: var(--k-bad); }
@media (max-width: 920px) {
  .ex-match-grid { grid-template-columns: 1fr; }
}
.ex-tf-row { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; margin-top: 0.35rem; }
.ex-tf-btn {
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1.6px solid var(--ink);
  background: var(--sf);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}
.ex-tf-btn.picked-ok { background: #dcfce7; border-color: var(--k-ok); color: #064e3b; }
.ex-tf-btn.picked-bad { background: #fee2e2; border-color: var(--k-bad); color: #7f1d1d; }

.ex-ans-strip {
  margin-top: 0.55rem;
  padding: 0.52rem 0.78rem;
  border-radius: 12px;
  background: #fefce8;
  border: 1.5px solid #eab308;
  font-family: var(--font-ui);
  font-size: 0.80rem;
  line-height: 1.78;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.ex-ans-strip .tok,
.ex-ans-strip .hanzi {
  font-family: var(--font-han);
  font-size: calc(var(--ex-han-size) * 0.96);
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
  line-height: 1.85;
}
.ex-pool-box {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  background: var(--sf3);
  border: 1.5px dashed rgba(43, 33, 24, 0.32);
  font-family: var(--font-ui);
  font-weight: 400;
  font-synthesis: none;
}
.ex-pool-lbl {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--acc-dark);
  flex-shrink: 0;
}
.ex-pool-words, .ex-pool-words .tok {
  font-family: var(--font-sans-cn);
  font-size: calc(var(--ex-han-size) * 1.15);
  font-weight: 300 !important;
  font-synthesis: none;
  line-height: 2.18;
  letter-spacing: 0.02em;
  color: #111827;
}

.answer-box {
  margin-top: 0.8rem;
  padding: 0.9rem 1.05rem;
  background: #ecfdf5;
  border: 1.6px solid var(--k-ok);
  border-radius: 14px;
  font-family: var(--font-han);
  font-size: var(--ex-han-size);
  line-height: 1.85;
  white-space: pre-wrap;
}
body.show-pinyin-all .answer-box,
body.show-pinyin-all .exercise-raw {
  line-height: 2.18;
}
.answer-box .tok,
.exercise-raw .tok {
  cursor: pointer;
}

/* Scan Viewer Panel */
.scan-panel {
  background: var(--sf);
  border: var(--border-ink);
  border-radius: 20px;
  padding: 0.85rem;
  position: sticky;
  top: 1rem;
}
.scan-panel img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

/* Vocabulary Grid & Rows */
.word-tile-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.58rem;
}

.w-tile {
  background: var(--sf);
  border: 1.6px solid var(--ink);
  border-radius: 15px;
  padding: 0.65rem 0.5rem;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.2rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, background 0.12s;
}
.w-tile:hover { transform: translateY(-2px); background: var(--acc-soft); }
.w-tile.mastered { background: #effaf3; border-color: #2e8b57; }
.w-tile-lv {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--soft);
}
.w-tile-han {
  font-family: var(--font-han);
  font-size: 2.18rem;
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
  line-height: 1.25;
}
.w-tile-py {
  font-size: 0.82rem;
  font-weight: 700;
  color: #15803d;
}
.w-tile-vi {
  font-size: 0.78rem;
  color: var(--soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.w-row {
  background: var(--sf);
  border: 1.6px solid var(--ink);
  border-radius: 16px;
  padding: 0.72rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  transition: background 0.12s;
}
.w-row:hover { background: var(--acc-soft); }
.w-row-han {
  font-family: var(--font-han);
  font-size: 2.42rem;
  font-weight: 400;
  font-synthesis: none;
  color: #111827;
  min-width: 140px;
}

/* Flashcard Pro Studio */
.fc-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.fc-card {
  background: var(--sf);
  border: 2.5px solid var(--ink);
  border-radius: 28px;
  padding: 1.85rem 1.6rem;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(43, 33, 24, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fc-card:hover { box-shadow: 0 16px 36px rgba(43, 33, 24, 0.14); }
.fc-card.flipped {
  justify-content: flex-start;
  padding-top: 2.5rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--sf2) 100%);
}
.fc-hero-han {
  font-family: var(--font-sans-cn);
  font-size: 5.4rem;
  font-weight: 300;
  font-synthesis: none;
  color: #111827;
  line-height: 1.15;
  margin: 0.4rem 0;
}
.fc-py {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--k-warn);
  margin: 0.3rem 0;
}
.fc-meaning {
  font-size: 1.05rem;
  color: var(--ink2);
  font-weight: 600;
  max-width: 540px;
  margin: 0.35rem 0;
}

.sm2-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.sm2-btn {
  padding: 0.65rem 0.5rem;
  border-radius: 14px;
  border: 2px solid var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  color: #ffffff;
  transition: transform 0.12s;
}
.sm2-btn:hover { transform: translateY(-1px); }
.sm2-1 { background: #e11d48; }
.sm2-2 { background: #d97706; }
.sm2-3 { background: #059669; }
.sm2-4 { background: #2b2118; }

.fc-queue {
  background: var(--card);
  border: var(--border-ink);
  border-radius: 22px;
  padding: 0.85rem;
  max-height: 490px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.q-item {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  border: 1.4px solid rgba(43, 33, 24, 0.2);
  background: var(--sf);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
}
.q-item.on {
  background: var(--acc);
  border-color: var(--ink);
  font-weight: 800;
}

/* Writing Pad */
.writing-textarea {
  width: 100%;
  min-height: 280px;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 2px solid var(--ink);
  background: var(--sf2);
  font-family: var(--font-han);
  font-size: 1.62rem;
  line-height: 1.85;
  resize: vertical;
}

/* Modal Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(43, 33, 24, 0.48);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal-sheet {
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--sf);
  border: 2.5px solid var(--ink);
  border-radius: 26px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 20px 60px rgba(43, 33, 24, 0.28);
}

/* Realia Graphics / Textbook Tables */
.realia-gallery {
  margin: 0.9rem 0 1.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1.6px dashed rgba(43, 33, 24, 0.35);
  background: var(--sf3);
}
.realia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.realia-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1.6px solid rgba(43, 33, 24, 0.7);
  background: #fff;
}

/* Audio Player Bar */
.audio-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  background: var(--sf3);
  border: 1.6px solid var(--ink);
}
.audio-bar audio {
  flex: 1;
  min-width: 220px;
  height: 36px;
}

/* Utilities */
.muted { color: var(--soft); }
.hanzi { font-family: var(--font-han); font-weight: 400; font-synthesis: none; }
strong.hanzi, .hanzi strong, b.hanzi, .hanzi b { font-weight: 400; font-synthesis: none; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1180px) {
  .sidebar { width: 224px; }
  .reading-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .sidebar { display: none; }
  .mobile-bar { display: flex; }
  .mobile-tabs { display: flex; }
  .main-wrap { padding: 0.9rem 0.85rem 5rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .fc-wrap { grid-template-columns: 1fr; }
  .reader-layout.split-scan { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-sheet { border-radius: 26px 26px 0 0; max-height: 86vh; }
}

@media (max-width: 480px) {
  .reading-list-grid { grid-template-columns: 1fr; }
  .word-tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm2-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== AUDIO TRACK PILLS ==================== */
.track-pills { display: flex; flex-wrap: wrap; gap: 0.38rem; }
.track-btn {
  padding: 0.34rem 0.68rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--sf);
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.track-btn.on { background: var(--acc); font-weight: 800; }

/* ==================== CANDY CRUSH SONG NGU ==================== */
.cc-wrap.cc-fullscreen {
  position: fixed; inset: 0; z-index: 80;
  overflow-y: auto; overflow-x: hidden; padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%);
}
.cc-topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 0.45rem;
  background: var(--sf); border: var(--border-ink); border-radius: 16px;
  padding: 0.48rem 0.85rem; margin-bottom: 0.48rem;
}
.cc-level-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.45rem; background: var(--card); border: 1.6px solid var(--ink);
  border-radius: 15px; padding: 0.45rem 0.8rem; margin-bottom: 0.55rem;
}
.cc-main-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0.78rem; align-items: start;
}
.cc-board-card {
  background: var(--sf); border: var(--border-ink); border-radius: 20px; padding: 0.72rem;
  min-width: 0;
}
.cc-grid-scroll {
  max-height: 76vh; overflow-y: auto; overflow-x: hidden; padding: 0.25rem;
  overscroll-behavior: contain; scrollbar-gutter: stable;
}
.cc-wrap.cc-fullscreen .cc-grid-scroll { max-height: calc(100vh - 172px); }
.cc-grid {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.38rem; --cc-scale: 1.24;
}
.cc-tile {
  border-radius: 12px; padding: 0.34rem 0.24rem;
  height: calc(54px + 18px * var(--cc-scale, 1.24));
  overflow: hidden;
  border: 1.5px solid rgba(0,0,0,0.20); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; user-select: none; position: relative;
  transition: box-shadow 0.12s ease, filter 0.12s ease, background-color 0.12s ease;
}
.cc-tile:hover { filter: brightness(0.97); box-shadow: 0 3px 10px rgba(43,33,24,0.13); }
.cc-tile.selected {
  box-shadow: inset 0 0 0 2.8px #1c1917, 0 0 0 2px rgba(28,25,23,0.22);
  filter: brightness(1.03);
  z-index: 2;
}
.cc-tile.hinted {
  box-shadow: inset 0 0 0 2.5px #d97706, 0 0 10px rgba(245,158,11,0.45);
}
.cc-tile.wrong { animation: shakeTile 0.28s ease; }
.cc-tile.cc-drop { animation: ccDropIn 0.22s ease; }
@keyframes ccDropIn {
  0% { transform: translateY(-8px); opacity: 0.65; }
  100% { transform: translateY(0); opacity: 1; }
}
.cc-tile-w { font-family: var(--font-sans-cn); font-size: calc(1.32rem * var(--cc-scale)); font-weight: 400; font-synthesis: none; line-height: 1.15; }
.cc-wrap .hanzi, .cc-side-card .hanzi { font-family: var(--font-sans-cn); font-weight: 400; font-synthesis: none; }
.cc-tile-vi { font-size: 0.75rem; font-weight: 600; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-tile-ipa { font-size: 0.7rem; font-weight: 600; color: #065f46; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-color-0 { background: #bae6fd; border-color: #38bdf8; color: #0c4a6e; }
.cc-color-1 { background: #fed7aa; border-color: #fb923c; color: #7c2d12; }
.cc-color-2 { background: #a7f3d0; border-color: #34d399; color: #064e3b; }
.cc-color-3 { background: #fef08a; border-color: #eab308; color: #713f12; }
.cc-color-4 { background: #fecdd3; border-color: #fb7185; color: #881337; }
.cc-color-5 { background: #ddd6fe; border-color: #a78bfa; color: #4c1d95; }
.cc-sidebar { display: flex; flex-direction: column; gap: 0.7rem; }
.cc-side-card { background: var(--sf); border: var(--border-ink); border-radius: 20px; padding: 0.85rem 0.95rem; }
.cc-goal-row { margin-bottom: 0.48rem; font-size: 0.84rem; font-weight: 700; }
.cc-goal-bar { height: 7px; border-radius: 999px; background: var(--sf3); border: 1px solid var(--line); overflow: hidden; margin-top: 0.2rem; }
.cc-goal-fill { height: 100%; background: linear-gradient(90deg, #10b981, #059669); transition: width 0.25s; }
.cc-stage-chips { max-height: 210px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.cc-mini-chip {
  padding: 0.24rem 0.5rem; border-radius: 999px; border: 1.3px solid rgba(43,33,24,0.28);
  background: var(--sf2); font-size: 0.76rem; font-weight: 700; cursor: pointer;
}
.cc-mini-chip:hover { background: var(--acc); }

/* ==================== GAME NOI TU ==================== */
.match-spotlight {
  display: flex; flex-direction: column; gap: 0.42rem;
  padding: 0.62rem 0.9rem; background: var(--sf3);
  border: 1.6px solid var(--ink); border-radius: 14px; margin-bottom: 0.6rem; min-height: 54px;
}
.match-spot-top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.45rem; width: 100%;
}
.match-spot-ex {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.55rem; flex-wrap: wrap;
  padding: 0.42rem 0.65rem; border-radius: 10px; background: var(--sf);
  border: 1px dashed rgba(5, 150, 105, 0.42); font-size: 0.88rem; line-height: 1.6;
}
.match-spot-ex .hanzi { line-height: 2.02; display: inline-block; }
.match-spot-ex .tok.vocab-hit, .match-spot-ex .tok.vocab-hit .rb {
  color: #b45309; background: #fef3c7; border-radius: 4px; padding: 0 2px; font-weight: 600; text-decoration: none;
}
.match-progress-track {
  width: 100%; height: 9px; border-radius: 999px; background: var(--sf2);
  border: 1px solid var(--line); overflow: hidden; margin: 0.35rem 0 0.65rem;
}
.match-progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #059669); transition: width 0.25s ease; }
.match-arena-wrap { position: relative; min-width: 0; width: 100%; overflow-x: hidden; }
.match-svg-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.match-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; position: relative; z-index: 2; min-width: 0; width: 100%; }
.match-col-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; min-width: 0; width: 100%; }
.match-tile {
  position: relative; z-index: 2; min-height: 44px; min-width: 0; width: 100%; background: var(--sf);
  border: 1.4px solid rgba(43, 33, 24, 0.52); border-radius: 11px; padding: 0.34rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; font-weight: 500; overflow-wrap: anywhere;
  transition: transform 0.12s, background 0.14s, box-shadow 0.14s; user-select: none;
}
.match-tile.left-han {
  font-family: var(--font-sans-cn);
  font-size: 1.24rem;
  font-weight: 400;
  color: #111827;
  font-synthesis: none;
  line-height: 1.25;
}
.match-tile:hover:not(.matched) { background: var(--sf3); transform: translateY(-1px); }
.match-tile.selected { background: var(--acc); box-shadow: 0 0 0 3px rgba(43,33,24,0.22); transform: scale(1.02); }
.match-tile.hinted { box-shadow: 0 0 0 3px #f59e0b; border-color: #d97706; background: #fef3c7; }
.match-tile.matched {
  background: #f3f7f4;
  border-color: rgba(5, 150, 105, 0.42);
  color: #4b5563;
  cursor: default;
  transform: scale(0.97);
}
.match-tile.left-han.matched { color: #475569; background: #f8fafc; }
.match-tile.matched > span:not(.match-pair-tag) { opacity: 0.72; }
.match-tile.wrong { background: #ffdcd6; border-color: #b91c1c; animation: shakeTile 0.32s; }
.match-pair-tag {
  position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: #059669; color: #fff; font-size: 0.68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
@keyframes shakeTile { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* ==================== TRUYEN CHEM & MIZIGE WORKSHEET ==================== */
.cloze-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.78rem; }
.cloze-card {
  background: var(--sf); border: 1.8px solid var(--ink); border-radius: 18px;
  padding: 0.9rem 1rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.42rem; text-align: left;
}
.cloze-card:hover { background: var(--sf2); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(43,33,24,0.09); }
.cloze-story-body { font-size: 0.84rem; line-height: 2.2; color: #111827; }
.cloze-story-body .zh-inline { font-family: var(--font-han); font-size: calc(var(--reader-size) * 1.04); font-weight: 400; font-synthesis: none; color: #111827; cursor: pointer; padding: 0 0.08rem; border-radius: 6px; }
.cloze-story-body .zh-inline:hover { background: var(--acc); }
.cloze-story-body .vi-trans { font-size: 0.76rem !important; font-weight: 500 !important; }

.gram-title-line {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.94rem;
  line-height: 1.85; letter-spacing: 0.01em; color: var(--ink); margin-bottom: 0.35rem;
}
.gram-title-line .tok {
  font-family: var(--font-han); font-size: 1.48rem; font-weight: 400; color: #111827;
}
.gram-formula {
  background: var(--note); border: 1.5px solid rgba(43,33,24,0.22);
  border-radius: 12px; padding: 0.56rem 0.85rem; margin: 0.5rem 0;
  font-family: var(--font-ui); font-size: 0.90rem; font-weight: 500;
  font-synthesis: none; color: #111827; line-height: 1.9; letter-spacing: 0.01em;
}
.gram-formula .tok {
  font-family: var(--font-han); font-size: 1.48rem; font-weight: 400; color: #111827;
}
.gram-body-box {
  font-family: var(--font-ui); font-size: 0.90rem; line-height: 1.88;
  letter-spacing: 0.01em; white-space: pre-wrap; color: var(--ink2);
}
.gram-body-box .tok {
  font-family: var(--font-han); font-size: 1.38rem; font-weight: 400; color: #111827;
}
.gram-err {
  background: #fff1f2; border-left: 2.5px solid #e11d48;
  border-radius: 8px; padding: 0.56rem 0.85rem; margin: 0.5rem 0;
  font-family: var(--font-ui); font-size: 0.86rem; font-weight: 400; letter-spacing: 0.01em;
  white-space: pre-wrap; line-height: 1.92;
}
.gram-err .tok {
  font-family: var(--font-han); font-size: 1.44rem; font-weight: 400; color: #111827;
}
.gram-ex-box {
  margin-top: 0.5rem; padding: 0.58rem 0.84rem; border-radius: 10px;
  background: var(--sf2); border: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 0.90rem; line-height: 1.88;
  letter-spacing: 0.01em; color: #1f2937; white-space: pre-wrap;
}
.gram-ex-box.vi-only { background: #fefce8; border-color: #fde047; }
.gram-ex-box .tok {
  font-family: var(--font-han); font-size: calc(var(--ex-han-size) * 1.12);
  font-weight: 400; color: #111827;
}

.worksheet-box {
  background: #ffffff; border: 2px solid var(--ink); border-radius: 18px;
  padding: 1.25rem; margin-top: 0.9rem;
}
.ws-table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; font-size: 0.9rem; }
.ws-table th, .ws-table td { border: 1.4px solid #334155; padding: 0.48rem 0.6rem; text-align: left; }
.ws-table th { background: var(--sf3); font-weight: 800; }
.ws-table .han-cell { font-family: var(--font-sans-cn); font-size: 1.44rem; font-weight: 400; font-synthesis: none; color: #111827; }
.mizi-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 0.35rem 0 0.75rem; }
.mizi-cell {
  width: 44px; height: 44px; position: relative;
  border: 1.6px solid #dc2626; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-han); font-size: 1.82rem; font-weight: 400; font-synthesis: none;
  background-image:
    linear-gradient(to right, transparent 49%, rgba(220,38,38,0.35) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, rgba(220,38,38,0.35) 50%, transparent 51%),
    linear-gradient(to top right, transparent 49.2%, rgba(220,38,38,0.22) 50%, transparent 50.8%),
    linear-gradient(to bottom right, transparent 49.2%, rgba(220,38,38,0.22) 50%, transparent 50.8%);
}
.mizi-cell.tian {
  background-image:
    linear-gradient(to right, transparent 49%, rgba(220,38,38,0.35) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, rgba(220,38,38,0.35) 50%, transparent 51%);
}
.mizi-cell.blank-grid { background-image: none; }
.mizi-cell.trace { color: rgba(43,33,24,0.22); }
.mizi-grid-blue .mizi-cell { border-color: #1d4ed8; }
.mizi-grid-green .mizi-cell { border-color: #15803d; }
.mizi-grid-gray .mizi-cell { border-color: #64748b; }
.sheet-a4-modal { width: min(980px, 100%) !important; max-height: 92vh !important; }
.ws-fill-inp {
  width: 100%; padding: 0.28rem 0.45rem; border-radius: 6px;
  border: 1.2px dashed #64748b; background: #f8fafc; font-size: 0.88rem;
}
.ws-table.eco th, .ws-table.eco td {
  padding: 0.24rem 0.38rem; font-size: 0.8rem; border: 1px solid #475569; vertical-align: middle;
}
.ws-eco-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem 0.55rem; margin-top: 0.45rem;
}
.ws-eco-grid.one-col { grid-template-columns: 1fr; }
.ws-eco-item {
  border: 1px solid #94a3b8; border-radius: 7px;
  padding: 0.32rem 0.45rem; background: #fff;
  break-inside: avoid; page-break-inside: avoid;
}
.ws-eco-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.28rem; font-size: 0.8rem; line-height: 1.32; color: #1e293b;
}
.ws-eco-han {
  font-family: var(--font-sans-cn); font-size: 1.14rem;
  font-weight: 400; font-synthesis: none; color: #111827;
}
.ws-blank-line {
  display: inline-block; min-width: 72px; border-bottom: 1.2px dashed #475569;
  height: 0.95em; vertical-align: baseline;
}
.mizi-row.compact { gap: 2px; margin: 0.24rem 0 0.1rem; }
.mizi-cell.compact {
  width: 31px; height: 31px; font-size: 1.48rem; line-height: 1; border-width: 1.15px;
}
.mizi-row.full-row {
  display: grid;
  grid-template-columns: repeat(var(--mz-cols, 22), minmax(0, 1fr));
  gap: 2.5px;
  width: 100%;
  margin: 0.28rem 0 0.18rem;
}
.mizi-row.full-row .mizi-cell,
.mizi-row.full-row .mizi-cell.compact {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  font-size: clamp(0.95rem, 1.9vw, 1.52rem);
  line-height: 1;
  border-width: 1.15px;
}
.ws-sent-line {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.24rem;
  width: 100%;
}
.ws-sent-rule {
  flex: 1;
  min-width: 80px;
  border-bottom: 1.25px dashed #94a3b8;
  height: 0.95em;
}
@media print {
  .mizi-row.full-row .mizi-cell,
  .mizi-row.full-row .mizi-cell.compact {
    font-size: 14.5pt;
  }
}

/* ==================== XUONG VIET 3 BAI MAU & PHAN TICH DAT GIA ==================== */
.wr-model-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem; margin-bottom: 0.85rem;
}
.wr-model-tab {
  text-align: left; padding: 0.62rem 0.78rem; border-radius: 15px;
  border: 1.6px solid rgba(43, 33, 24, 0.35); background: var(--sf);
  cursor: pointer; transition: transform 0.12s ease, background 0.14s ease, box-shadow 0.14s ease;
  display: flex; flex-direction: column; gap: 0.2rem; min-width: 0;
}
.wr-model-tab:hover { background: var(--acc-soft); transform: translateY(-1px); }
.wr-model-tab.active {
  background: linear-gradient(135deg, var(--acc-soft) 0%, var(--acc) 100%);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 10px rgba(43, 33, 24, 0.10);
}
.wr-model-tab-kicker { font-size: 0.72rem; font-weight: 800; color: var(--acc-dark); }
.wr-model-tab-title {
  font-family: var(--font-sans-cn); font-size: 0.96rem; font-weight: 500;
  font-synthesis: none; color: #111827; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wr-outline-box {
  background: var(--sf2); border: 1.4px solid rgba(43, 33, 24, 0.18);
  border-left: 4px solid var(--acc-dark); border-radius: 14px;
  padding: 0.62rem 0.85rem; margin: 0.65rem 0 0.9rem; font-size: 0.80rem; line-height: 1.55;
}
.wr-analysis-block {
  margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1.5px dashed var(--line);
}
.wr-analysis-title {
  margin: 0 0 0.65rem; font-size: 0.98rem; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.wr-gem-card, .wr-gram-card {
  background: var(--sf); border: 1.5px solid rgba(43, 33, 24, 0.24);
  border-radius: 16px; padding: 0.75rem 0.88rem;
  display: flex; flex-direction: column; gap: 0.36rem;
}
.wr-gem-word {
  font-family: var(--font-sans-cn); font-size: 1.85rem; font-weight: 400;
  font-synthesis: none; color: #111827; cursor: pointer;
}
.wr-gem-word:hover { color: var(--k-bad); text-decoration: underline; }
.wr-upgrade-strip {
  font-size: 0.80rem; background: var(--note); border: 1px solid rgba(43, 33, 24, 0.14);
  border-radius: 10px; padding: 0.40rem 0.65rem; line-height: 1.6;
}
.wr-upgrade-strip .hanzi {
  font-size: 1.42rem; color: #111827;
}
.wr-gram-formula {
  font-family: var(--font-ui); font-size: 0.86rem; font-weight: 500;
  font-synthesis: none; color: var(--acc-dark);
  background: var(--sf2); border-radius: 10px; padding: 0.45rem 0.72rem;
  border-left: 3.5px solid var(--k-info); line-height: 1.85;
}
.wr-gram-formula .tok {
  font-family: var(--font-han); font-size: 1.62rem; color: #111827; font-weight: 400;
}
@media (max-width: 920px) {
  .wr-model-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 1120px) {
  .cc-main-grid { grid-template-columns: 1fr; }
  .match-board { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 720px) {
  .ws-eco-grid { grid-template-columns: 1fr; }
}

/* ==================== SPEAKING EXAMINER CHATBOT ==================== */
.spk-chat-shell {
  margin-top: 0.45rem;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 0.9rem;
}
.spk-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 0.75rem;
}
.spk-chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  gap: 0.85rem;
  align-items: start;
}
.spk-chat-main {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.spk-chat-log {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
}
.sc-msg {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
}
.sc-msg.examiner {
  background: #eff6ff;
  border-color: #bfdbfe;
  align-self: stretch;
}
.sc-msg.student {
  background: #fdfcfb;
  border-color: #cbd5e1;
  align-self: stretch;
}
.sc-msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--soft);
  margin-bottom: 0.35rem;
}
.sc-pron-tok {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.14rem 0.36rem;
  margin: 0.12rem 0.12rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}
.sc-pron-tok:hover {
  transform: translateY(-1px);
  border-color: var(--acc-dark);
}
.sc-pron-tok.hard {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}
.sc-pron-py {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.15;
}
.sc-pron-tok.hard .sc-pron-py {
  color: #b91c1c;
}
.sc-eval-box {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.sc-eval-row {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink2);
}
.sc-pron-panel {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 0.45rem 0.65rem;
}
.spk-input-bar {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.65rem;
}
.spk-coach-side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.spk-coach-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}
.spk-gram-pill {
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  background: var(--sf2);
  border-left: 3px solid #dc2626;
}
.ex-exp-text {
  color: #0f172a;
  font-size: 0.84rem;
  line-height: 1.65;
  flex: 1 1 260px;
}
.ex-ev-hl {
  background: #fef08a;
  color: #111827 !important;
  border-bottom: 2.5px solid #d97706;
  border-radius: 5px;
  padding: 0.08em 0.2em;
  box-shadow: 0 0 0 2px #fde047;
  animation: exEvPulse 1.4s ease-out 1;
}
@keyframes exEvPulse {
  0% { background: #fde047; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.42); }
  100% { background: #fef08a; box-shadow: 0 0 0 2px #fde047; }
}
.ex-ev-banner {
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: #fef9c3;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #78350f;
  font-weight: 700;
}

/* ==================== EXPORT CENTER (THEO BAI / THEO QUYEN) ==================== */
.exp-center-shell {
  margin-top: 0.35rem;
}
.exp-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.exp-lbl {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink2);
}
.exp-dl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1.5px solid #bfdbfe;
  margin-bottom: 0.85rem;
}
.exp-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
}
.exp-prev-card {
  background: var(--sf2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  max-height: 520px;
  overflow-y: auto;
}
.exp-prev-head {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--acc-dark);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 900px) {
  .exp-filter-grid, .exp-preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .spk-chat-grid { grid-template-columns: 1fr; }
}

.print-only { display: none; }
/* ==================== LEXIBOT COMPREHENSIVE REPORT ==================== */
.lx-report {
  background: #ffffff;
  border: 1.8px solid rgba(43, 33, 24, 0.4);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  color: #111827;
  font-family: var(--font-ui);
  box-shadow: 0 6px 20px rgba(43, 33, 24, 0.06);
}
.lx-sec-hdr {
  font-size: 1.04rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-ui);
  border-left: 4px solid var(--acc-dark);
  background: var(--sf2);
  padding: 0.42rem 0.75rem;
  border-radius: 0 8px 8px 0;
  margin: 1.1rem 0 0.55rem;
}
.lx-zh { font-family: var(--font-sans-cn); font-size: 1.50rem; font-weight: 400; font-synthesis: none; color: #0f172a; line-height: 1.9; letter-spacing: 0.015em; }
.lx-han-run { font-family: var(--font-sans-cn); font-size: 1.40rem; font-weight: 400; font-synthesis: none; color: #0f172a; padding: 0 1.5px; }

/* ==================== 10-SECTION COMPREHENSIVE LESSON REPORT ==================== */
.rep-sheet {
  font-family: var(--font-ui);
  color: #111827;
  line-height: 1.65;
  background: #ffffff;
  padding: 0.4rem 0.25rem;
}
.rep-header {
  border-bottom: 2.5px solid #1e3a8a;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.rep-kicker { font-size: 0.78rem; font-weight: 800; color: #1d4ed8; letter-spacing: 0.06em; text-transform: uppercase; }
.rep-title-zh { font-family: var(--font-sans-cn); font-size: 1.85rem; font-weight: 400; color: #0f172a; margin: 0.25rem 0 0.15rem; line-height: 1.35; }
.rep-title-vi { font-size: 1.05rem; font-weight: 800; color: #991b1b; }
.rep-sub { font-size: 0.80rem; color: #475569; margin-top: 0.2rem; }
.rep-sec-h1 {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e3a8a;
  background: #eff6ff;
  border-left: 4px solid #1d4ed8;
  padding: 0.42rem 0.72rem;
  border-radius: 6px;
  margin: 1.15rem 0 0.65rem;
}
.rep-sec-h2 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.75rem 0 0.3rem;
}
.rep-para-block {
  border: 1.2px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.72rem 0.9rem;
  margin-bottom: 0.65rem;
  background: #fafafa;
  break-inside: avoid;
}
.rep-zh {
  font-family: var(--font-sans-cn);
  font-size: 1.48rem;
  font-weight: 400;
  font-synthesis: none;
  color: #0f172a;
  line-height: 1.9;
  letter-spacing: 0.015em;
}
.rep-zh-sm {
  font-family: var(--font-sans-cn);
  font-size: 1.32rem;
  font-weight: 400;
  font-synthesis: none;
  color: #0f172a;
  line-height: 1.75;
}
.rep-py { font-family: var(--font-ui); font-size: 0.86rem; color: #0f766e; font-weight: 600; margin-top: 0.22rem; line-height: 1.5; }
.rep-vi { font-family: var(--font-ui); font-size: 0.90rem; color: #1e293b; margin-top: 0.25rem; line-height: 1.6; }
.rep-tbl { width: 100%; border-collapse: collapse; margin: 0.45rem 0 0.8rem; font-size: 0.86rem; }
.rep-tbl th { background: #1e3a8a; color: #ffffff; padding: 0.5rem 0.65rem; border: 1px solid #cbd5e1; text-align: left; }
.rep-tbl td { padding: 0.5rem 0.65rem; border: 1px solid #cbd5e1; vertical-align: top; line-height: 1.55; }
.rep-note { background: #fffbeb; border-left: 3.5px solid #d97706; padding: 0.52rem 0.75rem; border-radius: 6px; font-size: 0.86rem; margin: 0.45rem 0; }
.lx-py { font-family: var(--font-ui); font-size: 0.86rem; color: #0f766e; font-weight: 600; line-height: 1.5; margin-top: 0.15rem; }
.lx-vi { font-family: var(--font-ui); font-size: 0.9rem; color: #1e293b; line-height: 1.6; margin-top: 0.25rem; }
.lx-pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0;
}
.lx-pillar-card {
  border: 1.3px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
}
.lx-pillar-card ul { margin: 0.35rem 0 0 1.1rem; padding: 0; font-size: 0.82rem; line-height: 1.5; color: #334155; }
.lx-para-card {
  border: 1.2px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
  break-inside: avoid;
}
.lx-para-role { font-size: 0.86rem; font-weight: 800; color: #b91c1c; margin-bottom: 0.35rem; letter-spacing: 0.02em; }
.lx-rewrite-box { background: #ecfdf5; border-left: 3.5px solid #10b981; padding: 0.55rem 0.75rem; border-radius: 6px; margin-top: 0.45rem; }
.lx-tbl { width: 100%; border-collapse: collapse; margin: 0.45rem 0 0.8rem; font-size: 0.84rem; }
.lx-tbl th { background: #1e293b; color: #ffffff; padding: 0.48rem 0.6rem; border: 1px solid #cbd5e1; text-align: left; }
.lx-tbl td { padding: 0.48rem 0.6rem; border: 1px solid #cbd5e1; vertical-align: top; line-height: 1.5; }
@media (max-width: 780px) { .lx-pillar-grid { grid-template-columns: 1fr; } }

/* Song ngữ song song Hán - Việt (đỡ tốn diện tích, gọn khi ẩn Việt) */
.bi-par-row {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: 0.4rem 0.9rem;
  align-items: start;
  margin-bottom: 0.46rem;
  padding-bottom: 0.34rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}
.bi-par-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.bi-par-row > .reader-para { margin: 0 !important; }
.bi-par-row > .reader-para-vi { margin: 0 !important; align-self: stretch; }
body.hide-vi-trans .bi-par-row { grid-template-columns: 1fr; border-bottom: none; padding-bottom: 0; }

.warmup-parallel { display: flex; flex-direction: column; gap: 0.26rem; margin-top: 0.35rem; }
.warmup-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  padding: 0.2rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
}
.warmup-row:last-child { border-bottom: none; padding-bottom: 0; }
.warmup-zh { font-family: var(--font-han); font-size: var(--ex-han-size); line-height: 1.65; }
.warmup-vi { font-family: var(--font-ui); font-size: 0.85rem; line-height: 1.5; color: #065f46; }
body.hide-vi-trans .warmup-row { grid-template-columns: 1fr; }
@media (max-width: 820px) {
  .bi-par-row, .warmup-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media print {
  @page { size: A4 portrait; margin: 7mm 8mm; }
  body { background: #fff !important; font-size: 10.5pt; }
  .print-only { display: block !important; }
  .sidebar, .mobile-bar, .mobile-tabs, .no-print, .reader-toolbar, .writing-textarea, .match-arena-wrap, .match-board, .match-svg-layer, .match-progress-track, .match-spotlight { display: none !important; }
  .lx-report { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .main-wrap { padding: 0 !important; margin: 0 !important; }
  .card, .worksheet-box {
    border: none !important; border-radius: 0 !important;
    box-shadow: none !important; background: #fff !important;
    padding: 0 !important; margin: 0 !important;
  }
  .ws-fill-inp {
    border: none !important; border-bottom: 1px dashed #334155 !important;
    border-radius: 0 !important; background: transparent !important;
    color: transparent !important; padding: 0 0.15rem !important;
  }
  .ws-fill-inp::placeholder { color: transparent !important; }
  .mizi-cell, .ws-eco-item { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .modal-backdrop.open { position: static !important; background: #fff !important; padding: 0 !important; display: block !important; }
  .modal-backdrop.open .modal-sheet { max-height: none !important; overflow: visible !important; border: none !important; box-shadow: none !important; width: 100% !important; padding: 0 !important; }
}

/* ==================== MINDMAP STUDIO (TC -> CC VOCAB + GRAMMAR + CLASSIFICATION) ==================== */
.mm-canvas {
  position: relative;
  padding: 0.9rem 1.05rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,250,238,0.68));
  border: 1.5px solid rgba(43, 33, 24, 0.16);
  border-radius: 18px;
  overflow: clip;
}
.mm-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.mm-tree-3col,
.mm-sym-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr) minmax(0, 1.25fr);
  gap: 1.85rem;
  align-items: start;
}
.mm-branch-col,
.mm-center-col,
.mm-gram-root,
.mm-gram-subs,
.mm-up-col,
.mm-up-arrow {
  position: relative;
  z-index: 1;
}
.mm-center-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  position: sticky;
  top: 0.75rem;
  align-self: start;
}
.mm-hub-card {
  background: var(--sf);
  border: 2px solid var(--acc-dark);
  border-radius: 18px;
  padding: 0.95rem 0.9rem;
  text-align: center;
  box-shadow: 0 8px 22px rgba(43, 33, 24, 0.08);
}
.mm-hub-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc-dark);
  border: 1px solid rgba(43, 33, 24, 0.16);
}
.mm-hub-char {
  font-size: 3.1rem;
  line-height: 1.18;
  color: #111827;
  font-weight: 400;
  font-synthesis: none;
  margin: 0.35rem 0 0.2rem;
}
.mm-hub-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.mm-hub-vi {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  color: #1e293b;
  line-height: 1.45;
}
.mm-hub-stats {
  margin-top: 0.45rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.mm-col-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.77rem;
  font-weight: 800;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.mm-col-badge.tc { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.mm-col-badge.cc { background: #ffe4e6; color: #be123c; border: 1px solid #fda4af; }
.mm-col-badge.bridge { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.mm-col-badge.idiom { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.mm-col-badge.hsk { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }

.mm-node-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
}
.mm-node-stack.compact {
  grid-template-columns: 1fr;
}
.mm-word-node {
  text-align: left;
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 1.5px solid rgba(43, 33, 24, 0.16);
  border-left-width: 3.5px;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  font-family: var(--font-ui);
}
.mm-word-node:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 33, 24, 0.09);
  background: var(--acc-soft);
}
.mm-word-node.is-tc { border-left-color: #0284c7; }
.mm-word-node.is-cc { border-left-color: #e11d48; }
.mm-word-node.is-bridge { border-left-color: #d97706; background: #fffbeb; }
.mm-word-node.is-idiom { border-left-color: #dc2626; background: #fff5f5; }
.mm-word-node.is-hsk { border-left-color: #7c3aed; background: #faf5ff; }
.mm-wn-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.4rem;
}
.mm-wn-han {
  font-size: 1.24rem;
  color: #111827;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}
.mm-wn-han.wrap {
  white-space: normal;
  word-break: break-word;
  flex-shrink: 1;
}
.mm-wn-hv {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--k-hv);
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}
.mm-wn-py { font-size: 0.74rem; color: #047857; font-weight: 600; margin-top: 0.08rem; }
.mm-wn-vi {
  font-size: 0.77rem;
  color: var(--ink2);
  margin-top: 0.12rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mm-wn-src { font-size: 0.66rem; color: var(--soft); margin-top: 0.16rem; }

.mm-quick-roots {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.65rem 0.78rem;
  background: var(--sf2);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.mm-qroot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.34rem;
}
.mm-qroot-lbl {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink2);
  min-width: 150px;
}
.mm-bridge-spine {
  padding: 0.65rem;
  border-radius: 14px;
  background: #fffdf5;
  border: 1.5px dashed #f59e0b;
}

/* Upgrade Ladders */
.mm-upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.mm-up-card {
  background: var(--sf);
  border: 1.5px solid rgba(43, 33, 24, 0.18);
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
}
.mm-up-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.mm-up-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
.mm-up-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mm-up-arrow {
  text-align: center;
  padding: 0.48rem 0.32rem;
  border-radius: 12px;
  background: var(--acc-soft);
  border: 1.5px dashed var(--acc-dark);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--acc-dark);
  line-height: 1.3;
  position: sticky;
  top: 0.75rem;
}

/* Grammar Family Mindmap */
.mm-fam-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.mm-fam-pill {
  text-align: left;
  padding: 0.58rem 0.75rem;
  border-radius: 14px;
  border: 1.5px solid rgba(43, 33, 24, 0.18);
  background: var(--sf);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  transition: transform 0.12s, background 0.12s;
}
.mm-fam-pill:hover { transform: translateY(-1px); background: var(--fam-bg, var(--acc-soft)); }
.mm-fam-pill.on {
  background: var(--fam-bg, var(--acc-soft));
  border-color: var(--fam-c, var(--ink));
  box-shadow: 0 0 0 2px var(--fam-c, var(--ink));
}
.mm-fp-top { font-size: 0.82rem; color: #111827; }
.mm-fp-cnt {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--fam-c, var(--acc-dark));
  white-space: nowrap;
}
.mm-gram-canvas {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.65rem;
  align-items: start;
}
.mm-gram-root {
  border: 2px solid;
  border-radius: 16px;
  padding: 0.85rem;
  text-align: center;
}
.mm-gram-subs {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.mm-sub-row {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}
.mm-sub-node {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid rgba(43, 33, 24, 0.18);
  background: #ffffff;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.83rem;
}
.mm-sub-node.on {
  background: var(--acc-soft);
  box-shadow: 0 0 0 2px var(--ink);
}
.mm-chain-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.45rem;
  align-items: stretch;
}
.mm-step-arrow {
  align-self: center;
  font-weight: 900;
  color: var(--acc-dark);
  font-size: 0.95rem;
}
.mm-chain-card {
  flex: 1 1 170px;
  text-align: left;
  padding: 0.48rem 0.62rem;
  border-radius: 12px;
  border: 1.4px solid rgba(43, 33, 24, 0.18);
  background: #ffffff;
  cursor: pointer;
  font-family: var(--font-ui);
}
.mm-chain-card:hover { background: var(--acc-soft); }
.mm-lv-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  margin-bottom: 0.2rem;
}
.mm-cc-pat { font-size: 0.96rem; font-weight: 400; color: #111827; line-height: 1.45; }
.mm-cc-pat .tok { font-size: 1.05rem; }
.mm-cc-hint { font-size: 0.75rem; color: var(--soft); margin-top: 0.15rem; line-height: 1.35; }

.mm-gram-explorer {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 0.85rem;
  margin-top: 0.85rem;
  align-items: start;
}
.mm-gram-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.mm-gram-list.expanded {
  max-height: none;
  overflow-y: visible;
}
.mm-gram-detail {
  background: var(--sf);
  border: 1.6px solid rgba(43, 33, 24, 0.22);
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  position: sticky;
  top: 0.75rem;
}

/* Classify Layout */
.mm-cls-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
.mm-cls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.mm-cls-cat {
  text-align: left;
  padding: 0.58rem 0.72rem;
  border-radius: 13px;
  border: 1.5px solid rgba(43, 33, 24, 0.16);
  background: var(--sf);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}
.mm-cls-cat:hover { background: var(--cat-bg, var(--acc-soft)); }
.mm-cls-cat.on {
  background: var(--cat-bg, var(--acc-soft));
  border-color: var(--cat-c, var(--ink));
  box-shadow: 0 0 0 2px var(--cat-c, var(--ink));
}
.mm-cls-bar {
  display: flex;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin-top: 0.3rem;
}

@media (max-width: 1080px) {
  .mm-tree-3col, .mm-sym-grid, .mm-up-canvas, .mm-gram-canvas, .mm-sub-row, .mm-gram-explorer, .mm-cls-layout {
    grid-template-columns: 1fr;
  }
  .mm-fam-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mm-node-stack, .mm-fam-strip { grid-template-columns: 1fr; }
}

/* =========================================================
   TRU2092 & TRU2102 Grammar Exams & Syntax Notation Helpers
   ========================================================= */
.np-paper-banner {
  background: linear-gradient(135deg, #fffdf7 0%, #f5efe6 100%);
  border: 1.5px solid rgba(43, 33, 24, 0.22);
  border-radius: 14px;
  padding: 0.72rem 0.95rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.np-tile-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0.45rem 0;
}
.np-word-tile {
  padding: 0.36rem 0.68rem;
  border-radius: 10px;
  border: 1.4px solid rgba(43, 33, 24, 0.24);
  background: #ffffff;
  font-family: var(--font-han);
  font-size: 1.12rem;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.np-word-tile:hover:not(:disabled) {
  border-color: var(--acc-dark);
  background: var(--acc-soft);
  transform: translateY(-1px);
}
.np-word-tile.used {
  opacity: 0.42;
  background: var(--sf2);
  cursor: default;
}
.np-answer-tray {
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1.4px dashed rgba(43, 33, 24, 0.28);
  background: var(--sf2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.36rem;
  font-family: var(--font-han);
  font-size: 1.16rem;
}
.np-answer-tray.ok { border-color: #16a34a; background: #f0fdf4; border-style: solid; }
.np-answer-tray.bad { border-color: #dc2626; background: #fef2f2; border-style: solid; }
.np-picked-chip {
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-dark);
  cursor: pointer;
  font-size: 1.08rem;
}
.syn-notation {
  font-family: var(--font-han);
  font-size: var(--ex-han-size, 1.32rem);
  line-height: 2.35;
  color: #111827;
}
.syn-sep {
  display: inline-block;
  margin: 0 0.32rem;
  padding: 0 0.25rem;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 900;
  font-family: var(--font-ui);
}
.syn-att {
  padding: 0.06rem 0.24rem;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}
.syn-adv {
  padding: 0.06rem 0.24rem;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}
.syn-comp {
  padding: 0.06rem 0.24rem;
  border-radius: 6px;
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  color: #6d28d9;
}
.syn-obj {
  padding: 0.05rem 0.2rem;
  text-decoration: underline wavy #d97706 2px;
  text-underline-offset: 6px;
  background: #fffbeb;
  border-radius: 4px;
}
.syn-sym-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.38rem;
}
.np-book-html { font-size: 0.9rem; line-height: 1.78; color: var(--ink); }
.np-book-html b { color: var(--acc-dark); }
.np-book-html ul, .np-book-html ol { margin: 0.35rem 0 0.5rem; padding-left: 1.35rem; }
.np-book-html li { margin-bottom: 0.25rem; }
.np-book-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.55rem 0 0.65rem;
  font-size: 0.85rem;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1.4px solid rgba(43, 33, 24, 0.2);
}
.np-book-html th, .np-book-html td {
  border: 1px solid rgba(43, 33, 24, 0.16);
  padding: 0.45rem 0.6rem;
  vertical-align: top;
  text-align: left;
  line-height: 1.65;
}
.np-book-html th {
  background: var(--acc-soft, #fff6da);
  color: var(--ink);
  font-weight: 800;
}
.np-book-html .tok { font-size: 1.12rem; }
.np-book-keybox {
  background: #fffbeb;
  border: 1.4px solid #fcd34d;
  border-left: 4px solid #d97706;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  margin-top: 0.7rem;
  font-size: 0.86rem;
  line-height: 1.7;
}

/* ==================== HI HAN VOCABULARY PLAYGROUND (.hh-*) ==================== */
.hh-wrap {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 0.35rem 0 2.2rem;
}

/* Full-screen Edge-to-Edge Game Stage */
#hhRoot.hh-stage-mode {
  position: fixed;
  inset: 0;
  z-index: 980;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fdf8f0;
}

.hh-hero {
  background: linear-gradient(135deg, #8f241e 0%, #b93829 52%, #d9532f 100%);
  color: #fffaf3;
  border-radius: 18px;
  padding: 1.25rem 1.45rem;
  display: flex;
  gap: 1.15rem;
  align-items: center;
  box-shadow: 0 10px 28px rgba(143, 36, 30, 0.22);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.hh-hero-seal {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.16);
  border: 2px solid rgba(255, 215, 130, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-han);
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffe4a3;
  flex-shrink: 0;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.18);
}
.hh-hero-copy h1,
.hh-hero-copy h2 {
  margin: 0 0 0.26rem;
  font-size: 1.38rem;
  font-weight: 800;
  color: #fffdf9;
  letter-spacing: -0.01em;
}
.hh-hero-copy p {
  margin: 0 0 0.65rem;
  font-size: 0.89rem;
  color: rgba(255, 248, 236, 0.92);
  line-height: 1.45;
}
.hh-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.hh-pill-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.36rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.hh-pill-btn:hover { background: rgba(255, 255, 255, 0.25); }
.hh-pill-btn.on {
  background: #fff5d6;
  color: #7c2d12;
  border-color: #fcd34d;
}
.hh-step-card {
  background: #fdf8f0;
  border: 1px solid #eadcc7;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(120, 65, 30, 0.06);
}
.hh-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.hh-step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #b93829, #d9532f);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hh-step-head h2,
.hh-step-head h3 {
  margin: 0 0 0.15rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #451a03;
}
.hh-muted { margin: 0; font-size: 0.84rem; color: #785947; }
.hh-pool-badge {
  margin-left: auto;
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.hh-pool-badge.empty { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.hh-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.hh-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #5c3420;
}
.hh-select {
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d6bfa5;
  background: #fff;
  color: #2c1810;
  font-weight: 600;
  font-size: 0.85rem;
}
.hh-quick-acts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hh-act-btn {
  padding: 0.36rem 0.72rem;
  border-radius: 8px;
  border: 1px solid #d6bfa5;
  background: #fff;
  color: #5c3420;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.hh-act-btn.active { background: #8f241e; color: #fff; border-color: #8f241e; }
.hh-act-btn.acc { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.hh-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.42rem;
  max-height: 192px;
  overflow-y: auto;
  padding: 0.2rem 0.1rem;
}
.hh-les-btn {
  padding: 0.38rem 0.5rem;
  border-radius: 9px;
  border: 1px solid #e2cdb5;
  background: #fff;
  color: #5c3420;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  transition: all 0.12s ease;
}
.hh-les-btn.on {
  background: #b93829;
  color: #fff;
  border-color: #8f241e;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(185, 56, 41, 0.22);
}
.hh-les-chk { font-size: 0.72rem; }
.hh-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 0.9rem;
}
.hh-game-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #e6d6c1;
  background: #fff;
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 3px 12px rgba(90, 45, 20, 0.06);
}
.hh-game-card:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(143, 36, 30, 0.14);
  border-color: #d9532f;
}
.hh-game-card.disabled { opacity: 0.52; cursor: not-allowed; }
.hh-card-art {
  height: 86px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.hh-card-icon {
  font-size: 2.3rem;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.26));
}
.hh-card-zh {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  letter-spacing: 0.05em;
}
.hh-card-body {
  padding: 0.85rem 0.95rem 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.hh-card-title { font-size: 0.98rem; font-weight: 800; color: #2c1810; margin-bottom: 0.28rem; }
.hh-card-desc { font-size: 0.81rem; color: #6b5040; line-height: 1.42; margin: 0 0 0.75rem; flex: 1; }
.hh-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #eedfcc;
}
.hh-best-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c6352;
  background: #f6ede1;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}
.hh-best-pill.has-hi { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.hh-play-cta { font-size: 0.78rem; font-weight: 800; color: #b93829; white-space: nowrap; }

/* Stage Top Bar & Body */
.hh-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(90deg, #8f241e 0%, #b93829 50%, #c8422b 100%);
  color: #fff;
  padding: 0.52rem 1.2rem;
  min-height: 52px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  flex-shrink: 0;
  z-index: 10;
}
.hh-stage-left { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hh-back-btn,
.hh-close-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 9px;
  padding: 0.36rem 0.82rem;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}
.hh-close-btn { background: rgba(15, 23, 42, 0.35); border-color: rgba(255, 255, 255, 0.45); }
.hh-back-btn:hover,
.hh-close-btn:hover { background: rgba(255, 255, 255, 0.3); }
.hh-stage-title { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.hh-stage-ico { font-size: 1.25rem; }
.hh-stage-title strong { font-size: 1.08rem; font-weight: 800; }
.hh-stage-zh { font-size: 1.1rem; color: #fde68a; font-weight: 700; }
.hh-stage-pool {
  font-size: 0.78rem;
  color: rgba(255, 248, 236, 0.92);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
}
.hh-stage-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.hh-tool-btn {
  padding: 0.36rem 0.72rem;
  border-radius: 9px;
  border: 1px solid #d6bfa5;
  background: #fff;
  color: #451a03;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.hh-stage-tools .hh-tool-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}
.hh-tool-btn.on { background: #fef3c7; color: #7c2d12; border-color: #fcd34d; }
.hh-tool-btn.acc { background: #f59e0b; color: #fff; border-color: #d97706; }
.hh-tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hh-stage-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.hh-stage-mode .hh-arena {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 0;
  border: none;
  padding: 0.85rem 1.45rem 1.15rem;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: none;
}
.hh-arena {
  background: #fdf8f0;
  border: 1px solid #eadcc7;
  border-radius: 16px;
  padding: 1.05rem 1.2rem;
  position: relative;
}
.hh-arena > *:not(.hh-scene-sky):not(.hh-snow-layer):not(.hh-z-sky-banner):not(.hh-box-spotlights):not(.hh-dojo-lanterns) {
  position: relative;
  z-index: 2;
}

/* Shared Animated Countryside Sky & Scenic Layers */
.hh-scene-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(180deg, #5eb8f8 0%, #9ad9fc 50%, #e1f4fe 78%, #d9ed92 78%, #a3d977 100%);
}
.hh-sun-orb {
  position: absolute;
  top: 12px;
  right: 42px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef9c3 0%, #fde047 68%, rgba(253, 224, 71, 0) 74%);
  box-shadow: 0 0 34px rgba(250, 204, 21, 0.78);
}
.hh-sun-orb.sm { width: 48px; height: 48px; top: 8px; right: 26px; }
.hh-cloud {
  position: absolute;
  width: 105px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 3px 6px rgba(14, 165, 233, 0.14));
  animation: hhCloudDrift 28s linear infinite;
}
.hh-cloud::before,
.hh-cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 50%;
}
.hh-cloud::before { width: 46px; height: 42px; left: 14px; top: -18px; }
.hh-cloud::after { width: 34px; height: 32px; right: 16px; top: -12px; }
.hh-cloud.c1 { top: 22px; left: -12%; animation-duration: 34s; }
.hh-cloud.c2 { top: 54px; left: 32%; transform: scale(0.8); animation-duration: 42s; }
.hh-cloud.c3 { top: 28px; left: 68%; transform: scale(1.1); animation-duration: 38s; }
.hh-hills-far {
  position: absolute;
  bottom: 16%;
  left: -8%;
  right: -8%;
  height: 60px;
  border-radius: 50% 50% 0 0;
  background: rgba(101, 163, 13, 0.25);
}
.hh-hills-near {
  position: absolute;
  bottom: 0;
  left: -4%;
  right: -4%;
  height: 46px;
  border-radius: 40% 60% 0 0;
  background: rgba(34, 197, 94, 0.24);
}

/* Floating FX Popups */
.hh-fx-pop {
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 40;
  font-weight: 900;
  font-size: 1.25rem;
  padding: 0.24rem 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: hhFxFloat 0.72s ease-out forwards;
}
.hh-fx-pop.ok { background: #16a34a; color: #fff; border: 2px solid #fde047; }
.hh-fx-pop.bad { background: #dc2626; color: #fff; border: 2px solid #fecaca; }

.hh-btn-pri, .hh-btn-sec, .hh-btn-ok, .hh-btn-bad {
  padding: 0.54rem 1.05rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: filter 0.14s ease, transform 0.12s ease;
}
.hh-btn-pri { background: linear-gradient(135deg, #b93829, #d9532f); color: #fff; }
.hh-btn-sec { background: #fff; color: #5c3420; border: 1px solid #d6bfa5; }
.hh-btn-ok { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; }
.hh-btn-bad { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.hh-btn-ok:disabled { opacity: 0.48; cursor: not-allowed; }
.hh-check-gold {
  background: linear-gradient(180deg, #facc15, #eab308);
  color: #451a03;
  border: 2px solid #92400e;
  box-shadow: 0 3px 0 #92400e;
}

.hh-hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.hh-hud-pill {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #e2cdb5;
  border-radius: 999px;
  padding: 0.32rem 0.82rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #451a03;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.hh-hud-pill b { color: #b93829; font-weight: 800; }
.hh-hud-pill.dark { background: #991b1b; color: #fff; border-color: #7f1d1d; }
.hh-hud-pill.dark b { color: #fde047; }
.hh-chip-strip { display: flex; flex-wrap: wrap; gap: 0.38rem; margin: 0 0 0.7rem; }
.hh-chip-btn {
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #dec9b0;
  background: #fff;
  color: #5c3420;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.hh-chip-btn.on { background: #b93829; color: #fff; border-color: #8f241e; }
.hh-banner-tip {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #78350f;
  padding: 0.52rem 0.85rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.hh-quiz-prompt {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #eadcc7;
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  text-align: center;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.hh-quiz-prompt.compact { padding: 0.55rem 0.9rem; margin-bottom: 0.6rem; }
.hh-prompt-sub { font-size: 0.86rem; font-weight: 700; color: #785947; margin-bottom: 0.28rem; }
.hh-prompt-py { font-size: 1rem; font-weight: 700; color: #b93829; margin-top: 0.25rem; }
.hh-word-stem { font-size: 2.5rem; font-weight: 400; color: #1c1917; line-height: 1.3; }
.hh-gram-stem { font-size: 1.24rem; font-weight: 400; color: #1c1917; line-height: 1.6; white-space: pre-wrap; text-align: left; }
.hh-opts-2x2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.hh-opts-2x2.compact { gap: 0.45rem; }
.hh-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  padding: 0.78rem 0.95rem;
  border-radius: 13px;
  border: 2px solid #e6d6c1;
  background: #fff;
  color: #2c1810;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}
.hh-opt-btn.sm { padding: 0.5rem 0.72rem; font-size: 0.86rem; }
.hh-opt-btn:hover:not(:disabled) { border-color: #d9532f; background: #fffaf2; transform: translateY(-1px); }
.hh-opt-btn.ok { background: #dcfce7 !important; border-color: #16a34a !important; color: #14532d !important; }
.hh-opt-btn.bad { background: #fee2e2 !important; border-color: #dc2626 !important; color: #7f1d1d !important; }
.hh-opt-let {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f5ebd9;
  color: #8f241e;
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hh-opt-txt { display: flex; flex-direction: column; gap: 0.12rem; }
.hh-opt-txt .hanzi { font-size: 1.32rem; }
.hh-opt-txt small { font-size: 0.78rem; color: #785947; }
.hh-exp-note {
  margin-top: 0.7rem;
  padding: 0.65rem 0.9rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 0.86rem;
  color: #1e3a8a;
}
.hh-inline-qbox {
  background: #fff;
  border: 2.5px solid #f59e0b;
  border-radius: 14px;
  padding: 0.95rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ==================== HI HAN LOCOMOTIVE + TRAIN RAILWAYS ==================== */
.hh-loco-wrap {
  position: relative;
  width: 170px;
  height: 102px;
  flex-shrink: 0;
}
.hh-loco-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.24)); }
.hh-smoke-stack { position: absolute; left: 32px; top: -18px; width: 42px; height: 34px; pointer-events: none; }
.hh-puff {
  position: absolute;
  bottom: 0;
  left: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  animation: hhSmokeRise 2.2s ease-out infinite;
}
.hh-puff.p2 { animation-delay: 0.7s; left: 12px; width: 18px; height: 18px; }
.hh-puff.p3 { animation-delay: 1.4s; left: 2px; width: 13px; height: 13px; }
.hh-piston-bar { animation: hhPistonMove 0.75s ease-in-out infinite alternate; }
.hh-wsvg { width: 26px; height: 26px; display: block; }
.hh-wsvg.hh-wheel-spin { animation: hhWheelSpin 1.1s linear infinite; }

.hh-arena.hh-rail-arena { padding: 0 !important; overflow: hidden; }
.hh-rail-sky-stage {
  position: relative;
  padding: 0.7rem 1.4rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  border-bottom: 3px solid #94a3b8;
}
.hh-rail-sky-stage > *:not(.hh-scene-sky) { position: relative; z-index: 2; }
.hh-rail-rem {
  margin-left: auto;
  font-weight: 800;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
}
.hh-rail-row { position: relative; display: flex; flex-direction: column; }
.hh-rail-line.row1 {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr;
  gap: 0.9rem;
  align-items: stretch;
  padding: 0 0.25rem;
}
.hh-rail-line.row2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  align-items: stretch;
  padding: 0 0.25rem;
}
.hh-rail-sleepers {
  height: 13px;
  margin-top: -4px;
  border-top: 3px solid #334155;
  border-bottom: 3px solid #0f172a;
  background: repeating-linear-gradient(90deg, #78350f 0 7px, rgba(255,255,255,0.2) 7px 18px);
  border-radius: 3px;
  position: relative;
  z-index: 1;
}
.hh-domino-loco-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, #dc2626, #991b1b);
  border: 3px solid #450a0a;
  border-radius: 14px;
  padding: 0.25rem 0.5rem 0.25rem 0.15rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  min-height: 108px;
}
.hh-loco-prompt-cab {
  flex: 1;
  background: #fffdf8;
  border: 2px solid #991b1b;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 76px;
}
.hh-cab-lbl { font-size: 0.66rem; font-weight: 800; color: #b91c1c; letter-spacing: 0.04em; }
.hh-loco-prompt-cab strong { font-size: 0.98rem; color: #1c1917; line-height: 1.3; }
.hh-rail-slot { position: relative; display: flex; align-items: stretch; min-height: 108px; }
.hh-rail-slot.empty {
  background: rgba(219, 234, 254, 0.72);
  border: 2.5px dashed #3b82f6;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(30, 64, 175, 0.32);
}
.hh-coupler {
  position: absolute;
  right: -13px;
  top: 56%;
  width: 12px;
  height: 8px;
  background: #475569;
  border: 1.5px solid #0f172a;
  border-radius: 3px;
  z-index: 3;
}
.hh-rail-line > *:last-child .hh-coupler { display: none; }

/* Colored Wheeled Railcars */
.hh-domino-car {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease;
}
.hh-domino-car:hover { transform: translateY(-3px); }
.hh-car-shell {
  --car-chassis: #f59e0b;
  --car-border: #92400e;
  flex: 1;
  display: grid;
  grid-template-columns: 0.92fr 1.25fr;
  background: var(--car-chassis);
  border: 3px solid var(--car-border);
  border-radius: 14px;
  padding: 6px;
  gap: 6px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
}
.tone-amber .hh-car-shell { --car-chassis: #fbbf24; --car-border: #92400e; }
.tone-emerald .hh-car-shell { --car-chassis: #34d399; --car-border: #065f46; }
.tone-cobalt .hh-car-shell { --car-chassis: #60a5fa; --car-border: #1e3a8a; }
.tone-rose .hh-car-shell { --car-chassis: #f87171; --car-border: #7f1d1d; }
.tone-purple .hh-car-shell { --car-chassis: #c084fc; --car-border: #581c87; }
.tone-teal .hh-car-shell { --car-chassis: #2dd4bf; --car-border: #115e59; }
.hh-dc-left {
  background: #fffdf8;
  border-radius: 9px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.5rem;
  font-size: 1.55rem;
  font-weight: 700;
  color: #7c2d12;
  text-align: center;
}
.hh-dc-left small { font-size: 0.72rem; color: #b45309; margin-top: 0.08rem; }
.hh-dc-right {
  background: rgba(255, 255, 255, 0.93);
  border-radius: 9px;
  padding: 0.42rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  font-size: 0.83rem;
  color: #1e293b;
}
.hh-dc-tag { font-size: 0.66rem; color: #64748b; font-weight: 700; text-transform: uppercase; }
.hh-end-flag { display: block; text-align: center; color: #b91c1c; font-weight: 800; line-height: 1.2; }
.hh-car-wheels {
  display: flex;
  justify-content: space-between;
  padding: 0 18%;
  margin-top: -8px;
  pointer-events: none;
  z-index: 2;
}
.hh-yard-zone {
  flex: 1;
  min-height: 0;
  background-color: #faf0d7;
  background-image: radial-gradient(#e2cca8 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  padding: 0.85rem 1.45rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}
.hh-yard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #5c3420;
}
.hh-domino-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

/* Train 45s Stage */
.hh-train-arena { justify-content: flex-start; gap: 0.7rem; }
.hh-train-rail {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 0.7rem 0.85rem 0.25rem;
  overflow-x: auto;
}
.hh-train-consist { display: flex; align-items: flex-end; gap: 0.4rem; min-height: 106px; }
.hh-car-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.hh-car-coupler {
  position: absolute;
  left: -8px;
  bottom: 22px;
  width: 8px;
  height: 6px;
  background: #334155;
}
.hh-car-plate {
  min-width: 86px;
  padding: 0.55rem 0.75rem;
  background: #fbbf24;
  border: 3px solid #78350f;
  border-radius: 12px;
  color: #1c1917;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}
.hh-car-chip.tone-emerald .hh-car-plate { background: #34d399; border-color: #065f46; }
.hh-car-chip.tone-cobalt .hh-car-plate { background: #60a5fa; border-color: #1e3a8a; }
.hh-car-chip.tone-rose .hh-car-plate { background: #f87171; border-color: #7f1d1d; }
.hh-car-chip.tone-purple .hh-car-plate { background: #c084fc; border-color: #581c87; }
.hh-car-chip.tone-teal .hh-car-plate { background: #2dd4bf; border-color: #115e59; }
.hh-car-chip .hh-car-wheels { width: 100%; padding: 0 12px; margin-top: -7px; }

/* ==================== ZOMBIE FORTRESS ARENA ==================== */
.hh-arena.hh-zomb-arena {
  background: linear-gradient(180deg, #5eb8f8 0%, #9ad9fc 22%, #3f9c47 22%, #2b6f31 100%);
  gap: 0.55rem;
}
.hh-z-sky-banner { position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none; overflow: hidden; z-index: 0; }
.hh-z-command { border-color: #16a34a; box-shadow: 0 4px 14px rgba(20, 83, 45, 0.22); }
.hh-zomb-field {
  flex: 1;
  min-height: 360px;
  display: grid;
  grid-template-columns: 112px 1fr;
  border-radius: 18px;
  border: 4px solid #14532d;
  overflow: hidden;
  background: #2e7d32;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.hh-zomb-house {
  position: relative;
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 24%, #fef3c7 24%, #fde68a 100%);
  border-right: 6px solid #d97706;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 1rem 0.4rem;
}
.hh-house-roof {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24%;
  background: repeating-linear-gradient(135deg, #991b1b 0 10px, #b91c1c 10px 20px);
  border-bottom: 4px solid #450a0a;
}
.hh-house-body { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; margin-top: 32%; z-index: 2; }
.hh-hwin { width: 42px; height: 36px; background: #fef08a; border: 3px solid #78350f; border-radius: 6px; box-shadow: 0 0 10px rgba(254, 240, 138, 0.8); }
.hh-hdoor { width: 46px; height: 64px; background: #78350f; border: 3px solid #451a03; border-radius: 18px 18px 2px 2px; }
.hh-fence-posts {
  position: absolute;
  right: -8px;
  top: 0;
  bottom: 0;
  width: 14px;
  background: repeating-linear-gradient(180deg, #fffbeb 0 26px, transparent 26px 40px);
  border-left: 2px solid #92400e;
}
.hh-zomb-lanes-wrap { display: grid; grid-template-rows: repeat(4, 1fr); }
.hh-zomb-lane {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.32);
  overflow: hidden;
}
.hh-zomb-lane.even { background: repeating-linear-gradient(90deg, #86efac 0 80px, #4ade80 80px 160px); }
.hh-zomb-lane.odd { background: repeating-linear-gradient(90deg, #bbf7d0 0 80px, #86efac 80px 160px); }
.hh-z-turret {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 78px;
  height: 74px;
  z-index: 4;
}
.hh-z-turret svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25)); }
.hh-lane-key {
  position: absolute;
  left: -4px;
  bottom: 0;
  background: #1e293b;
  color: #fde047;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 800;
}
.hh-pea-shot {
  position: absolute;
  left: 78px;
  top: 46%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef08a 15%, #22c55e 70%, #14532d);
  box-shadow: 0 0 14px #4ade80;
  animation: hhPeaFly 0.24s linear forwards;
  z-index: 6;
}
.hh-zombie {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  z-index: 5;
  animation: hhZombHop 0.75s ease-in-out infinite alternate;
}
.hh-z-svg { width: 92px; height: 98px; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.3)); }
.hh-z-arm { transform-origin: 28px 60px; }
.hh-z-board {
  background: linear-gradient(180deg, #fffbeb, #fde68a);
  border: 3px solid #78350f;
  border-radius: 12px;
  padding: 0.34rem 0.75rem;
  color: #1c1917;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
}
.hh-z-sign { font-size: 1.62rem; font-weight: 700; white-space: nowrap; }
.hh-zombie.z-hit { animation: hhZHit 0.23s ease forwards; }

/* ==================== NOEL FULL-SCREEN SKY & COTTAGES ==================== */
.hh-noel-arena {
  background: linear-gradient(180deg, #071426 0%, #102a4c 62%, #dbeafe 62%, #f8fafc 100%);
  color: #fff;
  gap: 0.75rem;
}
.hh-snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.8) 2px, transparent 2px),
    radial-gradient(rgba(255, 255, 255, 0.5) 1.5px, transparent 1.5px);
  background-size: 64px 64px, 42px 42px;
  background-position: 0 0, 20px 25px;
  animation: hhSnowFall 8s linear infinite;
}
.hh-noel-sky {
  flex: 1;
  min-height: 230px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(circle at 75% 18%, rgba(254, 240, 138, 0.28), transparent 40%), linear-gradient(180deg, #071529, #18365e);
  border: 2px solid rgba(147, 197, 253, 0.25);
}
.hh-aurora-moon {
  position: absolute;
  top: 18px;
  right: 44px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef9c3, #fde047);
  box-shadow: 0 0 42px rgba(253, 224, 71, 0.7);
}
.hh-pine-horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: repeating-linear-gradient(60deg, #0f2e22 0 18px, transparent 18px 34px),
              repeating-linear-gradient(-60deg, #143d2d 0 18px, transparent 18px 34px);
  opacity: 0.78;
}
.hh-sleigh {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: hhSleigh 6s ease-in-out infinite alternate;
}
.hh-sleigh-svg { width: 310px; height: 114px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.48)); }
.hh-gift-box {
  position: relative;
  margin-top: -8px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border: 3px solid #fde047;
  border-radius: 18px;
  padding: 0.85rem 1.85rem;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
}
.hh-gift-bow { font-size: 1.5rem; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); }
.hh-gift-han { font-size: 2.6rem; color: #fff; display: block; line-height: 1.25; }
.hh-gift-py { color: #fef08a; font-weight: 700; font-size: 1rem; display: block; }
.hh-houses-row.four-houses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.hh-house-btn {
  background: #fffbeb;
  border: 2.5px solid #fde68a;
  border-radius: 15px;
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  text-align: left;
  color: #451a03;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  transition: transform 0.14s ease;
}
.hh-house-btn:hover:not(:disabled) { transform: translateY(-3px); border-color: #f59e0b; }
.hh-house-btn.ok { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.hh-house-btn.bad { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
.hh-cottage-svg { width: 92px; height: 70px; flex-shrink: 0; }
.hh-house-info { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.hh-house-lbl { font-size: 0.96rem; line-height: 1.28; }
.hh-hotkey {
  align-self: flex-start;
  font-size: 0.7rem;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  background: rgba(143, 36, 30, 0.12);
  color: #8f241e;
}

/* ==================== 3-LANE RUNNER, SPACE, BUTTERFLIES, FRUIT, BOXING, TUG ==================== */
.hh-run-arena { gap: 0.65rem; }
.hh-road {
  flex: 1;
  min-height: 290px;
  position: relative;
  border-radius: 18px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 4px solid #0f172a;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.32);
}
.hh-road-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(180deg, #e2e8f0 0 28px, transparent 28px 60px),
    repeating-linear-gradient(180deg, #e2e8f0 0 28px, transparent 28px 60px);
  background-size: 5px 100%, 5px 100%;
  background-position: 33.3% 0, 66.6% 0;
  background-repeat: no-repeat;
  animation: hhRoadScroll 0.8s linear infinite;
}
.hh-road-trees {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 1;
  background: rgba(21, 128, 61, 0.65);
  text-align: center;
}
.hh-road-trees.left { left: 0; }
.hh-road-trees.right { right: 0; }
.hh-road-gates {
  position: absolute;
  left: 34px;
  right: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  z-index: 3;
}
.hh-gate-sign {
  position: relative;
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  padding: 0.55rem 0.45rem;
  font-weight: 800;
  color: #1c1917;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.36);
}
.hh-runner {
  position: absolute;
  bottom: 16px;
  transform: translateX(-50%);
  width: 112px;
  height: 126px;
  transition: left 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  z-index: 4;
}
.hh-runner.lean-l { transform: translateX(-50%) rotate(-10deg); }
.hh-runner.lean-r { transform: translateX(-50%) rotate(10deg); }
.hh-runner-svg { width: 100%; height: 100%; display: block; animation: hhZombHop 0.36s ease-in-out infinite alternate; }
.hh-run-ctrls { display: flex; justify-content: center; gap: 0.75rem; }

/* Planet Defense */
.hh-space-arena { background: #020617 !important; color: #f8fafc; gap: 0.65rem; }
.hh-space-arena .hh-hud-pill { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.hh-space-sky {
  flex: 1;
  min-height: 290px;
  position: relative;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 25%, #1e1b4b, #020617);
  overflow: hidden;
  border: 2px solid #334155;
}
.hh-starfield {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.85) 1.5px, transparent 1.5px),
    radial-gradient(rgba(56, 189, 248, 0.7) 1px, transparent 1px);
  background-size: 85px 85px, 53px 53px;
  background-position: 0 0, 24px 31px;
  opacity: 0.55;
}
.hh-meteor {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  z-index: 3;
}
.hh-meteor-svg { width: 84px; height: 84px; filter: drop-shadow(0 0 14px rgba(249, 115, 22, 0.78)); }
.hh-meteor-tag {
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid #64748b;
  border-radius: 12px;
  padding: 0.32rem 0.72rem;
  text-align: center;
  margin-top: -10px;
}
.hh-meteor.lockon .hh-meteor-tag { border-color: #38bdf8; box-shadow: 0 0 16px rgba(56, 189, 248, 0.72); }
.hh-m-han { display: block; font-size: 1.45rem; color: #fff; }
.hh-m-vi { display: block; font-size: 0.8rem; color: #fde68a; }
.hh-earth-dome {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.hh-space-turret { width: 118px; height: 70px; margin-bottom: -10px; }
.hh-earth {
  width: 100%;
  text-align: center;
  padding: 0.5rem;
  background: linear-gradient(90deg, #0369a1, #16a34a, #0369a1);
  border-top: 3px solid #38bdf8;
  box-shadow: 0 -8px 26px rgba(56, 189, 248, 0.5);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
}
.hh-space-input { text-align: center; }
.hh-space-input input {
  width: min(600px, 100%);
  padding: 0.7rem 1.15rem;
  border-radius: 14px;
  border: 2.5px solid #38bdf8;
  background: #0f172a;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 700;
  text-align: center;
}

/* Butterflies Meadow */
.hh-sky-arena { gap: 0.6rem; }
.hh-bf-prompt { background: #fff; border: 2px solid #86efac; border-radius: 12px; padding: 0.6rem 0.95rem; }
.hh-meadow {
  flex: 1;
  min-height: 290px;
  position: relative;
  border-radius: 16px;
  border: 3px solid #22c55e;
  overflow: hidden;
}
.hh-meadow > *:not(.hh-scene-sky) { position: relative; z-index: 2; }
.hh-meadow-flowers {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.65rem;
  letter-spacing: 0.7rem;
  pointer-events: none;
  z-index: 1 !important;
}
.hh-butterfly {
  position: absolute !important;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 4 !important;
}
.hh-bf-svg { width: 82px; height: 60px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18)); }
.hh-svg-wing-l { transform-origin: 58px 44px; animation: hhWingL 0.34s ease-in-out infinite alternate; }
.hh-svg-wing-r { transform-origin: 58px 44px; animation: hhWingR 0.34s ease-in-out infinite alternate; }
.hh-bf-w {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ec4899;
  border-radius: 999px;
  padding: 0.18rem 0.72rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1917;
  margin-top: -10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
}
.hh-butterfly.bad .hh-bf-w { border-color: #dc2626; background: #fee2e2; }
.hh-net-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #fff;
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
  flex-wrap: wrap;
}
.hh-net-slots { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.hh-net-ico { font-size: 1.35rem; }
.hh-net-tok { background: #ecfdf5; border: 1.5px solid #34d399; color: #065f46; padding: 0.25rem 0.65rem; border-radius: 8px; font-size: 1.15rem; }
.hh-net-next { font-size: 0.84rem; color: #64748b; font-style: italic; }

/* Fruit Ninja Dojo */
.hh-fruit-arena {
  background: repeating-linear-gradient(180deg, #451a03 0 36px, #78350f 36px 72px) !important;
  color: #fffbeb;
  gap: 0.65rem;
}
.hh-dojo-lanterns {
  position: absolute;
  top: 6px;
  right: 24px;
  display: flex;
  gap: 0.8rem;
  font-size: 1.9rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}
.hh-fruit-sky {
  flex: 1;
  min-height: 290px;
  position: relative;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(254, 240, 138, 0.16), rgba(28, 25, 23, 0.45));
  border: 3px solid #d97706;
  overflow: hidden;
}
.hh-fruit-item {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}
.hh-fruit-svg { width: 112px; height: 112px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42)); }
.hh-f-num {
  position: absolute;
  top: -4px;
  right: 2px;
  background: #facc15;
  color: #451a03;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  font-size: 0.84rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hh-f-word {
  background: #fffdf8;
  border: 2.5px solid #d97706;
  color: #1c1917;
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: -14px;
}
.hh-fruit-item.bomb .hh-f-word { background: #1e293b; color: #fecaca; border-color: #ef4444; }

/* Championship Boxing Ring */
.hh-box-arena {
  background: radial-gradient(circle at 50% 25%, #312e81 0%, #1e1b4b 55%, #0f172a 100%) !important;
  gap: 0.65rem;
}
.hh-box-ring {
  flex: 1;
  min-height: 280px;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 228, 230, 0.96));
  border: 3px solid #fb7185;
  border-radius: 18px;
  padding: 0.95rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.hh-box-ring.punch-flash { box-shadow: inset 0 0 40px rgba(250, 204, 21, 0.8); }
.hh-ring-ropes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  opacity: 0.16;
}
.hh-ring-ropes span { height: 4px; background: #e11d48; width: 100%; }
.hh-bag-hp-bar { height: 15px; background: #fecdd3; border-radius: 999px; overflow: hidden; margin-bottom: 0.5rem; border: 1.5px solid #fb7185; }
.hh-bag-hp-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #b91c1c); transition: width 0.25s ease; }
.hh-bag-stage { display: flex; align-items: center; justify-content: center; gap: 2.2rem; }
.hh-glove { font-size: 3.4rem; animation: hhGloveBob 0.95s ease-in-out infinite alternate; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22)); }
.hh-bag-char { width: 205px; height: 235px; margin: 0 auto; transition: transform 0.15s ease; }
.hh-bag-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28)); }
.hh-bag-char.bag-hit { transform: rotate(-14deg) scale(0.94); }

/* Tug of War */
.hh-tug-arena { gap: 0.7rem; }
.hh-tug-stage {
  display: grid;
  grid-template-columns: 155px 1fr 155px;
  gap: 0.95rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.95rem 1.25rem;
  border-radius: 18px;
  border: 2px solid #d6bfa5;
}
.hh-tug-team { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.hh-tug-char { width: 124px; height: 124px; }
.hh-tug-badge { font-weight: 800; font-size: 0.84rem; color: #451a03; }
.hh-tug-track { position: relative; height: 32px; background: #f5ebd9; border-radius: 999px; border: 1.5px solid #d6bfa5; }
.hh-tug-center { position: absolute; left: 50%; top: -6px; bottom: -6px; width: 4px; background: #b93829; transform: translateX(-50%); }
.hh-tug-rope {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(45deg, #92400e 0 6px, #d97706 6px 12px);
  border-radius: 4px;
}
.hh-tug-knot { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 1.55rem; transition: left 0.24s ease; }

/* On Bai Cu, Millionaire, Treasure, Puzzle, Mine, Drag, Radicals, Speed, Flashcard */
.hh-submode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 0.85rem; margin-top: 0.6rem; }
.hh-submode-card {
  background: #fff;
  border: 1.5px solid #e6d6c1;
  border-radius: 15px;
  padding: 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.hh-submode-card:hover { transform: translateY(-2px); border-color: #d9532f; }
.hh-submode-ico { font-size: 2rem; }
.hh-submode-title { font-weight: 800; color: #2c1810; font-size: 1rem; }
.hh-submode-desc { font-size: 0.82rem; color: #6b5040; margin: 0 0 0.4rem; flex: 1; }

.hh-million-arena { display: grid !important; grid-template-columns: 1fr 240px !important; gap: 1rem; align-items: start; background: linear-gradient(135deg, #1e1b4b, #312e81) !important; color: #fff; }
.hh-million-arena .hh-hud-pill { background: #1e293b; color: #f8fafc; border-color: #4f46e5; }
.hh-million-arena .hh-hud-pill b { color: #facc15; }
.hh-life-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.75rem; }
.hh-ladder { background: #0f172a; color: #fef3c7; border: 2px solid #4f46e5; border-radius: 14px; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.28rem; }
.hh-lad-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.32rem 0.55rem; border-radius: 8px; color: #cbd5e1; }
.hh-lad-row.done { background: rgba(34, 197, 94, 0.24); color: #86efac; }
.hh-lad-row.cur { background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff; font-weight: 800; }
.hh-lad-row.safe { border-left: 3px solid #facc15; }

.hh-treasure-arena { background: linear-gradient(180deg, #fef9c3, #fef3c7) !important; }
.hh-treasure-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.hh-chest-btn {
  position: relative;
  min-height: 84px;
  border-radius: 14px;
  border: 2.5px solid #d97706;
  background: linear-gradient(135deg, #fffbeb, #fde68a);
  font-weight: 800;
  color: #78350f;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}
.hh-chest-svg { width: 58px; height: 48px; display: block; }
.hh-chest-num { font-size: 0.74rem; color: #92400e; }
.hh-chest-lbl { font-size: 0.8rem; color: #047857; margin-top: 0.1rem; }
.hh-chest-btn.open { background: #fff; border-color: #cbd5e1; cursor: default; }

.hh-puz-cols { display: grid; grid-template-columns: 340px 1fr; gap: 1.1rem; align-items: start; flex: 1; }
.hh-puz-board-wrap { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 3px solid #8f241e; background: #fff7ed; }
.hh-puz-secret { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.75rem; text-align: center; background: radial-gradient(circle, #fff, #fef3c7); }
.hh-puz-medallion { font-size: 1.5rem; margin-bottom: 0.2rem; }
.hh-puz-han { font-size: 2.9rem; color: #8f241e; }
.hh-puz-py { color: #b45309; font-weight: 700; margin-top: 0.2rem; }
.hh-puz-hv { font-size: 0.84rem; color: #6b5040; margin-top: 0.2rem; }
.hh-puz-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); height: 100%; }
.hh-puz-tile { background: linear-gradient(135deg, #b93829, #d9532f); border: 1.5px solid rgba(255, 255, 255, 0.5); color: #fde68a; font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; transition: opacity 0.25s ease; }
.hh-puz-tile.open { opacity: 0; pointer-events: none; }
.hh-puz-side { display: flex; flex-direction: column; gap: 0.75rem; }
.hh-puz-box { background: #fff; border: 1.5px solid #eadcc7; border-radius: 14px; padding: 0.85rem; }

.hh-mine-layout { display: grid; grid-template-columns: 330px 1fr; gap: 1.15rem; align-items: start; }
.hh-mine-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.42rem; background: #94a3b8; padding: 0.55rem; border-radius: 14px; border: 2px solid #475569; }
.hh-mine-cell { aspect-ratio: 1; border-radius: 9px; border: 2px solid #64748b; background: linear-gradient(135deg, #f8fafc, #cbd5e1); font-weight: 800; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hh-mine-cell.open { background: #ecfdf5; border-color: #34d399; color: #065f46; cursor: default; }
.hh-mine-cell.boom { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.hh-mine-cell.flag { background: #fef3c7; border-color: #f59e0b; }

.hh-drag-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; flex: 1; align-items: stretch; }
.hh-drag-col { display: flex; flex-direction: column; gap: 0.55rem; }
.hh-drag-card { flex: 1; padding: 0.75rem 1rem; border-radius: 12px; border: 2px solid #e6d6c1; background: #fff; text-align: center; cursor: pointer; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hh-drag-card.left { font-size: 1.4rem; color: #2c1810; }
.hh-drag-card.sel { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.hh-drag-card.over { border-color: #f59e0b; background: #fffbeb; transform: scale(1.02); }
.hh-drag-card.done { opacity: 0.42; background: #dcfce7; border-color: #22c55e; cursor: default; }

.hh-timer-bar { height: 12px; background: #e7e5e4; border-radius: 999px; overflow: hidden; margin-bottom: 0.85rem; }
.hh-timer-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444); transition: width 0.25s linear; }

.hh-fc-arena { justify-content: center; gap: 0.85rem; }
.hh-flip-card {
  flex: 1;
  min-height: 290px;
  max-height: 440px;
  background: #fff;
  border: 2.5px solid #e6d6c1;
  border-radius: 20px;
  padding: 1.6rem 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(90, 45, 20, 0.1);
}
.hh-flip-card.flipped { background: #fffdf8; border-color: #d9532f; }
.hh-fc-tag { font-size: 0.78rem; font-weight: 700; color: #92400e; background: #fef3c7; padding: 0.2rem 0.7rem; border-radius: 999px; margin-bottom: 0.65rem; }
.hh-fc-han { font-size: 3.6rem; color: #1c1917; line-height: 1.25; }
.hh-fc-han.sm { font-size: 2.4rem; }
.hh-fc-py { font-size: 1.2rem; font-weight: 700; color: #b93829; margin-top: 0.3rem; }
.hh-fc-hv { font-size: 0.92rem; color: #6d28d9; margin-top: 0.2rem; }
.hh-fc-vi { font-size: 1.15rem; font-weight: 700; color: #1c1917; margin-top: 0.35rem; }
.hh-fc-def { font-size: 0.92rem; color: #57534e; margin-top: 0.45rem; max-width: 640px; }
.hh-fc-acts { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }

.hh-rad-prompt { background: #fff; border: 1.5px solid #eadcc7; border-radius: 14px; padding: 0.85rem; text-align: center; margin-bottom: 0.85rem; }
.hh-rad-frame {
  position: relative;
  display: grid;
  gap: 0.9rem;
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 480px;
  padding: 1.2rem;
  background: #fffdf8;
  border: 3px dashed #d9532f;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(143, 36, 30, 0.08);
}
.hh-rad-frame.layout-lr { grid-template-columns: repeat(2, 1fr); }
.hh-rad-frame.layout-tb { grid-template-columns: 1fr; max-width: 260px; }
.hh-rad-frame.layout-enc { grid-template-columns: repeat(2, 1fr); border-style: double; border-color: #b93829; }
.hh-rad-frame.layout-tri { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
.hh-rad-frame.layout-word { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); max-width: 620px; }
.hh-rad-frame.shake { animation: hhShake 0.32s ease; border-color: #dc2626; }
.hh-rad-slot {
  height: 126px;
  border-radius: 16px;
  border: 2.5px dashed #cbd5e1;
  background-color: #fafaf9;
  background-image:
    linear-gradient(to right, rgba(220, 38, 38, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(220, 38, 38, 0.14) 1px, transparent 1px);
  background-size: 50% 50%;
  background-position: 50% 50%;
  font-size: 2.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hh-rad-slot.filled { border-style: solid; border-color: #22c55e; background-color: #f0fdf4; color: #166534; }
.hh-rad-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.hh-rad-piece { min-width: 74px; height: 68px; padding: 0 0.95rem; border-radius: 15px; border: 2px solid #e6d6c1; background: #fff; font-size: 2.15rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.hh-rad-piece.used { opacity: 0.3; cursor: default; }

.hh-summary-arena { align-items: center; justify-content: center; }
.hh-result-card { width: min(760px, 100%); text-align: center; background: #fffdf9; border: 2px solid #e6d6c1; border-radius: 20px; padding: 1.65rem 1.4rem; box-shadow: 0 12px 32px rgba(90, 45, 20, 0.1); }
.hh-res-emoji { font-size: 3.2rem; }
.hh-res-score { font-size: 2.3rem; font-weight: 800; color: #b93829; margin: 0.2rem 0; }
.hh-res-sub { color: #5c3420; margin: 0 0 0.75rem; font-size: 0.94rem; }
.hh-res-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; margin: 0.85rem 0 0; }
.hh-res-words { margin-top: 1.15rem; text-align: left; border-top: 1px dashed #e2cdb5; padding-top: 0.9rem; }
.hh-res-whead { font-size: 0.84rem; font-weight: 700; color: #5c3420; margin-bottom: 0.55rem; }
.hh-res-wgrid { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.hh-res-wchip { display: inline-flex; flex-direction: column; padding: 0.36rem 0.65rem; border-radius: 10px; border: 1px solid #e6d6c1; background: #fff; cursor: pointer; text-align: left; }
.hh-res-wchip:hover { border-color: #d9532f; background: #fffaf2; }
.hh-wzh { font-size: 1.05rem; color: #8f241e; font-weight: 700; }
.hh-wpy { font-size: 0.72rem; color: #b45309; }
.hh-wvi { font-size: 0.74rem; color: #57534e; }

/* Keyframe Animations */
@keyframes hhCloudDrift {
  0% { transform: translateX(-15%); }
  100% { transform: translateX(115%); }
}
@keyframes hhSmokeRise {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0.9; }
  100% { transform: translate(18px, -32px) scale(1.65); opacity: 0; }
}
@keyframes hhPistonMove {
  0% { transform: translateX(-3px); }
  100% { transform: translateX(4px); }
}
@keyframes hhWheelSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes hhZombHop {
  0% { transform: translate(-50%, -50%) translateY(0) rotate(-1.5deg); }
  100% { transform: translate(-50%, -50%) translateY(-5px) rotate(1.5deg); }
}
@keyframes hhZHit {
  0% { transform: translate(-50%, -50%) scale(1.1); filter: brightness(1.6); }
  100% { transform: translate(-50%, -50%) scale(0.2) rotate(24deg); opacity: 0; }
}
@keyframes hhPeaFly {
  0% { left: 66px; opacity: 1; }
  100% { left: var(--shot-to, 75%); opacity: 0.2; transform: scale(1.4); }
}
@keyframes hhSleigh {
  0% { left: 34%; transform: translate(-50%, 0); }
  50% { left: 66%; transform: translate(-50%, -10px); }
  100% { left: 34%; transform: translate(-50%, 0); }
}
@keyframes hhSnowFall {
  0% { background-position: 0 0, 20px 25px; }
  100% { background-position: 0 64px, 20px 67px; }
}
@keyframes hhRoadScroll {
  0% { background-position: 33.3% 0, 66.6% 0; }
  100% { background-position: 33.3% 60px, 66.6% 60px; }
}
@keyframes hhWingL {
  0% { transform: scaleX(1) skewY(0deg); }
  100% { transform: scaleX(0.45) skewY(8deg); }
}
@keyframes hhWingR {
  0% { transform: scaleX(1) skewY(0deg); }
  100% { transform: scaleX(0.45) skewY(-8deg); }
}
@keyframes hhGloveBob {
  0% { transform: translateY(0) rotate(-6deg); }
  100% { transform: translateY(-6px) rotate(8deg); }
}
@keyframes hhFxFloat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.75); }
  30% { opacity: 1; transform: translate(-50%, -85%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}
@keyframes hhShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==================== MOBILE & IPAD SMOOTH TOUCH OPTIMIZATIONS ==================== */
html, body {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}
button, .btn, .nav-item, .mobile-tab, .hh-game-card, .hh-les-btn,
.hh-opt-btn, .hh-house-btn, .hh-drag-card, .hh-domino-car, .hh-rad-piece,
.hh-zombie, .hh-butterfly, .hh-fruit-item, .hh-chest-btn, .hh-mine-cell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.hh-fruit-sky, .hh-road, .hh-meadow, .hh-zomb-field {
  touch-action: none;
}
.hh-zombie, .hh-butterfly, .hh-fruit-item, .hh-runner, .hh-meteor, .hh-sleigh {
  will-change: transform, left, top;
}
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(43, 33, 24, 0.22);
  background: var(--sf);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 590;
  backdrop-filter: blur(2px);
}
.mobile-drawer-backdrop.on { display: block; }
.mobile-bar { padding-top: max(0.55rem, env(safe-area-inset-top)); }
.mobile-tabs { padding-bottom: max(0.35rem, env(safe-area-inset-bottom)); }
#hhRoot.hh-stage-mode {
  height: 100vh;
  height: 100dvh;
  padding-top: env(safe-area-inset-top);
}
.hh-stage-body, .hh-yard-zone, .hh-arena {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1120px) {
  .hh-loco-wrap { width: 132px; height: 80px; }
  .hh-rail-line.row1 { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0.55rem; }
  .hh-rail-line.row2 { gap: 0.55rem; }
  .hh-dc-left { font-size: 1.28rem; }
  .hh-dc-right { font-size: 0.76rem; }
  .hh-puz-cols { grid-template-columns: 270px 1fr; }
  .hh-mine-layout { grid-template-columns: 270px 1fr; }
}

@media (max-width: 920px) {
  .sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 600;
    width: min(295px, 84vw);
    max-width: 84vw;
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.28);
    animation: hhSlideInLeft 0.18s ease-out;
  }
  .hh-rail-line.row1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hh-domino-loco-card { grid-column: 1 / -1; }
  .hh-rail-line.row2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hh-houses-row.four-houses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hh-million-arena, .hh-puz-cols, .hh-mine-layout { grid-template-columns: 1fr !important; }
  .hh-puz-board-wrap { max-width: 280px; margin: 0 auto; width: 100%; }
  .hh-mine-grid { max-width: 310px; margin: 0 auto; width: 100%; }
  .hh-domino-pool { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .hh-hero { flex-direction: column; text-align: center; padding: 1rem; gap: 0.7rem; }
  .hh-hero-seal { width: 52px; height: 52px; font-size: 1.45rem; }
  .hh-hero-copy h1, .hh-hero-copy h2 { font-size: 1.12rem; }
  .hh-step-card { padding: 0.85rem 0.9rem; }
  .hh-lesson-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); max-height: 155px; }
  .hh-games-grid { grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); gap: 0.65rem; }
  .hh-card-art { height: 64px; padding: 0.55rem 0.75rem; }
  .hh-card-icon { font-size: 1.75rem; }
  .hh-card-zh { font-size: 1.15rem; }
  .hh-card-body { padding: 0.65rem 0.75rem; }
  .hh-card-title { font-size: 0.88rem; }
  .hh-card-desc { font-size: 0.74rem; line-height: 1.32; margin-bottom: 0.5rem; }

  /* Slim single-row stage header on iPhone */
  .hh-stage-bar { padding: 0.38rem 0.55rem; min-height: 44px; gap: 0.3rem; flex-wrap: nowrap; }
  .hh-stage-left { gap: 0.35rem; flex: 0 0 auto; }
  .hh-back-btn { padding: 0.28rem 0.52rem; font-size: 0.72rem; white-space: nowrap; }
  .hh-stage-title, #hhStFs, #hhStClose { display: none; }
  .hh-tool-btn { padding: 0.28rem 0.48rem; font-size: 0.72rem; white-space: nowrap; }
  .hh-stage-mode .hh-arena { padding: 0.52rem 0.62rem max(0.7rem, env(safe-area-inset-bottom)); }
  .hh-hud-row { gap: 0.32rem; margin-bottom: 0.45rem; }
  .hh-hud-pill { font-size: 0.73rem; padding: 0.22rem 0.55rem; }
  .hh-chip-btn { font-size: 0.72rem; padding: 0.24rem 0.55rem; }
  .hh-word-stem { font-size: 1.85rem; }
  .hh-quiz-prompt { padding: 0.65rem 0.75rem; margin-bottom: 0.55rem; }
  .hh-opts-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.42rem; }
  .hh-opt-btn { padding: 0.55rem 0.6rem; font-size: 0.86rem; min-height: 50px; }
  .hh-opt-let { width: 22px; height: 22px; font-size: 0.72rem; }
  .hh-opt-txt .hanzi { font-size: 1.08rem; }

  /* Railway on Phone */
  .hh-rail-sky-stage { padding: 0.45rem 0.6rem 0.55rem; gap: 0.4rem; }
  .hh-rail-line.row1, .hh-rail-line.row2 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; padding: 0; }
  .hh-domino-loco-card { grid-column: 1 / -1; min-height: 70px; padding: 0.2rem 0.4rem 0.2rem 0.1rem; }
  .hh-loco-wrap { width: 96px; height: 58px; }
  .hh-loco-prompt-cab { min-height: 52px; padding: 0.3rem 0.45rem; }
  .hh-loco-prompt-cab strong { font-size: 0.86rem; }
  .hh-rail-slot { min-height: 68px; }
  .hh-rail-slot.empty { font-size: 1.4rem; border-radius: 10px; }
  .hh-car-shell { border-width: 2px; border-radius: 10px; padding: 3px; gap: 3px; grid-template-columns: 1fr; }
  .hh-dc-left { font-size: 1.08rem; padding: 0.22rem; }
  .hh-dc-right { font-size: 0.68rem; padding: 0.22rem 0.35rem; }
  .hh-wsvg { width: 17px; height: 17px; }
  .hh-yard-zone { padding: 0.55rem 0.65rem max(0.8rem, env(safe-area-inset-bottom)); gap: 0.5rem; }
  .hh-domino-pool { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
  .hh-domino-pool .hh-car-shell { grid-template-columns: 0.9fr 1.15fr; }
  .hh-rail-rem { display: none; }

  /* Zombie on Phone */
  .hh-zomb-field { grid-template-columns: 52px 1fr; min-height: 300px; }
  .hh-hwin { width: 22px; height: 18px; }
  .hh-hdoor { width: 24px; height: 32px; }
  .hh-z-turret { left: 4px; width: 42px; height: 42px; }
  .hh-lane-key { font-size: 0.64rem; padding: 1px 4px; }
  .hh-zombie { flex-direction: column-reverse; gap: 1px; }
  .hh-z-svg { width: 52px; height: 56px; }
  .hh-z-board { padding: 0.16rem 0.42rem; border-width: 2px; border-radius: 8px; }
  .hh-z-sign { font-size: 1rem; }

  /* Noel, Runner, Butterflies, Boxing, Tug, Radicals on Phone */
  .hh-noel-sky { min-height: 195px; }
  .hh-sleigh { width: 215px; top: 8%; }
  .hh-sleigh-svg { width: 205px; height: 76px; }
  .hh-gift-box { padding: 0.55rem 1.15rem; border-radius: 14px; }
  .hh-gift-han { font-size: 1.95rem; }
  .hh-houses-row.four-houses { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
  .hh-house-btn { padding: 0.45rem 0.55rem; gap: 0.4rem; }
  .hh-cottage-svg { width: 46px; height: 38px; }
  .hh-house-lbl { font-size: 0.8rem; }
  .hh-hotkey { display: none; }

  .hh-road-trees { width: 20px; font-size: 0.95rem; }
  .hh-road-gates { left: 20px; right: 20px; gap: 0.3rem; }
  .hh-gate-sign { font-size: 1rem; padding: 0.4rem 0.25rem; }
  .hh-runner { width: 76px; height: 86px; }
  .hh-btn-sec { padding: 0.52rem 0.78rem; font-size: 0.82rem; }

  .hh-bf-svg { width: 56px; height: 42px; }
  .hh-bf-w { font-size: 1rem; padding: 0.14rem 0.52rem; }
  .hh-fruit-svg { width: 76px; height: 76px; }
  .hh-f-word { font-size: 1rem; padding: 0.14rem 0.58rem; }
  .hh-bag-stage { gap: 0.9rem; }
  .hh-glove { font-size: 2.15rem; }
  .hh-bag-char { width: 138px; height: 158px; }
  .hh-tug-stage { grid-template-columns: 82px 1fr 82px; gap: 0.45rem; padding: 0.55rem; }
  .hh-tug-char { width: 70px; height: 70px; }
  .hh-drag-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
  .hh-drag-card { padding: 0.55rem 0.45rem; font-size: 0.84rem; }
  .hh-drag-card.left { font-size: 1.08rem; }
  .hh-rad-slot { height: 92px; font-size: 2.1rem; }
  .hh-rad-piece { min-width: 56px; height: 52px; font-size: 1.65rem; }
  .hh-treasure-grid { gap: 0.38rem; }
  .hh-chest-btn { min-height: 66px; }
  .hh-chest-svg { width: 42px; height: 34px; }
}

@keyframes hhSlideInLeft {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}


/* ===== Mobile & iPad Auto-Fit Text + Always-Reachable Home Return ===== */
.cc-book-sel {
  max-width: min(100%, 290px);
  min-width: 0;
}
.cc-stage-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}
.cc-stage-nav .select-pill {
  flex: 1 1 175px;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
}
.mobile-home-btn {
  margin-left: 0;
  font-size: 1rem;
  line-height: 1;
}
.cc-wrap.cc-fullscreen {
  padding-top: max(0.85rem, env(safe-area-inset-top));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-bottom: max(5.2rem, calc(4.8rem + env(safe-area-inset-bottom)));
}
.cc-wrap.cc-fullscreen .cc-topbar {
  background: rgba(255, 250, 246, 0.96);
  border-bottom: 1px solid rgba(190, 150, 130, 0.26);
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 1024px) {
  html, body, .app-shell, .main-wrap, .content-inner {
    max-width: 100%;
    overflow-x: clip;
  }
  .card, .toolbar, .chip-row, .cc-board-card, .match-arena-wrap, .hh-step-card, .hh-stage-shell {
    max-width: 100%;
  }
  .select-pill {
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
  }
  .cc-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.42rem;
  }
  .cc-tile {
    height: auto;
    min-height: 74px;
    padding: 0.4rem 0.28rem;
  }
  .cc-tile-w {
    font-size: clamp(0.92rem, 2.2vw, 1.26rem);
    white-space: nowrap;
    line-height: 1.25;
  }
  .word-tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 590;
    padding: max(0.45rem, env(safe-area-inset-top)) 0.65rem 0.45rem;
    gap: 0.35rem;
  }
  #mobileSwatches {
    gap: 0.25rem;
    flex-shrink: 0;
  }
  #mobileSwatches > * {
    width: 22px;
    height: 22px;
  }
  .cc-wrap.cc-fullscreen {
    padding-top: calc(4.25rem + env(safe-area-inset-top));
    padding-bottom: max(5.2rem, calc(4.8rem + env(safe-area-inset-bottom)));
  }
  .mobile-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 590;
    padding-bottom: max(0.3rem, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(42, 24, 18, 0.1);
  }
  #mobileDrawerBg.open {
    z-index: 610;
  }
  .sidebar.mobile-open {
    z-index: 620;
  }
  #hhRoot.hh-stage-mode {
    z-index: 580;
    padding-top: calc(3.65rem + env(safe-area-inset-top));
    padding-bottom: max(5.2rem, calc(4.7rem + env(safe-area-inset-bottom)));
  }
  .cc-book-sel {
    max-width: 100%;
    flex: 1 1 220px;
  }
  .reader-text {
    font-size: clamp(1.16rem, 3.1vw, 1.48rem);
  }
}

@media (max-width: 680px) {
  .cc-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .cc-tile {
    min-height: 68px;
    padding: 0.38rem 0.22rem;
    gap: 0.14rem;
  }
  .cc-tile-w {
    font-size: clamp(0.84rem, 3.9vw, 1.12rem);
    white-space: nowrap;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cc-tile-ipa,
  .cc-tile-vi {
    font-size: clamp(0.6rem, 2.3vw, 0.72rem);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    text-align: center;
  }
  .cc-head {
    flex-direction: column;
    align-items: stretch;
  }
  .cc-hud {
    justify-content: flex-start;
  }
  .cc-board-card {
    padding: 0.65rem 0.5rem;
  }
  .word-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .w-tile-han {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
  }
  .match-col-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .match-tile {
    padding: 0.45rem 0.38rem;
  }
  .match-tile-han {
    font-size: clamp(0.9rem, 3.8vw, 1.12rem);
    white-space: nowrap;
  }
  .reader-text {
    font-size: clamp(1.12rem, 4.4vw, 1.42rem);
    line-height: 2.25;
  }
  .hh-hero-copy h1 {
    font-size: clamp(1.18rem, 5.2vw, 1.55rem);
  }
  .hh-hero-links {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .hh-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .hh-label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
  }
  .hh-select {
    width: 100%;
    max-width: 100%;
  }
  .mobile-tab {
    font-size: clamp(0.62rem, 2.4vw, 0.75rem);
  }
}

@media (max-width: 350px) {
  .cc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.install-app-pill {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  color: #fff !important;
  border: 1.5px solid #1b4332 !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.22);
}
.install-app-pill:hover {
  filter: brightness(1.07);
}
.install-app-side-btn {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  color: #fff !important;
  border-color: #1b4332 !important;
  font-weight: 700;
}
.fz-install-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.fz-install-steps {
  background: rgba(247, 241, 232, 0.75);
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.fz-install-steps li {
  margin-bottom: 0.35rem;
}
@media (max-width: 680px) {
  .mobile-bar .mobile-menu-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
}
.modal-backdrop {
  z-index: 950;
}

.cc-tile {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.cc-grid {
  touch-action: pan-y;
}
@media print {
  .mobile-bar,
  .mobile-tabs,
  .sidebar,
  #mobileDrawerBg,
  .no-print {
    display: none !important;
  }
}


/* ==================== HANYU CIHUI + GUDAI HANYU SPECIALIZED STYLES ==================== */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.zh {
  font-family: var(--font-han);
}

.input {
  width: 100%;
  padding: 0.52rem 0.95rem;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: var(--sf);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.14s ease, border-color 0.14s ease;
}
textarea.input {
  border-radius: 18px;
  padding: 0.72rem 0.95rem;
  line-height: 1.65;
  resize: vertical;
}
select.input {
  padding: 0.44rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.input:focus {
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.tag-hv {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid rgba(107, 33, 168, 0.22);
}

.side-toggle-btn.active {
  background: var(--acc-soft);
  border-color: var(--ink);
  color: var(--acc-dark);
}

.nav-item {
  white-space: nowrap;
}
.nav-item > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pill Tabs Bar */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.45rem;
  border-radius: 16px;
  background: var(--sf2);
  border: 1.5px solid rgba(43, 33, 24, 0.2);
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(43, 33, 24, 0.28);
  background: var(--sf);
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--ink2);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, background 0.14s, color 0.14s;
}
.tab:hover {
  transform: translateY(-1px);
  background: var(--acc-soft);
}
.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

/* Dashboard KPI & Course Split */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-card {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 18px;
  padding: 0.85rem 0.9rem;
  text-align: center;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.06);
  transition: transform 0.14s, background 0.14s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  background: var(--acc-soft);
}
.kpi-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}
.kpi-lbl {
  font-size: 0.75rem;
  color: var(--soft);
  font-weight: 700;
  margin-top: 0.2rem;
}

.course-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.85rem;
}
.course-card.cihui-card {
  background: linear-gradient(155deg, var(--acc-soft) 0%, var(--sf) 65%);
  border: 2px solid var(--ink);
  cursor: default;
}
.course-card.gudai-card {
  background: linear-gradient(155deg, var(--sf3) 0%, var(--sf) 65%);
  border: 2px solid var(--ink);
  cursor: default;
}
.course-card.cihui-card:hover,
.course-card.gudai-card:hover {
  transform: none;
  background: var(--sf);
}
.course-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}
.course-code-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hub-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.hub-feature-tile {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.06);
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hub-feature-tile:hover {
  transform: translateY(-2px);
  background: var(--acc-soft);
  box-shadow: 0 6px 14px rgba(43, 33, 24, 0.1);
}
.hub-feature-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--acc);
  border: 1.5px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hub-feature-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
}
.hub-feature-sub {
  font-size: 0.76rem;
  color: var(--soft);
  line-height: 1.45;
}

/* Cihui Theory Reader */
.ch-section-card {
  background: var(--sf2);
  border: 1.6px solid rgba(43, 33, 24, 0.28);
  border-radius: 18px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.75rem;
}
.ch-section-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--acc-dark);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ch-callout {
  background: var(--note);
  border: 1.5px solid rgba(43, 33, 24, 0.22);
  border-left: 4px solid var(--acc);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  margin: 0.65rem 0;
  font-size: 0.88rem;
  line-height: 1.65;
}
.ch-term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 0.75rem;
}
.ch-term-card {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  transition: transform 0.14s, background 0.14s;
}
.ch-term-card:hover {
  transform: translateY(-2px);
  background: var(--sf2);
}

/* Morpheme & Syntax Diagram */
.morpheme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin: 0.55rem 0;
}
.morpheme-box {
  background: var(--sf2);
  border: 1.5px solid rgba(43, 33, 24, 0.28);
  border-radius: 14px;
  padding: 0.65rem 0.55rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}
.morpheme-box:hover {
  border-color: var(--ink);
  background: var(--acc-soft);
  transform: translateY(-1px);
}
.morpheme-char {
  font-family: var(--font-han);
  font-size: calc(1.55rem + 0.15rem);
  font-weight: 700;
  color: var(--ink);
}
.morpheme-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1px solid rgba(43, 33, 24, 0.22);
  color: var(--acc-dark);
  margin-top: 0.25rem;
}

.syntax-diagram {
  background: var(--sf2);
  border: 1.8px dashed var(--acc-dark);
  border-radius: 16px;
  padding: 1rem;
  font-family: var(--font-han);
  font-size: 1.24rem;
  line-height: 2.1;
  overflow-x: auto;
}
.syn-seg {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 2px 4px;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: top;
}
.syn-role-lbl {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-top: 2px;
}
.syn-s { border-bottom: 3px double var(--acc-dark); background: var(--acc-soft); }
.syn-v { border-bottom: 2px solid var(--k-ok); background: #ecfdf5; }
.syn-o { border-bottom: 2px wavy var(--k-bad); background: #fff1f2; }
.syn-att { border: 1px solid var(--line); background: var(--sf); }
.syn-adv { border: 1px dashed var(--acc-dark); background: var(--sf); }
.syn-comp { border-bottom: 2px dotted var(--k-warn); background: #fff7ed; }

/* Synonym 7-Dim & Idiom 4-Tab */
.syn7-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0.8rem;
}
.syn7-card {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 20px;
  padding: 0.95rem 1.05rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.syn7-dim {
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 0.45rem 0.7rem;
  background: var(--sf2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.syn7-dim strong {
  color: var(--acc-dark);
}

.idiom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}
.idiom-card {
  background: var(--sf);
  border: 1.8px solid var(--ink);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.idiom-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1px solid rgba(43, 33, 24, 0.25);
  color: var(--acc-dark);
  display: inline-block;
}

/* GuDai HanYu Layout */
.gd-bilingual-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--sf2);
  border: 1.6px solid rgba(43, 33, 24, 0.26);
  border-radius: 16px;
  margin-bottom: 0.7rem;
}
.gd-classic-col {
  font-family: var(--font-han);
  font-size: var(--ex-han-size, 1.38rem);
  line-height: 1.95;
}
.gd-modern-col {
  border-left: 2px dashed var(--line);
  padding-left: 0.95rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink);
}
@media (max-width: 720px) {
  .gd-modern-col {
    border-left: none;
    border-top: 1.5px dashed var(--line);
    padding-left: 0;
    padding-top: 0.75rem;
  }
}
.gd-pattern-box {
  background: var(--note);
  border: 1.8px solid var(--ink);
  border-radius: 16px;
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.8rem;
}
.gd-chron-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.gd-chron-table th,
.gd-chron-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.gd-chron-table th {
  background: var(--sf3);
  font-weight: 800;
  color: var(--acc-dark);
}

/* HSK 4->9 Roadmap 4-Skill Matrix */
.rm-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.65rem 0;
}
@media (max-width: 780px) {
  .rm-skill-grid { grid-template-columns: 1fr; }
}
.rm-skill-box {
  background: var(--sf);
  border: 1.5px solid rgba(43, 33, 24, 0.24);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.58;
}
.rm-skill-lbl {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--acc-dark);
  margin-bottom: 0.22rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.rm-trap-box {
  margin-top: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  background: #fff1f2;
  border: 1px solid rgba(180, 35, 24, 0.28);
  color: #9f1239;
  font-size: 0.82rem;
  line-height: 1.5;
}
.rm-gram-item {
  background: var(--sf);
  border: 1.5px solid rgba(43, 33, 24, 0.28);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.5rem;
}

.mm-branch-col,
.mm-center-col,
.mm-word-node {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
