:root {
  --bg-color: #FDFCF0;
  --bg-soft: #F6F2E2;
  --bg-card: #FFFFFF;
  --bg-pill: #EFECE1;
  --text-color: #1A1A1B;
  --text-muted: #5C5A56;
  --text-subtle: #8A8A8A;
  --accent-color: #D32F2F;
  --accent-dark: #8B0000;
  --bronze: #8C7355;
  --gold: #D4AF37;
  --gold-soft: rgba(212, 175, 55, 0.22);
  --border-color: #EAE6D5;
  --border-strong: #D6CEB8;
  --success: #2E6F40;
  --success-bg: rgba(46, 111, 64, 0.1);
  --error: #B71C1C;
  --error-bg: rgba(183, 28, 28, 0.09);
  --shadow-sm: 0 2px 10px rgba(26, 26, 27, 0.04);
  --shadow-md: 0 12px 32px rgba(26, 26, 27, 0.08);
  --shadow-lg: 0 20px 44px rgba(26, 26, 27, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-hanzi: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 5%;
}

.container-narrow {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 5%;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(253, 252, 240, 0.97);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0.85rem 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.4px;
  color: var(--text-color);
  flex-shrink: 0;
}

.site-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.18s ease;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-switcher summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.lang-switcher summary::-webkit-details-marker {
  display: none;
}

.lang-switcher summary:hover {
  border-color: var(--text-color);
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 210px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.45rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--text-color);
  transition: background-color 0.15s ease;
}

.lang-dropdown a:hover {
  background: var(--bg-soft);
}

.lang-dropdown a[aria-current="page"] {
  background: var(--bg-pill);
  font-weight: 600;
  color: var(--accent-color);
}

.lang-code-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  background: var(--text-color);
  color: var(--bg-color);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  cursor: pointer;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 200;
}

.mobile-menu-panel a {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-color);
}

.mobile-menu-panel a:hover {
  background: var(--bg-soft);
  color: var(--accent-color);
}

/* Breadcrumbs */
.breadcrumb {
  padding: 1.1rem 0 0.25rem;
  font-size: 0.84rem;
  color: var(--text-subtle);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
  color: var(--text-color);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--border-strong);
}

/* Buttons */
.cta-buttons {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.cta-download-group {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.cta-qr-card {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.85rem 0.5rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-color);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cta-qr-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-color);
  box-shadow: var(--shadow-md);
}

.cta-qr-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.cta-qr-frame img {
  display: block;
  width: 76px;
  height: 76px;
}

.cta-qr-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cta-qr-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-color);
}

.cta-qr-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn-sm {
  padding: 0.55rem 1.05rem;
  font-size: 0.86rem;
}

.btn-icon {
  flex-shrink: 0;
}

.primary-btn {
  background-color: var(--text-color);
  color: var(--bg-color);
  border: 2px solid var(--text-color);
  box-shadow: 0 10px 22px rgba(26, 26, 27, 0.14);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(26, 26, 27, 0.22);
}

.secondary-btn {
  background-color: var(--bg-card);
  color: var(--text-color);
  border: 2px solid var(--text-color);
  box-shadow: 0 6px 16px rgba(26, 26, 27, 0.06);
}

.secondary-btn:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
  transform: translateY(-2px);
}

.outline-btn {
  background-color: var(--bg-card);
  color: var(--text-color);
  border: 1px solid var(--border-strong);
}

.outline-btn:hover {
  border-color: var(--text-color);
  background-color: var(--bg-soft);
}

/* Homepage Hero */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 5% 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  min-height: 76vh;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: 1.35rem;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.18rem;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  line-height: 1.65;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-screenshot {
  width: 420px;
  max-width: 100%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-screenshot:hover {
  transform: translateY(-6px);
}

.hero-screenshot img {
  width: 100%;
  display: block;
}

/* Inner Page Hero */
.page-hero {
  padding: 2.2rem 0 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--bronze);
  background-color: rgba(212, 196, 168, 0.24);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 196, 168, 0.55);
  margin-bottom: 1.1rem;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.7px;
  margin-bottom: 1rem;
}

