@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

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

:root {
  --ink:        #1c1a17;
  --ink-2:      #3e3a32;
  --ink-3:      #7a7060;
  --paper:      #fdfaf5;
  --paper-2:    #f4efe3;
  --paper-3:    #ebe3d0;
  --red:        #bc3b2a;
  --red-light:  #faeae7;
  --gold:       #b07d1e;
  --gold-light: #fdf5dc;
  --teal:       #1a6b5a;
  --teal-light: #e1f0eb;
  --blue:       #1e5fa8;
  --blue-light: #e5eef9;
  --border:     rgba(28,26,23,0.1);
  --r:          10px;
  --serif:      'Noto Serif SC', serif;
  --sans:       'Noto Sans SC', 'Lora', sans-serif;
  --shadow:     0 2px 12px rgba(28,26,23,0.08);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  min-height: 100vh;
}

/* ── NAV ── */
.topnav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,250,243,0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(169,85,12,0.04);
  backdrop-filter: blur(16px);
  display: flex; align-items: center;
  padding: 0 1.5rem; height: 66px; gap: 0;
}
.nav-logo {
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  text-decoration: none; margin-right: 2rem; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  border-radius: 8px;
}
.nav-logo img {
  display: block;
  width: 128px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}
.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
}
.nav-links { display: flex; gap: 6px; overflow-x: auto; flex: 1; justify-content: center; scrollbar-width: thin; }
.nav-links a {
  white-space: nowrap; padding: 7px 13px; border-radius: 999px;
  font-size: 14px; color: var(--ink-3); text-decoration: none;
  transition: all 0.15s; font-weight: 500;
}
.nav-links a:hover { color: var(--red); background: var(--red-light); }
.nav-links a.active { color: #fff; background: var(--red); font-weight: 600; }

/* ── HERO BANNER ── */
.page-hero {
  background: var(--ink);
  color: #fff; padding: 3rem 2rem 2.5rem;
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: attr(data-char);
  position: absolute; right: 1rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif); font-size: 12rem;
  color: rgba(255,255,255,0.04); line-height: 1;
  pointer-events: none;
}
.page-hero-inner { max-width: 900px; margin: 0 auto; position: relative; }
.page-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--red); background: rgba(188,59,42,0.15);
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  margin-bottom: 0.75rem; font-weight: 500;
}
.page-hero h1 {
  font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700; line-height: 1.2; margin-bottom: 0.5rem;
}
.page-hero p { font-size: 0.95rem; color: rgba(255,255,255,0.55); font-weight: 300; }

/* ── CONTENT WRAPPER ── */
.content-wrap { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* ── SECTION LABELS ── */
.sec-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--red); margin-bottom: 0.4rem;
}
.sec-title {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 700;
  color: var(--ink); margin-bottom: 1.2rem;
}
.section-block { margin-bottom: 3rem; }

/* ── CARD ── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

/* ── BADGE ── */
.badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 2px 10px; border-radius: 20px; letter-spacing: 0.04em;
}
.badge-red { background: var(--red); color: #fff; }
.badge-gold { background: var(--gold-light); color: var(--gold); border: 1px solid var(--gold); }
.badge-teal { background: var(--teal-light); color: var(--teal); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-outline { border: 1px solid var(--border); color: var(--ink-3); }

/* ── BUTTONS ── */
.btn {
  display: inline-block; padding: 9px 22px; border-radius: 7px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none; transition: all 0.15s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #a03224; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--paper-2); }

/* ── PINYIN ── */
.pinyin { font-style: italic; color: var(--gold); font-size: 0.9em; }

/* ── PAGE NAV FOOTER ── */
.page-footer-nav {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); padding-top: 2rem; margin-top: 2rem;
}
.page-footer-nav a {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-2); text-decoration: none;
  padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 7px; transition: all 0.15s;
}
.page-footer-nav a:hover { background: var(--paper-2); border-color: var(--red); color: var(--red); }

/* ── PROGRESS BAR ── */
.prog-dots { display: flex; gap: 6px; justify-content: center; margin: 1rem 0; }
.prog-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper-3); transition: background 0.2s;
}
.prog-dot.done { background: var(--teal); }
.prog-dot.active { background: var(--red); width: 20px; border-radius: 4px; }

/* ── AUDIO BUTTON ── */
.audio-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gold-light); color: var(--gold);
  border: 1px solid rgba(176,125,30,0.3); border-radius: 20px;
  padding: 3px 12px; font-size: 12px; cursor: pointer;
  transition: all 0.15s; font-family: var(--sans);
}
.audio-btn:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ── NOTE BOX ── */
.note-box {
  border-left: 3px solid var(--gold); background: var(--gold-light);
  border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; font-size: 14px;
  color: var(--ink-2); line-height: 1.8;
}
.tip-box {
  border-left: 3px solid var(--teal); background: var(--teal-light);
  border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; font-size: 14px;
  color: var(--ink-2); line-height: 1.8;
}

/* animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease both; }

@media (max-width: 720px) {
  .topnav { padding: 0 0.75rem; }
  .nav-logo { margin-right: 0.75rem; }
  .nav-logo img { width: 112px; height: 42px; }
  .nav-links { justify-content: flex-start; }
  .nav-links a { font-size: 13px; padding: 6px 10px; }
}


/* ── Audio button ── */
.audio-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid var(--border);
  border-radius: 50%; background: var(--gold-light); color: var(--gold);
  cursor: pointer; font-size: 12px; transition: all 0.15s;
  vertical-align: middle; margin-left: 6px; flex-shrink: 0;
}
.audio-mini:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ── Audio in prose sentences ── */
.prose-audio-row { display: flex; align-items: flex-start; gap: 8px; }
.prose-audio-row .prose-content { flex: 1; }


/* ── Lesson switcher ── */
.lesson-switcher {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  white-space: nowrap;
}
.lesson-switcher a {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  transition: all 0.15s;
}
.lesson-switcher a:hover { background: var(--red-light); color: var(--red); }
.lesson-switcher a.active { background: var(--red); color: #fff; }

