@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #1d2925;
  --muted: #71807a;
  --faint: #a4afa9;
  --line: #e1e7e3;
  --canvas: #f4f6f4;
  --surface: #ffffff;
  --soft: #edf2ee;
  --accent: #ed6a4c;
  --accent-deep: #d85237;
  --accent-soft: #fff0ea;
  --shadow: 0 20px 60px rgba(29, 41, 37, 0.07);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --english-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100dvh; }

.topbar {
  height: 76px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  transform: rotate(-6deg);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.topbar-actions { display: flex; align-items: center; gap: 13px; }
.streak-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  font-size: 12px;
}
.streak-chip b { color: var(--ink); font-size: 13px; }
.streak-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.avatar-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease;
}
.avatar-button:hover { border-color: var(--accent); transform: translateY(-1px); }

.main-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 32px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
  gap: 72px;
}

.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
  max-width: 570px;
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 4vw, 3.65rem);
  font-family: var(--english-font);
  font-stretch: normal;
  font-weight: 600;
  line-height: .98;
}
h2 { margin-bottom: 0; font-size: 20px; }
.intro-copy { margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.goal-count { display: flex; align-items: baseline; white-space: nowrap; color: var(--faint); }
.goal-count strong { color: var(--ink); font-size: 34px; }
.goal-count span { margin-left: 4px; font-size: 14px; }

.progress-track { height: 5px; margin: 32px 0 18px; overflow: hidden; border-radius: 999px; background: #e5ebe7; }
.progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 420ms cubic-bezier(.22, 1, .36, 1); }

.lesson-card {
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(216, 225, 219, .8);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: card-in 500ms cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.lesson-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.lesson-meta span:first-child { color: var(--ink); font-weight: 700; }
.meta-divider { width: 22px; height: 1px; background: var(--line); }
.lesson-copy { padding: 58px 0 44px; }
.english-line {
  max-width: 650px;
  margin-bottom: 22px;
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-family: var(--english-font);
  font-stretch: normal;
  font-weight: 500;
  line-height: 1.02;
}
.translation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 7px;
  color: var(--muted);
  border: 0;
  border-bottom: 1px dashed #b4c0b9;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
}
.translation-toggle:hover { color: var(--ink); border-color: var(--accent); }
.translation-toggle.is-hidden #translation-line { color: transparent; user-select: none; }
.translation-toggle.is-hidden #translation-line::after { content: "点击显示中文"; color: var(--faint); }
.toggle-label { color: var(--accent-deep); font-size: 11px; font-weight: 700; white-space: nowrap; }
.lesson-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.audio-button, .text-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
}
.audio-button { padding: 9px 12px 9px 0; color: var(--accent-deep); font-size: 13px; font-weight: 700; }
.audio-icon { display: block; width: 32px; height: 32px; flex: 0 0 32px; color: var(--accent); transition: transform 180ms ease; }
.audio-button:hover .audio-icon { transform: scale(1.07); }
.lesson-note { color: var(--faint); font-size: 12px; }
.response-block { margin-top: 26px; padding: 17px 19px; border-left: 3px solid var(--accent); background: var(--soft); }
.response-label { color: var(--muted); font-size: 10px; font-weight: 800; }
.response-block p { margin: 9px 0 0; color: var(--ink); font-size: 13px; line-height: 1.6; }
.response-block p span { color: var(--muted); }
.rating-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 36px; }
.rating-button {
  min-height: 62px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.rating-button span, .rating-button small { display: block; }
.rating-button span { color: var(--ink); font-size: 13px; font-weight: 700; }
.rating-button small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.rating-button:hover { transform: translateY(-2px); }
.rating-no:hover { border-color: #d8aaa0; background: #fff8f5; }
.rating-maybe:hover { border-color: #c0cbc4; background: #f8faf8; }
.rating-yes { border-color: var(--accent); background: var(--accent); }
.rating-yes span, .rating-yes small { color: #fff; }
.rating-yes:hover { background: var(--accent-deep); }
.rating-button:active { transform: translateY(0) scale(.985); }
.next-hint { display: flex; align-items: center; gap: 9px; min-height: 46px; color: var(--muted); font-size: 12px; }
.hint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.next-hint.is-complete { color: var(--accent-deep); }
.next-hint-text { flex: 1; }
.restart-button { padding: 0; color: var(--muted); border: 0; background: transparent; font-size: 12px; }
.restart-button:hover { color: var(--accent-deep); }

.side-column { display: flex; flex-direction: column; gap: 16px; padding-top: 88px; }
.rhythm-card, .scene-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.62); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.compact-heading { align-items: center; }
.card-copy { margin: 22px 0 25px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.ring { display: grid; width: 47px; height: 47px; place-items: center; border: 5px solid #f6c7b9; border-right-color: var(--accent); border-radius: 50%; color: var(--accent-deep); font-size: 12px; font-weight: 800; transform: rotate(-38deg); }
.ring span { transform: rotate(38deg); }
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--faint); font-size: 10px; }
.week-day i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.week-day.is-done i { background: var(--ink); }
.week-day.is-today { color: var(--accent-deep); font-weight: 800; }
.week-day.is-today i { width: 10px; height: 10px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.text-button { padding: 2px 0; color: var(--accent-deep); font-size: 12px; font-weight: 700; }
.scene-list { margin-top: 22px; }
.scene-row { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 13px 0; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; }
.scene-row:first-child { border-top: 0; }
.scene-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--muted); background: var(--soft); font-size: 10px; font-weight: 800; }
.scene-name b, .scene-name small { display: block; }
.scene-name b { color: var(--ink); font-size: 12px; }
.scene-name small { margin-top: 4px; color: var(--faint); font-size: 11px; }
.scene-percent { color: var(--muted); font-size: 11px; }
.scene-row:hover .scene-icon, .scene-row.is-active .scene-icon { color: #fff; background: var(--accent); }
.quote-card { position: relative; min-height: 144px; padding: 24px; overflow: hidden; border-radius: var(--radius-md); color: #fff; background: var(--ink); }
.quote-mark { position: absolute; top: 3px; right: 20px; color: rgba(255,255,255,.14); font-family: Georgia, serif; font-size: 88px; line-height: 1; }
.quote-card p { position: relative; max-width: 200px; margin: 8px 0 17px; font-family: var(--english-font); font-size: 18px; font-weight: 500; line-height: 1.2; }
.quote-caption { position: relative; color: rgba(255,255,255,.55); font-size: 11px; }

.bottom-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 260px; padding: 12px 15px; color: #fff; border-radius: 12px; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 850px) {
  .main-content { grid-template-columns: 1fr; gap: 18px; padding-top: 26px; }
  .side-column { padding-top: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .quote-card { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar { height: 68px; padding: 0 18px; }
  .streak-chip { padding: 8px 9px; }
  .streak-chip span:last-child { display: none; }
  .main-content { padding: 27px 18px 84px; }
  .section-intro { align-items: start; }
  h1 { font-size: clamp(2.1rem, 12vw, 3.2rem); }
  .intro-copy { font-size: 14px; }
  .goal-count { padding-top: 19px; }
  .lesson-card { padding: 23px 19px 19px; border-radius: 20px; }
  .lesson-copy { padding: 43px 0 33px; }
  .english-line { font-size: clamp(2rem, 10vw, 3rem); }
  .translation-toggle { font-size: 14px; }
  .lesson-tools { align-items: start; flex-direction: column; gap: 4px; }
  .rating-actions { gap: 6px; margin-top: 30px; }
  .rating-button { min-height: 66px; padding: 10px 9px; }
  .rating-button span { font-size: 12px; }
  .rating-button small { font-size: 10px; }
  .side-column { display: flex; }
  .rhythm-card, .scene-card { padding: 20px; }
  .bottom-nav { position: fixed; right: 14px; bottom: 12px; left: 14px; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; border: 1px solid rgba(216,225,219,.85); border-radius: 17px; background: rgba(255,255,255,.86); box-shadow: 0 14px 34px rgba(29,41,37,.12); backdrop-filter: blur(14px); }
  .nav-item { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 5px; color: var(--muted); border-radius: 11px; font-size: 11px; }
  .nav-item.is-active { color: var(--ink); background: var(--soft); font-weight: 700; }
  .nav-icon { color: var(--faint); font-size: 9px; font-weight: 800; }
  .nav-item.is-active .nav-icon { color: var(--accent); }
}

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