.page-lede {
  font-size: 1.14rem;
  color: var(--text-muted);
  max-width: 740px;
  line-height: 1.65;
}

/* Interactive Demos Strip & Grids */
.section-block {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-color);
}

.section-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.section-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.section-heading p {
  font-size: 1.08rem;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1.35rem;
}

.zen-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
}

.zen-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.zen-card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  background: var(--bg-pill);
  color: var(--text-color);
  padding: 0.28rem 0.75rem;
  border-radius: 6px;
}

.zen-card h3 {
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.zen-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.zen-card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* HSK Level Cards */
.hsk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.hsk-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hsk-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
}

.hsk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hsk-level-badge {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-color);
}

.hsk-count-pill {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-pill);
  color: var(--bronze);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.hsk-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Alternating Showcase */
.showcase-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-color);
}

.showcase-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 5rem;
}

.showcase-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bronze);
  background-color: rgba(212, 196, 168, 0.25);
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  border: 1px solid rgba(212, 196, 168, 0.5);
  margin-bottom: 1.2rem;
}

.showcase-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.showcase-subhead {
  font-size: 1.18rem;
  color: var(--text-muted);
}

.showcase-container {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.showcase-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4.5rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.showcase-item.reverse {
  flex-direction: row-reverse;
}

.showcase-text {
  flex: 1;
  max-width: 500px;
}

.showcase-tag-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.showcase-pill {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  background-color: var(--bg-pill);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
}

.showcase-number {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: #B5A895;
}

.showcase-text h3 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.showcase-text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.15rem;
}

.showcase-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}

.showcase-link:hover {
  text-decoration: underline;
}

.showcase-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}

.showcase-screenshot {
  width: 400px;
  max-width: 100%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-item:hover .showcase-screenshot {
  transform: translateY(-6px) scale(1.015);
}

/* Calligraphy Studio & Character Page */
.char-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.5rem 0 2rem;
}

.char-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.16s ease;
}

.char-chip .chip-hanzi {
  font-family: var(--font-hanzi);
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--text-color);
}

.char-chip .chip-pinyin {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.char-chip:hover {
  border-color: var(--text-color);
}

.char-chip.is-active {
  background: var(--text-color);
  border-color: var(--text-color);
  color: var(--bg-color);
}

.char-chip.is-active .chip-hanzi,
.char-chip.is-active .chip-pinyin {
  color: var(--bg-color);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(290px, 400px) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}

.stroke-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stroke-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.stroke-counter {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--bronze);
  background: var(--bg-pill);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.stroke-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.15rem;
  background: var(--bg-color);
  border: 2px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.stroke-svg-layer,
.stroke-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stroke-canvas {
  touch-action: none;
  cursor: crosshair;
  z-index: 3;
}

.stroke-seal {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--accent-color);
  background: rgba(253, 252, 240, 0.94);
  color: var(--accent-color);
  font-family: var(--font-hanzi);
  font-size: 1.25rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.stroke-seal.is-visible {
  display: flex;
}

.stroke-feedback {
  min-height: 2.3rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  background: var(--bg-soft);
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stroke-feedback.is-good {
  background: var(--success-bg);
  color: var(--success);
}

.stroke-feedback.is-error {
  background: var(--error-bg);
  color: var(--error);
}

.stroke-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.stroke-btn {
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.stroke-btn:hover {
  border-color: var(--text-color);
  background: var(--bg-soft);
}

.stroke-btn.is-primary {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.stroke-btn.is-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.char-details-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.info-panel h2,
.info-panel h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.char-hero-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.char-display-glyph {
  font-family: var(--font-hanzi);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--text-color);
}

.char-pinyin-main {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-color);
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speak-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.speak-btn.is-playing {
  background: var(--accent-color);
  color: #FFFFFF;
  border-color: var(--accent-color);
}

.decomp-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.85rem;
  margin-bottom: 0.9rem;
}

.decomp-header-row h2,
.decomp-header-row h3 {
  margin-bottom: 0;
}

.decomp-radical-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: rgba(178, 34, 34, 0.08);
  border: 1px solid rgba(178, 34, 34, 0.22);
  color: #B22222;
  font-size: 0.8rem;
  font-weight: 600;
}

.decomp-stage-wrap {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.75rem 0.9rem 0.9rem;
}

.decomp-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.decomp-structure-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  background: rgba(63, 81, 181, 0.09);
  color: #303F9F;
  font-size: 0.78rem;
  font-weight: 600;
}

