@font-face {
  font-family: "Smiley Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/SmileySans.woff2") format("woff2");
}

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

:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f8fafc;
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-accent: #f472b6;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --border: rgba(37, 99, 235, 0.12);
  --border-pink: rgba(244, 114, 182, 0.2);
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
  --shadow-pink: 0 4px 20px rgba(244, 114, 182, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Nunito Sans", "Smiley Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Nunito Sans", "Smiley Sans", sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body::before {
  content: none;
}

#app {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.site-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 800;
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.site-nav a.active {
  color: var(--primary);
  background: var(--blue-100);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-pink);
  background: var(--pink-50);
  padding: 32px 0;
}

.site-footer-inner {
  display: grid;
  gap: 20px;
  text-align: center;
}

@media (min-width: 769px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    align-items: start;
  }

  .footer-right {
    text-align: right;
  }
}

.footer-brand {
  font-weight: 700;
  font-size: 1rem;
}

.footer-meta,
.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 6px;
}

.view-pdf {
  max-width: none;
}

.view {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 1rem;
}

.page-title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.page-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 6px;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.hero {
  margin-bottom: 20px;
}

.hero-banner {
  margin: -32px -24px 40px;
  padding: 56px 24px 48px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(99, 102, 241, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-banner-inner {
  max-width: 680px;
}

.hero-banner .title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-family: var(--font-display);
}

.hero-banner .subtitle {
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.home-section {
  margin-bottom: 48px;
}

.course-catalog {
  margin: -32px -24px 0;
  padding: 40px 24px 44px;
  background: var(--blue-50);
  border-bottom: 1px solid var(--border);
}

.course-catalog-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.course-card--available:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.course-card--coming {
  opacity: 0.88;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.course-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-card-board {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.course-card-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.course-card-badge--live {
  background: var(--blue-100);
  color: var(--primary);
}

.course-card-badge--updating {
  background: #fef3c7;
  color: #b45309;
}

.course-card-badge--soon {
  background: #f1f5f9;
  color: var(--text-muted);
}

.course-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.course-card-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex: 1;
}

.course-card-meta {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
}

.course-card-meta--muted {
  color: var(--text-muted);
  font-weight: 500;
}

.course-card-cta {
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.question-board {
  margin-top: 8px;
}

.question-board-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.question-board-notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  border: 1px dashed rgba(37, 99, 235, 0.25);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.question-board-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.question-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-field label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.question-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.question-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.question-select {
  cursor: pointer;
}

.question-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.question-submit {
  align-self: flex-start;
  min-width: 140px;
}

.question-form-status {
  min-height: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}

.question-form-status.is-pending {
  color: var(--text-muted);
}

.question-form-status.is-success {
  color: #15803d;
}

.question-form-status.is-error {
  color: #b91c1c;
}

.question-board-privacy {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.published-qa-card {
  margin-top: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.published-qa-empty {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.published-qa-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.published-qa-item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--blue-50);
}

.published-qa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.75rem;
}

.published-qa-course {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
}

.published-qa-topic {
  color: var(--text-muted);
  font-weight: 600;
}

.published-qa-date {
  color: var(--text-muted);
}

.published-qa-q {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 8px;
}

.published-qa-a {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.admin-questions-panel {
  max-width: 820px;
}

.admin-sheet-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.admin-sheet-link:hover {
  text-decoration: underline;
}

.admin-auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-auth-label {
  font-size: 0.8125rem;
  font-weight: 700;
}

.admin-token-input {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.admin-list-status {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-list-status.is-error {
  color: #b91c1c;
}

.admin-questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-question-card {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-question-course {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--primary);
  font-weight: 700;
}

.admin-question-name {
  font-weight: 600;
}

.admin-question-topic {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.admin-question-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.admin-question-contact {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.admin-question-url {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--primary);
}

.admin-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.author-hero {
  margin: 0 -24px;
  padding: 40px 24px 36px;
  background: var(--pink-50);
  border-bottom: 1px solid var(--border-pink);
}

.author-hero-card {
  background: #ffffff;
  border: 1px solid var(--border-pink);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-pink);
}

.author-hero .author-name {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.author-hero .eyebrow {
  color: var(--pink-accent);
}

.author-hero .author-avatar {
  background: var(--pink-accent);
  box-shadow: var(--shadow-pink);
}

.author-story {
  margin-top: 12px;
  color: var(--pink-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.55;
  width: 100%;
  max-width: none;
  text-align: justify;
  text-justify: inter-ideograph;
}

.course-overview {
  margin: 0 -24px;
  padding: 40px 24px 48px;
  background: var(--blue-50);
  border-bottom: 1px solid var(--border);
}

.course-overview.home-section {
  margin-bottom: 0;
}

.section-header-accent {
  border-bottom-color: rgba(37, 99, 235, 0.2);
}

.section-header-accent .section-title {
  color: var(--primary);
}

.course-intro-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.course-intro-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.course-intro-text {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.unit-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.accordion-item[open] {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow);
}

.accordion-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: #ffffff;
}

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

.accordion-num {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--blue-100);
  padding: 4px 10px;
  border-radius: 999px;
}

.accordion-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.accordion-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--blue-100);
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.accordion-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  background: var(--blue-50);
}

.accordion-text {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.65;
  padding-top: 14px;
}

.accordion-meta {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 8px;
}

.accordion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.course-overview-footer {
  margin-top: 24px;
  text-align: center;
}

.section-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 6px;
}

.section-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

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

.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.author-profile {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.author-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}

.author-info {
  flex: 1;
  min-width: 0;
}

.author-name {
  font-size: 1.375rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.author-bio {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-top: 8px;
}

.author-credentials {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.author-credential {
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}

.author-credential::before {
  display: none;
}

.footer-author {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 4px;
}

.footer-disclaimer,
.site-disclaimer {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.footer-disclaimer {
  margin-top: 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.site-disclaimer {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--pink-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--pink-accent);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.topic-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.topic-card--locked {
  opacity: 0.82;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.topic-card--locked:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  border-color: var(--border);
  cursor: default;
}

.topic-locked-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
}

.topic-locked-hint {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.topic-number {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(37, 99, 235, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

.topic-card-compact .topic-actions {
  margin-top: 16px;
}

.topic-card-compact .topic-actions .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.8125rem;
}

.btn-sm {
  padding: 10px 14px;
  font-size: 0.8125rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.875rem;
}

.topic-link {
  display: none;
}

.topic-card-compact {
  padding: 20px;
}

.breadcrumb-link {
  color: var(--primary);
  text-decoration: none;
}

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

.breadcrumb-sep {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-muted);
}

.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.page-main {
  min-width: 0;
}

.lesson-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sidebar-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}

.sidebar-units,
.sidebar-sections {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-unit-link,
.sidebar-section-link {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.sidebar-unit-link:hover,
.sidebar-section-link:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.sidebar-unit.active .sidebar-unit-link {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-unit--locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sidebar-unit-locked {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  opacity: 0.75;
  cursor: not-allowed;
}

.sidebar-unit-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
}

.quiz-layout {
  max-width: 1100px;
}

.quiz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quiz-timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.quiz-timer-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-timer {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.quiz-progress-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.quiz-nav {
  position: sticky;
  top: 76px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quiz-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.quiz-nav-item:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--blue-50);
}

.quiz-nav-item.current {
  border-color: var(--primary);
  background: var(--blue-100);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.quiz-nav-item.answered:not(.current) {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

.quiz-nav-item.correct {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #15803d;
}

.quiz-nav-item.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.quiz-main {
  min-width: 0;
}

.quiz-summary-slot {
  margin-bottom: 14px;
}

.quiz-results-inline {
  text-align: center;
  padding: 22px 18px;
}

.quiz-results-inline .results-score {
  font-size: 2.25rem;
}

.quiz-results-inline .topic-actions {
  margin-top: 16px;
}

.quiz-actions {
  margin-top: 16px;
}

.quiz-submit {
  max-width: 420px;
}

.quiz-feedback-hint {
  font-weight: 600;
  color: var(--text-muted);
}

.note-block {
  scroll-margin-top: 88px;
}

.note-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.btn {
  text-decoration: none;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-suffix {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-featured {
  border-color: rgba(59, 130, 246, 0.3);
}

.card-muted {
  opacity: 0.7;
}

.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 6px;
}

.card-title-sm {
  font-size: 1rem;
  font-weight: 600;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-block {
  width: 100%;
  margin-top: 16px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
  color: var(--text);
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 4px;
}

.topic-summary {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 6px;
  line-height: 1.45;
}

.resource-meta {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 8px;
}

.resource-link {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-notes {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-quiz {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.topic-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.topic-actions .btn {
  flex: 1;
}

.note-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.note-heading {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.note-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-paragraph {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.note-question {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}

.note-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.note-option {
  width: 100%;
}

.note-callout:not(.note-callout-hidden) {
  animation: notePracticeReveal 0.32s ease-out;
}

@keyframes notePracticeReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.note-feedback-hint {
  font-weight: 500;
}

.note-callout {
  background: transparent;
  border-left: none;
  border-radius: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-callout.note-callout-hidden {
  display: none;
}

.note-explanation-en {
  margin: 0;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.note-explanation-zh {
  margin: 8px 0 0;
  padding: 8px 12px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  color: #be185d;
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
}

.quiz-explanation-en {
  margin: 8px 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
}

.quiz-explanation-zh {
  margin: 6px 0 0;
  color: #be185d;
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
}

.note-points-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-point-pair {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-point-en {
  position: relative;
  padding: 2px 0 2px 18px;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.note-point-en::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.note-point-zh {
  margin-left: 18px;
  padding: 8px 12px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  color: #be185d;
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
}

.note-point {
  position: relative;
  padding: 2px 0 2px 18px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.note-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.note-hint {
  margin: 6px 0 0;
  padding-left: 0;
  color: #be185d;
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
}

.note-footnotes {
  margin: 2px 0 0;
  padding: 14px 16px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-footnote {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.note-footnote-mark {
  font-weight: 700;
  color: var(--pink-accent);
  font-size: 0.875rem;
  line-height: 1.55;
}

.note-footnote-text {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.note-footnote-hint {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.note-tips {
  margin: 2px 0 0;
  padding: 14px 16px;
  background: var(--blue-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-tips-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

.note-tip {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.note-tip-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.note-tip-text {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.note-tip-hint {
  margin: 4px 0 0;
  color: #be185d;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 500;
}

.note-table-wrap {
  overflow-x: auto;
  margin: 4px 0;
}

.note-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.note-table th,
.note-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.note-table th {
  background: var(--blue-50);
  color: var(--text);
  font-weight: 600;
}

.note-table td {
  color: var(--text-muted);
}

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

.note-table tbody tr:nth-child(even) td {
  background: var(--bg-elevated);
}

.note-table tbody tr:hover td {
  background: var(--blue-50);
}

.note-lead {
  color: var(--text);
}

.note-practice-wrap {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-practice-wrap .note-practice-card {
  background: var(--blue-50);
  border: 1px dashed rgba(37, 99, 235, 0.25);
}

.note-practice-card .note-table-wrap {
  margin: 10px 0 14px;
}

.note-diagrams {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

.note-diagram {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
  width: 100%;
}

.note-diagram-chart {
  display: flex;
  flex-direction: column;
}

.note-diagram-wide {
  grid-column: 1 / -1;
}

.note-diagram-panel-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 4px 16px 0;
  width: 100%;
}

.note-diagram-panel {
  min-width: 0;
}

.note-diagram-panel-title {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  font-family: var(--font-display);
}

.note-diagram-panels .note-diagram-svg {
  padding: 0;
}

.note-diagram-panel-notes {
  padding: 10px 4px 4px;
}

.note-diagram-panel-caption {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--primary);
  text-decoration: underline;
  font-family: var(--font-display);
}

.note-diagram-panel-points {
  padding: 0;
  gap: 8px;
}

.note-diagram-panel-points li {
  padding-left: 0;
}

.note-diagram-panel-points li::before {
  display: none;
}

.note-diagram-panel-points .note-diagram-bullet-en {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}

.note-diagram-panel-points .note-diagram-bullet-zh {
  font-size: 0.75rem;
  margin-top: 4px;
  padding: 6px 10px;
}

.note-diagram-body-full {
  padding: 12px 20px 18px;
  width: 100%;
}

.note-diagram-body-full .note-diagram-points {
  padding: 0;
}

.note-diagram-body-full .note-diagram-points li {
  padding-left: 0;
}

.note-diagram-body-full .note-diagram-points li::before {
  display: none;
}

.note-diagram-body-full .note-diagram-bullet-en {
  text-align: justify;
  text-justify: inter-ideograph;
}

.note-diagram-body-full .note-diagram-bullet-zh {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  text-align: justify;
  text-justify: inter-ideograph;
}

@media (max-width: 720px) {
  .note-diagram-panel-row {
    grid-template-columns: 1fr;
    padding: 0 12px;
  }
}

.note-diagram-split-row {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 20px 28px;
  align-items: start;
  padding: 4px 20px 18px;
  width: 100%;
}

.note-diagram-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.note-diagram-split .note-diagram-svg,
.note-diagram-split .note-diagram-img-wrap {
  padding: 0;
}

.note-diagram-split .note-diagram-legend {
  padding: 0;
}

.note-diagram-split .note-diagram-points {
  padding: 0;
  flex: 1;
}

.note-diagram-split .note-diagram-points li {
  padding-left: 0;
}

.note-diagram-split .note-diagram-points li::before {
  display: none;
}

.note-diagram-split .note-diagram-bullet-en {
  text-align: justify;
  text-justify: inter-ideograph;
  line-height: 1.55;
}

.note-diagram-split .note-diagram-bullet-zh {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  text-align: justify;
  text-justify: inter-ideograph;
  line-height: 1.55;
}

.note-diagram-stack .note-diagram-svg,
.note-diagram-stack .note-diagram-img-wrap {
  padding: 4px 20px 0;
}

.note-diagram-stack .note-diagram-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 20px 18px;
  width: 100%;
}

.note-diagram-stack .note-diagram-subtitle--below {
  margin: 8px 20px 0;
  padding: 0;
}

.note-diagram-stack .note-diagram-points {
  padding: 0;
  width: 100%;
}

.note-diagram-stack .note-diagram-points li {
  padding-left: 0;
}

.note-diagram-stack .note-diagram-points li::before {
  display: none;
}

.note-diagram-stack .note-diagram-bullet-en {
  text-align: justify;
  text-justify: inter-ideograph;
  line-height: 1.55;
}

.note-diagram-stack .note-diagram-bullet-zh {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  text-align: justify;
  text-justify: inter-ideograph;
  line-height: 1.55;
}

.note-diagram-meaning .note-diagram-points li::before {
  display: none;
}

.note-diagram-meaning .note-diagram-bullet-en {
  display: block;
  font-weight: 600;
  line-height: 1.55;
}

.note-diagram-meaning .note-diagram-bullet-zh {
  display: block;
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--pink-50);
  border: 1px solid var(--border-pink);
  border-radius: var(--radius-sm);
  color: #be185d;
  font-size: 0.8125rem;
}

.note-diagram-bullet-en sub,
.note-diagram-bullet-zh sub,
.note-diagram-meaning .note-diagram-bullet-en sub,
.note-diagram-meaning .note-diagram-bullet-zh sub {
  font-size: 0.78em;
  font-weight: 700;
}

.note-diagram-meaning {
  padding: 16px 20px;
  grid-column: 1 / -1;
}

.note-diagram-meaning .note-diagram-title {
  padding: 0 0 10px;
}

.note-diagram-meaning .note-diagram-points {
  padding: 0;
}

.note-diagram-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  padding: 16px 20px 0;
  font-family: var(--font-display);
  line-height: 1.35;
}

.note-diagram-subtitle {
  margin: 6px 20px 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
}

.note-diagram-points {
  margin: 0;
  padding: 12px 20px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.note-diagram-points li {
  position: relative;
  padding-left: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
  width: 100%;
}

.note-diagram-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.55;
}

.note-diagram-bullet-en {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.note-diagram-bullet-zh {
  display: block;
  margin-top: 3px;
  font-size: 0.8125rem;
  color: var(--pink-accent);
  font-family: var(--font);
}

.note-diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 4px;
  width: 100%;
}

.note-diagram-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}

.note-diagram-legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: currentColor;
  opacity: 0.25;
}

.note-diagram-legend-item--efficient {
  color: #2563eb;
  background: #eff6ff;
}

.note-diagram-legend-item--inefficient {
  color: #d97706;
  background: #fffbeb;
}

.note-diagram-legend-item--unattainable {
  color: #dc2626;
  background: #fef2f2;
}

.note-diagram-svg {
  padding: 6px 14px 0;
}

.note-diagram-svg svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
}

@media (max-width: 720px) {
  .note-diagrams {
    grid-template-columns: 1fr;
  }

  .note-diagram-split-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px 16px;
  }

  .note-diagram-title,
  .note-diagram-subtitle {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.note-diagram-image {
  max-width: 100%;
}

.note-diagram-image .note-diagram-title {
  padding: 14px 18px 0;
}

.note-diagram-img-wrap {
  padding: 8px 16px 0;
  text-align: center;
  background: #ffffff;
}

.note-diagram-img-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.note-diagram-image .note-diagram-points {
  padding: 12px 18px 4px;
}

.note-diagram-image .note-diagram-caption {
  padding-top: 0;
}

.note-diagram-caption {
  padding: 10px 14px 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font);
}

.note-practice-title,
.note-gallery-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.note-practice-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.note-gallery {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-figures {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-gallery-original .note-gallery-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.note-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.note-figure-page {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.note-image-original {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  cursor: zoom-in;
  background: #ffffff;
}

.note-image-original:hover {
  opacity: 0.96;
}

.note-caption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

.note-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.note-image:hover {
  transform: scale(1.02);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
}

.image-lightbox.open {
  display: flex;
}

.image-lightbox img {
  max-width: min(100%, 520px);
  max-height: 90dvh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.view-footer {
  margin-top: 8px;
  padding-bottom: 8px;
}

.pdf-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.pdf-toolbar .btn {
  flex: 1;
}

.pdf-viewer {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: min(70dvh, 720px);
  border: none;
  background: #fff;
}

.pdf-fallback {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pdf-fallback a {
  color: var(--primary);
}

.quiz-progress {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 999px;
  margin-bottom: 16px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0;
}

.quiz-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.quiz-card .note-table-wrap {
  margin: 12px 0 16px;
}

.quiz-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quiz-source {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.quiz-question {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.45;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.quiz-option {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.4);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

.feedback-correct {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback-wrong {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.quiz-feedback p {
  margin-top: 6px;
  color: var(--text-muted);
  line-height: 1.5;
}

.quiz-action {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .quiz-body {
    grid-template-columns: 1fr;
  }

  .quiz-nav {
    position: static;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    max-height: none;
  }

  .quiz-submit {
    max-width: none;
  }
}

.quiz-results {
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 20px;
  border: 1px solid var(--border);
}

.results-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.results-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 8px;
}

.results-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 8px;
  line-height: 1.5;
}

.quiz-results .topic-actions {
  margin-top: 24px;
  flex-wrap: wrap;
}

.quiz-results .topic-actions .btn {
  min-width: calc(50% - 5px);
}

@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
    max-height: none;
  }

  .course-catalog {
    margin: -24px -16px 0;
    padding: 28px 16px 32px;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .author-hero {
    margin: 0 -16px;
    padding: 28px 16px 24px;
  }

  .author-hero-card {
    padding: 24px 20px;
  }

  .question-form-row {
    grid-template-columns: 1fr;
  }

  .question-board-card {
    padding: 22px 18px 20px;
  }

  .question-submit {
    width: 100%;
  }

  .course-overview {
    margin: 0 -16px;
    padding: 32px 16px 40px;
  }

  .hero-banner {
    margin: -24px -16px 32px;
    padding: 40px 16px 36px;
  }

  .author-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-credentials {
    grid-template-columns: 1fr;
  }

  .hero-banner .title {
    font-size: 2rem;
  }

  #app {
    padding: 24px 16px 40px;
  }

  .site-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .title {
    font-size: 2.75rem;
  }
}
