/* --- Jade & Imperial Gold Daily Spin Wheel (#daily-spin-dialog & .daily-spin-card) --- */
.daily-spin-card {
  background: linear-gradient(135deg, var(--soft), var(--paper));
  border: 1px solid var(--line);
}

.daily-spin-card .panel-label {
  color: var(--jade);
}

.daily-spin-card p {
  font-size: 0.84rem;
  color: var(--text);
  margin: 4px 0 12px;
}

.daily-spin-card [data-action="open-daily-spin"] {
  width: 100%;
}

#daily-spin-dialog,
#streak-rescue-dialog,
#gate-dialog {
  width: min(460px, calc(100vw - 28px));
  margin: auto;
}

#streak-rescue-dialog > .dialog-shell,
#gate-dialog > .dialog-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.spin-modal-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  padding: 26px 24px;
  background: var(--paper);
  color: var(--ink);
}

.spin-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.spin-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--jade);
  display: flex;
  align-items: center;
  gap: 8px;
}

.spin-title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.spin-modal-head .dialog-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.spin-modal-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.spin-wheel-stage {
  position: relative;
  width: 260px;
  margin: 6px auto 22px;
  padding-top: 10px;
}

.spin-pointer-needle {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(183, 119, 33, 0.42);
  border: 2px solid var(--paper);
}

.spin-wheel-container {
  position: relative;
  width: 248px;
  height: 248px;
  margin: 0 auto;
  border-radius: 50%;
  border: 6px solid var(--jade);
  box-shadow: 0 12px 28px rgba(8, 127, 109, 0.2), inset 0 0 0 3px rgba(183, 119, 33, 0.35);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-wheel-canvas {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  transition: transform 3.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spin-sector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  gap: 2px;
}

.spin-sector-voucher {
  background: var(--soft);
  border-right: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
}

.spin-sector-piggy {
  background: var(--cream);
  border-bottom: 1.5px solid var(--line);
}

.spin-sector-vip {
  background: var(--paper);
  border-right: 1.5px solid var(--line);
}

.spin-sector-topup {
  background: var(--bg);
}

.spin-sector-icon {
  font-size: 1.35rem;
  line-height: 1.1;
}

.spin-sector-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink);
}

.spin-sector-voucher .spin-sector-title {
  color: var(--jade);
}

.spin-sector-piggy .spin-sector-title {
  color: #9b733b;
}

.spin-sector-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.spin-center-hub {
  position: relative;
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(24, 61, 54, 0.24);
}

.spin-center-hub img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.spin-result-card {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft);
  border: 1.5px solid var(--jade);
  text-align: left;
}

.spin-result-title {
  margin: 0 0 6px;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--jade);
}

.spin-result-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink);
}

.spin-voucher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.spin-voucher-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.spin-voucher-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.spin-voucher-code {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.spin-countdown-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: #6b4c14;
  font-size: 0.76rem;
  font-weight: 800;
}

.spin-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spin-main-btn,
.spin-apply-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.96rem;
  padding: 12px 16px;
}

.spin-status-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

/* ==========================================================================
   Site-Wide High-Clarity Typography & 3-Tier Lexical Stack Harmonization
   Ensures all 178+ pages (Home, Lessons, Reading, Grammar, Dictionary,
   Placement, Pinyin, Radicals, Hanzi, Measure Words, Podcast, Pricing)
   display with generous, crisp, eye-friendly proportions.
   ========================================================================== */
.dictionary-word h2 { font-size: 36px; font-weight: 600; }
.dictionary-word .pinyin { font-size: 16.5px; font-weight: 600; }
.dictionary-word strong { font-size: 15.5px; }
.dictionary-detail, .discovery-links a, .resource-source { font-size: 13.5px; }
.dictionary-input-wrap input, .dictionary-topic select { font-size: 14.5px; }
.dictionary-level-tabs .btn, .dictionary-pinyin-toggle { font-size: 13.5px; padding: 7px 16px; }
.resource-example .example-hanzi, .reading-story .example-hanzi { font-size: 25px; font-weight: 600; line-height: 1.75; }
.example-pinyin { font-size: 15px; font-weight: 600; }
.example-meaning { font-size: 15px; line-height: 1.8; }
.resource-card h2, .reading-card h2 { font-size: 22px; }
.resource-card h3 { font-size: 19px; }
.resource-card p { font-size: 14.5px; line-height: 1.85; }
.grammar-pattern { font-size: 18.5px; line-height: 1.7; }
.grammar-formula > p { font-size: 24px; }
.mistake-wrong > span[lang], .mistake-correct > span[lang] { font-size: 21px; font-weight: 600; }
.mistake-example > p:last-child { font-size: 14.5px; }
.resource-quiz-question legend { font-size: 16.5px; }
.resource-quiz-option { font-size: 15px; padding: 14px 16px; }
.resource-quiz-feedback { font-size: 14px; }
.study-plan-card h3 { font-size: 19px; }
.study-plan-card > p { font-size: 14px; }
.practice-metric > strong { font-size: 30px; }
.practice-metric > span { font-size: 13px; }
.mistake-review-card > h2 { font-size: 20px; }
.mistake-explanation p { font-size: 14px; }