.decomp-primitive-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: #8D5B00;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.decomp-toggle-btn {
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.decomp-toggle-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.decomp-stage {
  position: relative;
  min-height: 176px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: #FCFBF2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  user-select: none;
}

.decomp-stage[data-can-decompose="1"] {
  cursor: pointer;
}

.decomp-stage[data-layout="topToBottom"],
.decomp-stage[data-layout="topToBottom3"] {
  min-height: 214px;
}

.decomp-rice-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.decomp-rice-grid line {
  stroke: #DFD8C5;
  stroke-width: 1.25;
  stroke-dasharray: 5 5;
}

.decomp-whole {
  position: relative;
  z-index: 2;
  font-family: var(--font-hanzi);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-color);
  transition: opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.decomp-tiles {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transform: scale(0.84);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.decomp-stage[data-layout="topToBottom"] .decomp-tiles,
.decomp-stage[data-layout="topToBottom3"] .decomp-tiles {
  flex-direction: column;
  gap: 0.32rem;
}

.decomp-stage:not(.is-decomposed) .decomp-tiles {
  position: absolute;
}

.decomp-stage.is-decomposed .decomp-whole {
  position: absolute;
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.decomp-stage.is-decomposed .decomp-tiles {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.decomp-tile {
  min-width: 58px;
  min-height: 60px;
  padding: 0.32rem 0.55rem;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid rgba(26, 26, 27, 0.12);
  box-shadow: 0 3px 10px rgba(26, 26, 27, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
}

.decomp-tile.is-radical {
  border-color: rgba(178, 34, 34, 0.48);
  border-width: 1.5px;
}

.decomp-stage[data-layout="topToBottom"] .decomp-tile,
.decomp-stage[data-layout="topToBottom3"] .decomp-tile {
  min-width: 72px;
  min-height: 46px;
  padding: 0.2rem 0.65rem;
  flex-direction: row;
  gap: 0.45rem;
}

.decomp-tile-py {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-muted);
}

.decomp-tile.is-radical .decomp-tile-py {
  color: #B22222;
}

.decomp-tile-glyph {
  font-family: var(--font-hanzi);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-color);
}

.decomp-tile.is-radical .decomp-tile-glyph {
  color: #B22222;
}

.decomp-plus {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(178, 34, 34, 0.12);
  color: #B22222;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.decomp-formula {
  margin-top: 0.8rem;
  padding: 0.68rem 0.95rem;
  border-radius: 12px;
  background: rgba(63, 81, 181, 0.07);
  border: 1px solid rgba(63, 81, 181, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
}

.decomp-formula-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #303F9F;
}

.decomp-formula-eq {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-color);
}

.decomp-comp-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.decomp-comp-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}

.decomp-comp-card.is-radical {
  border-color: rgba(178, 34, 34, 0.25);
  background: rgba(178, 34, 34, 0.025);
}

.decomp-comp-glyph {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(26, 26, 27, 0.12);
  box-shadow: 0 2px 6px rgba(26, 26, 27, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hanzi);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-color);
  flex-shrink: 0;
}

.decomp-comp-glyph.is-radical {
  color: #B22222;
  border-color: rgba(178, 34, 34, 0.42);
}

.decomp-comp-body {
  min-width: 0;
  flex: 1;
}

.decomp-comp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.22rem;
}

.decomp-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 6px;
}

.decomp-role-badge.is-radical {
  background: rgba(178, 34, 34, 0.12);
  color: #B22222;
}

.decomp-role-badge.is-building {
  background: rgba(26, 26, 27, 0.07);
  color: var(--text-muted);
}

.decomp-comp-py {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-color);
}

.decomp-comp-canon {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bronze);
}

.decomp-comp-gloss {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-color);
}

