/* Spoken English Tutorial — coral + bubble + mic style */
:root {
  --ink: #1f1714;
  --ink-soft: #4a3a34;
  --muted: #8c7972;
  --paper: #fdf7f3;
  --paper-2: #f8ece4;
  --surface: #ffffff;
  --line: #efddd2;
  --line-strong: #e2c6b6;
  --coral: #b65d4f;
  --coral-dark: #8a3f33;
  --coral-soft: #d98876;
  --sky: #426a91;
  --sand: #c08a3d;
  --leaf: #5a8b5a;
  --code-bg: #2a1a14;
  --code-text: #fdf2ea;
  --mono: 'SF Mono', 'Fira Code', Consolas, monospace;
  --display: 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Iowan Old Style', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(182,93,79,.08), transparent 50%),
    radial-gradient(circle at 90% 5%, rgba(66,106,145,.06), transparent 45%),
    var(--paper);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 54px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(253,247,243,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-back { color: var(--coral-dark); text-decoration: none; font-size: .88rem; font-weight: 700; }
.nav-back::before { content: '‹'; margin-right: 4px; font-size: 1.2rem; }
.nav-title { flex: 1; min-width: 0; color: var(--ink-soft); font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { color: #fff; background: var(--coral); border-radius: 999px; padding: 3px 10px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; }

.hero {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(138,63,51,.96), rgba(182,93,79,.92) 60%, rgba(66,106,145,.88)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 1px, transparent 1px 64px);
  padding: 74px 24px 58px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute; right: -80px; bottom: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.18), transparent 70%);
  pointer-events: none;
}
.hero-grid { max-width: 1060px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); gap: 34px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow, .section-label, .ch-num, .nav-dir { font-family: var(--mono); text-transform: uppercase; letter-spacing: .16em; }
.hero-eyebrow { color: #f6c8b3; font-size: .72rem; margin-bottom: 12px; }
.hero h1 { font-family: var(--display); font-size: clamp(2.35rem, 6vw, 4.5rem); line-height: 1.04; margin: 0 0 18px; font-weight: 800; letter-spacing: 0; }
.hero-sub { max-width: 620px; margin: 0 0 24px; color: rgba(255,255,255,.78); font-size: 1rem; line-height: 1.85; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); border-radius: 999px; padding: 5px 12px; font-size: .76rem; color: rgba(255,255,255,.86); }

/* Bubble board: 对话气泡 + 麦克风 */
.bubble-board { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); border-radius: var(--radius); padding: 22px; box-shadow: 0 22px 70px rgba(0,0,0,.22); }
.bubble { position: relative; padding: 12px 16px; border-radius: 14px; font-family: var(--mono); font-size: .82rem; max-width: 88%; margin-bottom: 12px; line-height: 1.5; }
.bubble.left { background: rgba(255,255,255,.92); color: #2a1a14; border-bottom-left-radius: 4px; }
.bubble.right { background: #f6c8b3; color: #5a2519; margin-left: auto; border-bottom-right-radius: 4px; text-align: right; }
.bubble small { display: block; font-size: .68rem; color: rgba(0,0,0,.42); margin-top: 4px; font-family: var(--sans); }
.bubble.right small { color: rgba(0,0,0,.5); }
.mic-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,.22); }
.mic-icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 0 0 0 rgba(255,255,255,.35); animation: pulse 1.8s infinite; }
.mic-icon svg { width: 18px; height: 18px; fill: #fff; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }
  70% { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.wave { display: flex; gap: 3px; align-items: center; height: 22px; }
.wave span { display: inline-block; width: 3px; background: rgba(255,255,255,.85); border-radius: 2px; animation: wave 1.1s ease-in-out infinite; }
.wave span:nth-child(1) { height: 30%; animation-delay: -1.0s; }
.wave span:nth-child(2) { height: 70%; animation-delay: -.8s; }
.wave span:nth-child(3) { height: 50%; animation-delay: -.6s; }
.wave span:nth-child(4) { height: 90%; animation-delay: -.4s; }
.wave span:nth-child(5) { height: 40%; animation-delay: -.2s; }
.wave span:nth-child(6) { height: 65%; }
@keyframes wave {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1.0); }
}
.mic-label { font-family: var(--mono); font-size: .72rem; color: rgba(255,255,255,.72); letter-spacing: .08em; }