/* Interactive Home Content Metrics Strip */
.content-metrics > .content-metric-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s ease, transform 0.18s ease;
}
.content-metrics > .content-metric-item + .content-metric-item {
  border-left: 1px solid var(--line);
  padding-left: 21px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.content-metrics > .content-metric-item > .icon {
  width: 20px;
  height: 20px;
  color: var(--jade);
  flex-shrink: 0;
}
.content-metrics > .content-metric-item:hover {
  background: var(--soft);
  transform: translateY(-1px);
}
.content-metrics > .content-metric-item:hover strong {
  color: var(--jade);
}
@media (max-width: 1270px) {
  .content-metrics > .content-metric-item { gap: 7px; padding: 6px 8px; }
  .content-metrics > .content-metric-item + .content-metric-item { padding-left: 12px; }
}
@media (max-width: 600px) {
  .content-metrics > .content-metric-item { gap: 6px; padding: 6px 4px; }
  .content-metrics > .content-metric-item + .content-metric-item { padding-left: 9px; }
  .content-metrics > .content-metric-item > .icon { display: none; }
}

/* 5-Cluster Pedagogical Accordion Sidebar & Horizontal Cluster Sub-nav */
.sidebar details.nav-cluster {
  border-bottom: 0;
  padding: 0;
  margin-bottom: 6px;
}
.sidebar details.nav-cluster + details.nav-cluster {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.sidebar summary.nav-cluster-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 9px;
  font-size: 9.8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.16s ease, color 0.16s ease;
}
.sidebar summary.nav-cluster-summary::-webkit-details-marker {
  display: none;
}
.sidebar summary.nav-cluster-summary::after {
  content: none !important;
}
.sidebar summary.nav-cluster-summary:hover {
  background: var(--soft);
  color: var(--ink);
}
.sidebar details.nav-cluster[open] > summary.nav-cluster-summary {
  color: var(--jade);
}
.nav-cluster-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-cluster-portal-link {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.16s ease, transform 0.16s ease;
}
.nav-cluster-portal-link:hover {
  color: var(--jade);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nav-cluster-portal-link.is-hub-active {
  color: var(--jade);
  font-weight: 800;
}
.nav-cluster-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 3px 5px;
  border-radius: 7px;
  transition: background 0.15s ease;
}
.nav-cluster-meta:hover {
  background: rgba(8, 127, 109, 0.12);
}
.nav-cluster-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--muted);
}
.sidebar details.nav-cluster[open] .nav-cluster-count {
  background: var(--soft);
  border-color: #c3ddd0;
  color: var(--jade);
}
.nav-cluster-chevron {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  transform: rotate(-90deg);
  transition: transform 0.18s ease, color 0.18s ease;
}
.sidebar details.nav-cluster[open] .nav-cluster-chevron {
  transform: rotate(0deg);
  color: var(--jade);
}
.sidebar details.nav-cluster > .nav-group {
  padding-bottom: 4px;
}
.sidebar .nav-item {
  padding: 9px 12px;
  margin-bottom: 3px;
}

.cluster-subnav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: -8px 0 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: thin;
}
.cluster-subnav-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid rgba(8, 127, 109, 0.22);
  color: var(--jade);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.cluster-subnav-badge:hover,
.cluster-subnav-badge.is-active {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
}
.cluster-subnav-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.cluster-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.cluster-subnav-link .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.cluster-subnav-link:hover {
  background: var(--bg);
  color: var(--ink);
}
.cluster-subnav-link.is-active {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
  font-weight: 700;
}

html[data-theme=dark] .sidebar details.nav-cluster[open] .nav-cluster-count {
  background: var(--soft);
  border-color: var(--line);
  color: #82cfa8;
}
html[data-theme=dark] .cluster-subnav-badge {
  color: #82cfa8;
}
html[data-theme=dark] .cluster-subnav-link.is-active {
  background: #177d5f;
  border-color: #177d5f;
  color: #fff;
}

@media (max-width: 600px) {
  .cluster-subnav {
    padding: 7px 10px;
    margin-bottom: 18px;
  }
  .cluster-subnav-badge {
    display: none;
  }
  .cluster-subnav-link {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

/* Global Category Pill & Level Tab Controls */
.category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.category-pill:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: var(--soft);
}

.category-pill.is-active,
.category-pill[aria-pressed="true"],
.btn-secondary.is-active,
.btn-secondary[aria-pressed="true"] {
  background: var(--jade);
  border-color: var(--jade);
  color: #ffffff;
}

html[data-theme=dark] .category-pill.is-active,
html[data-theme=dark] .category-pill[aria-pressed="true"],
html[data-theme=dark] .btn-secondary.is-active,
html[data-theme=dark] .btn-secondary[aria-pressed="true"] {
  background: #177d5f;
  border-color: #177d5f;
  color: #ffffff;
}