.decomp-comp-mnem {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.22rem;
  line-height: 1.48;
}

.decomp-comp-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}

.decomp-comp-link:hover {
  text-decoration: underline;
}

.era-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.era-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem;
  background: var(--bg-color);
  text-align: center;
}

.era-svg-box {
  width: 78px;
  height: 78px;
  margin: 0 auto 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
}

.era-svg-box svg {
  width: 100%;
  height: 100%;
  fill: var(--text-color);
}

.era-glyph-fallback {
  font-family: var(--font-hanzi);
  font-size: 2.5rem;
  line-height: 1;
}

.era-name {
  font-size: 0.86rem;
  font-weight: 700;
}

.era-period {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

/* Video Desk Demo */
.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 360px);
  gap: 1.5rem;
  align-items: start;
  margin-top: 2rem;
}

.video-desk {
  background: #141416;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  color: #FFFFFF;
}

.video-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0E0E10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 6s ease, opacity 0.35s ease;
}

.video-stage.is-playing .video-scene-img {
  transform: scale(1.05);
}

.video-top-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(20, 20, 22, 0.76);
  backdrop-filter: blur(8px);
  color: #FDFCF0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.subtitle-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 0.95rem 1.2rem;
  text-align: center;
}

.sub-hanzi-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18rem;
  margin-bottom: 0.3rem;
}

.sub-token {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.1rem 0.28rem;
  font-family: var(--font-hanzi);
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.85);
}

.sub-token.is-highlighted {
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.85), 1px 1px 4px rgba(0, 0, 0, 0.85);
}

.sub-token:hover,
.sub-token.is-selected {
  background: rgba(212, 175, 55, 0.28);
  border-color: rgba(212, 175, 55, 0.8);
  color: #FFFFFF;
}

.sub-pinyin-line {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.25rem;
}

.sub-trans-line {
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.74);
}

.video-controls {
  padding: 0.9rem 1.15rem;
  background: #1B1B1E;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.video-transport {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.v-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.v-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.v-btn.is-active {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.video-progress {
  display: flex;
  gap: 4px;
  padding: 0 1.15rem 0.9rem;
  background: #1B1B1E;
}

.v-step {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  border: none;
}

.v-step.is-done {
  background: var(--gold);
}

.video-mode-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.video-stage-yt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-stage-yt iframe,
#yt-player-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.subtitle-overlay-static {
  position: static;
  margin: 0;
  border-radius: 0;
  background: #141416;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem;
  backdrop-filter: none;
}

.yt-meta-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.yt-cue-strip {
  max-height: 220px;
  overflow-y: auto;
  background: #101012;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem;
}

.yt-cue-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-family: inherit;
  font-size: 0.86rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.yt-cue-row:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.yt-cue-row.is-active {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.55);
  color: #FFFFFF;
}

.yt-cue-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  color: var(--gold);
  flex-shrink: 0;
}

.word-inspector {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.tone-curves-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.tone-svg-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  text-align: center;
  min-width: 74px;
}

.tone-svg-card svg {
  width: 58px;
  height: 36px;
  display: block;
  margin: 0 auto 0.2rem;
}

.grammar-callout {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  background: var(--bg-soft);
  border-left: 4px solid var(--bronze);
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
}

/* Audiobook Reader Demo */
.book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.book-tab {
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
}

.book-tab.is-active {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

.audiobook-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.reader-toolbar {
  padding: 0.9rem 1.35rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reader-tools-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reader-select {
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.84rem;
}

.reader-body {
  padding: 2rem clamp(1.2rem, 4vw, 2.8rem);
}

.sentence-block {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid transparent;
  margin-bottom: 0.95rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sentence-block.is-active {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.45);
}

.ruby-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.12rem;
  font-family: var(--font-hanzi);
  font-size: var(--reader-font-size, 28px);
  line-height: 2;
}

.hanzi-token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.08rem 0.22rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-hanzi);
  font-size: inherit;
  color: var(--text-color);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.hanzi-token:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.book-summary-card {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
}

.book-summary-head {
  font-size: 1.12rem;
  margin-bottom: 0.45rem;
}

.book-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.book-meta-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-color);
}