.container, .content { width: 100%; max-width: 900px; margin: 0 auto; padding: 38px 24px 84px; }
.content { max-width: 820px; }
.content > * { max-width: 100%; }
.section-label { color: var(--muted); font-size: .68rem; font-weight: 900; margin: 32px 0 10px 2px; }
.card, .feature, .chapter-nav a { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 28px rgba(138,63,51,.06); }
.card { padding: 22px; margin-bottom: 16px; }
.intro-card p:last-child, .prose p:last-child { margin-bottom: 0; }
p { color: var(--ink-soft); margin: 0 0 15px; font-size: .95rem; }
.content p, .content li, .chapter-hero p { overflow-wrap: anywhere; word-break: break-all; }
.prose h2 { margin: 0 0 12px; font-size: 1.18rem; color: var(--coral-dark); }
.prose ol { margin-bottom: 0; }
strong { color: var(--ink); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.feature { padding: 18px; }
.feature span { font-family: var(--mono); color: var(--coral); font-weight: 900; font-size: .72rem; }
.feature h3 { margin: 7px 0 6px; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }

.list-card { padding: 0; overflow: hidden; }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-list li { border-bottom: 1px solid var(--line); }
.card-list li:last-child { border-bottom: 0; }
.card-list a { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; color: inherit; text-decoration: none; transition: background .16s, transform .16s; }
.card-list a:hover { background: var(--paper-2); }
.list-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--coral); color: #fff; font-family: var(--mono); font-size: .72rem; font-weight: 900; }
.list-content { flex: 1; min-width: 0; }
.list-title { color: var(--ink); font-weight: 800; font-size: .96rem; margin-bottom: 2px; }
.list-desc { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.list-chevron { color: var(--line-strong); font-size: 1.2rem; align-self: center; }

.chapter-hero { background: linear-gradient(135deg, var(--coral-dark), var(--coral) 65%, var(--sky)); color: #fff; text-align: center; padding: 54px 24px 46px; overflow: hidden; position: relative; }
.chapter-hero::after {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,.14), transparent 70%);
  pointer-events: none;
}
.chapter-hero .ch-num { color: rgba(255,255,255,.78); font-size: .68rem; margin-bottom: 10px; position: relative; z-index: 1; }
.chapter-hero h1 { font-family: var(--display); font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.12; margin: 0 auto 12px; letter-spacing: 0; max-width: 760px; overflow-wrap: anywhere; position: relative; z-index: 1; }
.chapter-hero h1 br { display: none; }
.chapter-hero p { color: rgba(255,255,255,.82); max-width: 620px; margin: 0 auto; overflow-wrap: anywhere; position: relative; z-index: 1; }
.progress { height: 5px; background: var(--line); border-radius: 99px; margin-bottom: 34px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--coral), var(--sand), var(--sky)); border-radius: inherit; }

.content h2 { font-family: var(--display); color: var(--ink); font-size: 1.52rem; line-height: 1.28; margin: 42px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--line); letter-spacing: 0; }
.content h2:first-child { margin-top: 0; }
.content h3 { color: var(--coral-dark); font-size: 1.08rem; margin: 28px 0 10px; }
.content h4 { color: var(--sand); font-size: .76rem; margin: 22px 0 8px; letter-spacing: .08em; text-transform: uppercase; }
.content ul, .content ol { color: var(--ink-soft); padding-left: 24px; margin: 10px 0 16px; font-size: .93rem; }
.content li { margin: 4px 0; }

pre { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 17px 18px; overflow-x: auto; font-size: .88rem; line-height: 1.72; margin: 16px 0; border: 1px solid rgba(255,255,255,.06); white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: var(--mono); }
p code, li code, td code { background: var(--paper-2); color: var(--coral-dark); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 5px; font-size: .86em; }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
th { background: var(--paper-2); color: var(--coral-dark); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line-strong); }
td { color: var(--ink-soft); padding: 11px 13px; border-top: 1px solid var(--line); vertical-align: top; }
tr:first-child td { border-top: 0; }
td b { color: var(--ink); }

.callout { margin: 18px 0; padding: 15px 16px; border-radius: var(--radius); background: #fdeee6; border-left: 4px solid var(--coral); }
.callout-mark { display: block; color: var(--coral-dark); font-size: .76rem; font-weight: 900; margin-bottom: 4px; letter-spacing: .08em; }
.callout p { margin: 0; }
.callout.info { background: #eaf1f8; border-left-color: var(--sky); }
.callout.info .callout-mark { color: var(--sky); }
.callout.tip { background: #eef5ec; border-left-color: var(--leaf); }
.callout.tip .callout-mark { color: var(--leaf); }
.callout.warning { background: #fbf2dc; border-left-color: var(--sand); }
.callout.warning .callout-mark { color: var(--sand); }
.callout.danger { background: #fde6e0; border-left-color: var(--coral-dark); }
.callout.danger .callout-mark { color: var(--coral-dark); }

/* Inline dialog styling for chapter content */
.dialog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.dialog .line { display: flex; gap: 10px; margin: 6px 0; font-size: .92rem; }
.dialog .line .who { flex: 0 0 60px; color: var(--muted); font-family: var(--mono); font-size: .76rem; padding-top: 2px; }
.dialog .line .text { flex: 1; color: var(--ink-soft); }
.dialog .line .text b { color: var(--coral-dark); }

.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.chapter-nav a { display: flex; flex-direction: column; padding: 14px; text-decoration: none; color: inherit; min-height: 80px; justify-content: center; }
.chapter-nav a:hover { border-color: var(--coral); background: #fff; }
.next { text-align: right; }
.nav-dir { color: var(--muted); font-size: .66rem; font-weight: 900; }
.nav-title-text { color: var(--coral-dark); font-weight: 800; font-size: .88rem; line-height: 1.45; }
.site-footer { border-top: 1px solid var(--line); background: rgba(248,236,228,.7); padding: 28px 24px; text-align: center; color: var(--muted); font-size: .82rem; }
.site-footer a { color: var(--coral-dark); text-decoration: none; font-weight: 700; }

@media (max-width: 760px) {
  .nav { padding: 0 16px; gap: 10px; }
  .nav-badge { display: none; }
  .hero { padding: 54px 18px 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .bubble-board { padding: 16px; }
  .container, .content { padding-left: 18px; padding-right: 18px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .chapter-nav { grid-template-columns: 1fr; }
  .next { text-align: left; }
  .chapter-hero h1 { font-size: 1.72rem; word-break: break-all; }
  .chapter-hero h1 br { display: block; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .card-list a { padding: 14px; }
  .list-num { width: 30px; height: 30px; }
  .dialog .line { flex-direction: column; gap: 2px; }
  .dialog .line .who { padding-top: 0; }
}