.book-meta-pill.is-tag {
  background: rgba(178, 34, 34, 0.08);
  border-color: rgba(178, 34, 34, 0.22);
  color: #B22222;
}

.book-summary-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.hanzi-token.char-spoken {
  color: #B22222;
}

.hanzi-token.char-spoken rt {
  color: #B22222;
}

.hanzi-token.char-active {
  background: rgba(212, 175, 55, 0.34);
  color: #B22222;
  font-weight: 700;
  border-bottom: 2px solid #B22222;
}

.hanzi-token.char-active rt {
  color: #B22222;
  font-weight: 700;
}

.hanzi-token rt {
  font-family: var(--font-sans);
  font-size: 0.44em;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

.reader-body.hide-pinyin rt {
  display: none;
}

.sentence-trans {
  margin-top: 0.35rem;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.reader-body.hide-trans .sentence-trans {
  display: none;
}

.quicklook-box {
  margin: 0 1.35rem 1.5rem;
  padding: 1.15rem 1.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Search & Tables (HSK + Radicals) */
.search-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 1.25rem;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 0.78rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.96rem;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.vocab-table th {
  background: var(--bg-soft);
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.vocab-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

.vocab-table tr:last-child td {
  border-bottom: none;
}

.vocab-table tr:hover td {
  background: rgba(246, 242, 226, 0.45);
}

.hanzi-cell {
  font-family: var(--font-hanzi);
  font-size: 1.45rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.hanzi-cell a {
  text-decoration: none;
  border-bottom: 1px dashed var(--bronze);
}

.hanzi-cell a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.pinyin-cell {
  color: var(--accent-color);
  font-weight: 600;
  white-space: nowrap;
}

.radicals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.radical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.radical-glyph {
  font-family: var(--font-hanzi);
  font-size: 2.3rem;
  color: var(--accent-color);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

/* HSK Quiz */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.quiz-progress-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--bg-pill);
  overflow: hidden;
  margin: 0.85rem 0 1.75rem;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent-color);
  transition: width 0.25s ease;
}

.quiz-prompt-hanzi {
  font-family: var(--font-hanzi);
  font-size: clamp(2.6rem, 6vw, 4rem);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.quiz-prompt-pinyin {
  text-align: center;
  font-size: 1.15rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.quiz-option {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-color);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--text-color);
  background: var(--bg-card);
}

.quiz-option.is-correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
  font-weight: 700;
}

.quiz-option.is-wrong {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

/* Guides, FAQ & Next Steps */
.article-prose {
  padding: 2.5rem 0 1.5rem;
}

.article-prose h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  margin: 2.4rem 0 0.85rem;
  line-height: 1.25;
}

.article-prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.article-prose p {
  font-size: 1.03rem;
  color: #353431;
  margin-bottom: 1rem;
  line-height: 1.78;
}

.article-prose ul,
.article-prose ol {
  margin: 0.75rem 0 1.25rem 1.4rem;
}

.article-prose li {
  margin-bottom: 0.55rem;
  color: #353431;
  line-height: 1.65;
}

.article-prose a {
  color: var(--accent-color);
  font-weight: 600;
}

.article-prose .speak-btn {
  vertical-align: middle;
}

.comparison-table th {
  font-size: 0.86rem;
  white-space: nowrap;
}

.comparison-table td {
  font-size: 0.92rem;
  vertical-align: top;
}

.tones-section {
  margin-top: 2.25rem;
}

.tones-section h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.tones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.tone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.tone-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.tone-hanzi {
  font-family: var(--font-hanzi);
  font-size: 2.35rem;
  line-height: 1.1;
  color: var(--text-color);
}

.tone-quiz-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  max-width: 680px;
}

.tone-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 1rem;
}

.tone-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .tone-quiz-options {
    grid-template-columns: 1fr;
  }
}

.faq-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

.faq-item p {
  margin-top: 0.7rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.next-steps-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  margin: 2.5rem 0;
}

.next-steps-box h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  margin: 0 0 0.9rem;
}

.next-steps-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.next-steps-links a {
  display: inline-block;
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-color);
}

.next-steps-links a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Bottom Conversion Card */
.app-cta-card {
  margin: 3.5rem 0 4rem;
  background: var(--text-color);
  color: var(--bg-color);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.app-cta-copy {
  flex: 1;
  min-width: 260px;
}

.app-cta-copy .eyebrow {
  background: rgba(253, 252, 240, 0.12);
  color: #E7DCC6;
  border-color: rgba(231, 220, 198, 0.35);
}

.app-cta-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.app-cta-copy p {
  color: #D7D2C6;
  font-size: 1rem;
  max-width: 560px;
}

.app-cta-card .primary-btn {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--bg-color);
}

.app-cta-card .secondary-btn {
  background: transparent;
  color: var(--bg-color);
  border-color: rgba(253, 252, 240, 0.75);
}

.app-cta-card .secondary-btn:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.app-cta-card .cta-qr-card {
  background: rgba(253, 252, 240, 0.08);
  border-color: rgba(253, 252, 240, 0.22);
  color: var(--bg-color);
}

.app-cta-card .cta-qr-card:hover {
  border-color: rgba(253, 252, 240, 0.65);
  background: rgba(253, 252, 240, 0.14);
}

.app-cta-card .cta-qr-frame {
  border-color: transparent;
}

.app-cta-card .cta-qr-title {
  color: var(--bg-color);
}

.app-cta-card .cta-qr-sub {
  color: #D7D2C6;
}

/* Growth Footer */
.growth-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-soft);
  padding: 4rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.75rem;
}

.footer-brand h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--bronze);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.footer-col a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--text-subtle);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.footer-legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-legal-links a:hover {
  color: var(--accent-color);
}

/* Universal Quick Look Card */
.ql-char {
  cursor: pointer;
  border-bottom: 1px dotted rgba(178, 34, 34, 0.35);
  border-radius: 3px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.ql-char:hover,
.ql-char:focus-visible {
  background: rgba(212, 175, 55, 0.24);
  color: #B22222;
}

.ql-popover {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: min(350px, calc(100vw - 2rem));
  background: var(--bg-color);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.15rem;
}

.ql-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.ql-glyph {
  font-family: var(--font-hanzi);
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text-color);
  flex-shrink: 0;
}

.ql-meta {
  flex: 1;
  min-width: 0;
}

.ql-py {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-color);
}

.ql-def {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.ql-close {
  border: none;
  background: transparent;
  color: var(--text-subtle);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}

.ql-close:hover {
  color: var(--text-color);
}

.ql-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.ql-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.ql-formula {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: #303F9F;
  background: rgba(63, 81, 181, 0.07);
  border-radius: 8px;
  padding: 0.38rem 0.6rem;
}

.ql-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (max-width: 600px) {
  .ql-popover {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }
}

/* Editorial App Ranking Cards (best-chinese-learning-apps) */
.app-rank-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin: 1.5rem 0 2.5rem;
}

.app-rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.65rem 1.85rem;
  box-shadow: var(--shadow-sm);
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.app-rank-card.is-featured {
  border: 1.5px solid #E2C65A;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFFFFF 100%);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.12);
}

.app-rank-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.app-rank-id {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1 1 320px;
  min-width: 0;
}

.app-rank-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  border: 1px solid rgba(26, 26, 27, 0.08);
  box-shadow: 0 4px 12px rgba(26, 26, 27, 0.08);
}

.app-rank-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-icon-pleco { background: linear-gradient(135deg, #1E4E79, #2E6FA3); }
.app-icon-hello { background: linear-gradient(135deg, #2196F3, #4FC3F7); }
.app-icon-du { background: linear-gradient(135deg, #167A59, #29A37A); }
.app-icon-hack { background: linear-gradient(135deg, #34495E, #546E7A); }
.app-icon-skritter { background: linear-gradient(135deg, #B5342C, #D85A4A); }
.app-icon-duo { background: linear-gradient(135deg, #43A047, #66BB6A); }
.app-icon-dong { background: linear-gradient(135deg, #7B4F2C, #A67249); }

.app-rank-meta {
  min-width: 0;
  flex: 1;
}

.app-rank-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.24rem 0.72rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: #5C4B1A;
  border: 1px solid var(--border-color);
  margin-bottom: 0.42rem;
}

.app-rank-card.is-featured .app-rank-badge {
  background: #F7D44C;
  color: #1A1A1B;
  border-color: #E2BE32;
}

.app-rank-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.22rem;
  line-height: 1.25;
}

.app-rank-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.app-rank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.app-rank-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.52rem 1.05rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-color);
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.app-rank-cta:hover {
  background: #EDE6D0;
  text-decoration: none;
  transform: translateY(-1px);
}

.app-rank-cta.is-primary {
  background: var(--text-color);
  color: #FFFFFF;
  border-color: var(--text-color);
}

.app-rank-cta.is-primary:hover {
  background: #333336;
  color: #FFFFFF;
}

.app-rank-body p {
  margin: 0 0 0.95rem;
  font-size: 0.98rem;
  line-height: 1.68;
  color: var(--text-color);
}

.app-rank-body p:last-of-type {
  margin-bottom: 0;
}

.app-rank-screens {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.25rem;
}

.app-rank-screens img {
  width: 230px;
  max-width: 46%;
  height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 14px 24px rgba(26, 26, 27, 0.16));
  display: block;
}

.app-pros-cons {
  margin: 1.2rem 0 0;
  padding: 1.05rem 0 0;
  border-top: 1px solid var(--border-color);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.app-pro-item,
.app-con-item {
  position: relative;
  padding-left: 1.45rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-color);
}

.app-pro-item::before {
  content: "+";
  position: absolute;
  left: 0;
  top: -0.05rem;
  font-weight: 700;
  font-size: 1.12rem;
  color: #2E6F40;
}

.app-con-item::before {
  content: "\2212";
  position: absolute;
  left: 0;
  top: -0.05rem;
  font-weight: 700;
  font-size: 1.12rem;
  color: #A63A3A;
}

@media (max-width: 680px) {
  .app-rank-card {
    padding: 1.25rem 1.15rem;
    border-radius: 16px;
  }

  .app-rank-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.1rem;
  }

  .app-rank-title {
    font-size: 1.2rem;
  }

  .app-rank-actions {
    width: 100%;
  }

  .app-rank-screens {
    padding: 0.65rem;
    gap: 0.25rem;
  }

  .app-rank-screens img {
    width: 175px;
    border: none;
  }
}

.footer-attribution {
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.footer-attribution a {
  color: var(--text-muted);
}

/* Utilities */
.muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 980px) {
  .site-nav {
    display: none;
  }
  .mobile-menu {
    display: inline-block;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 3rem 5%;
    min-height: auto;
  }
  .hero .cta-buttons,
  .hero .cta-download-group {
    justify-content: center;
  }
  .cta-qr-card {
    display: none;
  }
  .hero-image {
    justify-content: center;
  }
  .showcase-item,
  .showcase-item.reverse {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }
  .showcase-tag-row {
    justify-content: center;
  }
  .studio-grid,
  .video-layout {
    grid-template-columns: 1fr;
  }
  .hsk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .header-cta {
    display: none;
  }
  .hsk-grid,
  .quiz-options,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (pointer: coarse) {
  .cta-qr-card {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Elevated Homepage Hero & Dual-Phone Stage */
.hero-elevated {
  padding-top: 3.75rem;
  padding-bottom: 3.75rem;
  min-height: auto;
  gap: 3.25rem;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: #6B531A;
  border: 1px solid var(--border-strong);
  margin-bottom: 1.15rem;
}

.hero-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.hero-pillar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-color);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  box-shadow: var(--shadow-sm);
}

.hero-pillar::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-color);
  flex-shrink: 0;
}

.hero-stage {
  position: relative;
  width: 100%;
  max-width: 580px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
}

.hero-phone-main,
.hero-phone-secondary {
  filter: drop-shadow(0 18px 32px rgba(26, 26, 27, 0.18));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-phone-main {
  width: 54%;
  z-index: 2;
}

.hero-phone-secondary {
  width: 48%;
  margin-left: -2%;
  transform: translateY(-10px);
  z-index: 1;
}

.hero-stage:hover .hero-phone-main {
  transform: translateY(-4px);
}

.hero-stage:hover .hero-phone-secondary {
  transform: translateY(-18px);
}

.hero-phone-main img,
.hero-phone-secondary img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 900px) {
  .hero-elevated {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    gap: 2.25rem;
  }

  .hero-pillars {
    justify-content: center;
  }

  .hero-stage {
    max-width: 440px;
    padding: 0.75rem 0.5rem;
    gap: 0;
  }

  .hero-phone-secondary {
    transform: translateY(-8px);
  }
}

/* QR Code Lightbox Modal */
.qr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(26, 26, 27, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.qr-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-color);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(26, 26, 27, 0.28);
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
}

.qr-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-color);
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.qr-modal-close:hover {
  background: var(--bg-soft);
}

.qr-modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.25rem;
}

.qr-modal-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.qr-modal-img-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.qr-modal-img {
  width: 280px;
  max-width: 100%;
  height: auto;
  display: block;
}

.qr-modal-link {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.qr-modal-link:hover {
  color: var(--accent-color);
}

/* Guides Hub Category Filter Pills */
.guide-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.guide-filter-pill {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-color);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.guide-filter-pill:hover {
  background: var(--bg-soft);
}

.guide-filter-pill.is-active {
  background: var(--text-color);
  color: #FFFFFF;
  border-color: var(--text-color);
}

.guide-filter-count {
  margin-left: auto;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 680px) {
  .guide-filter-count {
    width: 100%;
    margin-left: 0;
    margin-top: 0.25rem;
  }
}

/* Compact Zero-Scroll Homepage Redesign */
.hero-compact {
  padding-top: 2.25rem;
  padding-bottom: 2rem;
  gap: 2.25rem;
}

.hero-compact .hero-stage {
  max-width: 490px;
}

.hero-compact .hero-pillars {
  margin-top: 1.15rem;
}

.showcase-compact {
  padding: 2.25rem 0 2.5rem;
}

.showcase-compact .showcase-header {
  margin-bottom: 1.5rem;
}

.feature-explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.95fr);
  gap: 1.5rem;
  align-items: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.feature-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.feature-tile:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
  transform: translateY(-1px);
}

.feature-tile.is-active {
  border-color: var(--accent-color);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-color);
}

.feature-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.feature-tile .showcase-pill {
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
}

.feature-tile .showcase-number {
  font-size: 0.78rem;
}

.feature-tile-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.feature-tile-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--text-muted);
}

.feature-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.feature-stage-phone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.35rem 0;
}

.feature-stage-phone img {
  max-height: 360px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(26, 26, 27, 0.16));
  transition: opacity 0.18s ease;
}

.feature-stage-phone img.is-swapping {
  opacity: 0.35;
}

.feature-stage-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--text-color);
  margin: 0.35rem 0 0.35rem;
}

.feature-stage-body p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.section-compact {
  padding: 2rem 0;
}

.section-compact .section-heading {
  margin-bottom: 1.25rem;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading-row .section-heading {
  margin-bottom: 0;
}

.demos-compact-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.zen-card-compact {
  padding: 1rem 1.05rem;
  gap: 0.6rem;
}

.zen-card-compact h3 {
  font-size: 1.02rem;
  line-height: 1.25;
}

.zen-card-compact p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.42;
}

.hsk-compact-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
}

.hsk-compact-grid .hsk-card {
  padding: 0.9rem;
}

.hsk-compact-grid .hsk-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82rem;
}

.guides-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

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

  .hsk-compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .feature-explorer {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-grid {
    display: flex;
    overflow-x: auto;
    gap: 0.6rem;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
  }

  .feature-tile {
    flex: 0 0 175px;
    scroll-snap-align: start;
    padding: 0.7rem 0.8rem;
  }

  .feature-tile-desc {
    display: none;
  }

  .feature-stage-phone img {
    max-height: 290px;
  }

  .guides-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .demos-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsk-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guides-compact-grid {
    grid-template-columns: 1fr;
  }
}
