:root {
  color-scheme: light;
  --ink: #1d2a3d;
  --ink-soft: #46566d;
  --muted: #73839a;
  --line: #e7ebf2;
  --line-strong: #d5dce8;
  --blue: #2f63d9;
  --blue-strong: #1f4dbb;
  --soft: #edf3ff;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --shadow-sm: 0 1px 2px rgba(23, 37, 66, .06), 0 4px 14px rgba(23, 37, 66, .05);
  --shadow-md: 0 10px 32px rgba(23, 37, 66, .09);
  --accent: #ff6a1a;
  --accent-strong: #e2540a;
  --accent-soft: #fff3ea;
  --accent-line: #ffd3b8;
  --radius: 16px;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background:
  radial-gradient(900px 360px at 50% -200px, #fff1e6 0%, rgba(255, 241, 230, 0) 70%),
  var(--canvas); }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: progress; }
a { color: var(--blue); text-decoration: none; }
:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }
img { max-width: 100%; }

/* ---------------- 顶栏 ---------------- */
.site-header { position: sticky; top: 0; z-index: 30; isolation: isolate; background: #fff; border-bottom: 1px solid var(--line); }
.site-inner, main { width: min(100% - 40px, 1200px); margin-inline: auto; }
main[data-view="lesson"] { width: min(100% - 40px, 880px); }
.site-inner { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 820; letter-spacing: -.04em; color: var(--ink); }
.brand::before { content: ""; width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(150deg, #ff8a3d, var(--accent) 55%, #e8500a); box-shadow: inset 0 0 0 5px #fff, 0 2px 8px rgba(255, 106, 26, .28); }
.site-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.learner-identity { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 320px; padding: 5px 11px; border-radius: 999px; background: #f1f4f9; color: var(--muted); font-size: 13px; white-space: nowrap; }
.identity-phone { flex: none; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.identity-libs { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.site-actions > .text-button { flex: none; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--blue); font-size: 14px; font-weight: 600; }
.text-button:hover { background: var(--soft); }
.text-button.active { background: var(--soft); color: var(--blue-strong); }

/* ---------------- 素材库 ---------------- */
main { padding: 34px 0 88px; }
h1 { margin: 10px 0; font-size: clamp(28px, 4.2vw, 38px); letter-spacing: -.035em; line-height: 1.28; }
h1:focus { outline: none; }
.course-title { margin-bottom: 22px; }
[data-view="catalog"] .course-title { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; min-height: 148px; margin-bottom: 26px; padding: 28px 34px; border-radius: 20px; border: 1px solid #efe8e1; background: #fff; box-shadow: var(--shadow-sm); }
/* 身份标记：几条高低错落的声波，从暖橙渐变到纸色，不带彩虹。 */
[data-view="catalog"] .course-title::after { content: ""; position: absolute; right: 34px; top: 50%; width: 168px; height: 92px; transform: translateY(-50%); pointer-events: none; opacity: .9;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 18px);
  -webkit-mask: radial-gradient(120px 60px at 50% 50%, #000 40%, transparent 78%);
  mask: radial-gradient(120px 60px at 50% 50%, #000 40%, transparent 78%); }
[data-view="catalog"] .course-title > * { position: relative; z-index: 1; }
[data-view="catalog"] .course-title h1 { margin: 0; }
.catalog-summary { max-width: 620px; margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.catalog-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.catalog-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #ece5dd; background: #fbf8f4; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.catalog-stats b { color: var(--ink); font-weight: 760; font-variant-numeric: tabular-nums; }
/* 概览里的数字是量，不是内容：数字在前、标签在后，读起来像一行结论。 */
.catalog-stats span { flex-direction: row-reverse; }
.catalog-stats b { color: var(--accent-strong); }
.course-title p { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.8; }
h2 { margin: 0 0 8px; font-size: clamp(20px, 3.2vw, 24px); letter-spacing: -.025em; line-height: 1.3; }
.section-hint { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.section-hint span { white-space: nowrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 14px; font-weight: 600; transition: .15s; }
.filters button[aria-pressed="true"] { border-color: transparent; background: var(--ink); color: #fff; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row label { min-width: 0; }
.filter-row .search-field { flex: 1 1 260px; }
.filter-row input, .filter-row select { width: 100%; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; box-shadow: var(--shadow-sm); }
.filter-row .search-field input { padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2373839a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='m12.5 12.5 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.filter-row select { min-width: 120px; max-width: 180px; }
.result-count { margin: 12px 0 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.catalog-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.catalog-heading { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.catalog-sort { padding: 6px 13px; border-radius: 999px; border: 1px solid #ece4da; background: #fff; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.catalog-greeting { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; list-style: none; padding: 0; margin: 0; }
.lessons li > a { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; border-radius: 16px; background: var(--paper); border: 1px solid #efe8e0; box-shadow: 0 1px 2px rgba(23, 37, 66, .04); transition: transform .18s ease, box-shadow .18s ease; }
.lessons li > a:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(23, 37, 66, .10); }
.lessons li > a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #fdeadd, #f6dccb); overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.lessons li > a:hover .card-cover img { transform: scale(1.03); }
.card-lang { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(17, 24, 39, .62); color: #fff; font-size: 12px; font-weight: 650; backdrop-filter: blur(4px); }
.card-duration { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 7px; background: rgba(16, 24, 40, .78); color: #fff; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.card-info { display: flex; flex-direction: column; gap: 9px; padding: 15px 16px 16px; flex: 1; }
.card-info h2 { margin: 0; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.42; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.card-info .card-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.card-byline { margin: 0; font-size: 13px; color: var(--muted); }
.card-labels { display: flex; gap: 6px; flex-wrap: wrap; }
.card-labels .chip { padding: 2px 9px; font-size: 12px; font-weight: 600; }
.card-labels .chip.difficulty-chip { background: #ecf7f1; color: #1c7a4f; border-color: #d5ecdf; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; border-top: 1px solid #f3ece4; }
.card-stars { display: inline-flex; gap: 2px; }
.card-stars i { width: 12px; height: 12px; background: #e6ddcf; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.card-stars i.on { background: var(--accent); }
.card-foot-note { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- 课程页 ---------------- */
.back-link { margin-bottom: 6px; padding-left: 0; }
/* 课程页头部：一行元信息 + 一行署名，简介默认收起，把屏幕留给学习内容。 */
main[data-view="lesson"] .course-title { margin-bottom: 18px; }
main[data-view="lesson"] h1 { margin: 4px 0 10px; font-size: clamp(24px, 3vw, 30px); }
.lesson-info { margin-top: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.lesson-metadata { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.metadata-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; }
.metadata-item + .metadata-item::before { content: ""; width: 3px; height: 3px; margin: 0 10px; border-radius: 50%; background: #c8ccd4; align-self: center; }
.lesson-metadata dt { margin: 0; color: var(--muted); font-size: 12.5px; }
.lesson-metadata dd { margin: 0; overflow-wrap: anywhere; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.lesson-attribution { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.source-row { margin-top: 10px; padding-top: 0; border-top: 0; }
.lesson-info .source-line { font-size: 13px; }
.lesson-info .source-label { color: var(--muted); }
.lesson-info .source-url { font-size: 13px; color: var(--ink-soft); }
.summary-toggle { margin-top: 2px; padding: 0 0; min-height: 30px; color: var(--ink-soft); font-size: 13px; text-decoration: underline; text-decoration-color: #cdd6e6; text-underline-offset: 3px; }
.summary-toggle:hover { background: transparent; color: var(--ink); }
.course-summary { display: none; margin: 6px 0 0; max-width: 640px; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }
.course-summary.is-open { display: block; }
.source-line { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; font-size: 14px; }
.source-label { flex: none; color: var(--muted); }
.source-url { min-width: 0; color: var(--ink-soft); font-size: 13.5px; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: #cdd6e6; text-underline-offset: 3px; }
.source-url:hover { color: var(--ink); text-decoration-color: currentColor; }
.metadata-note { font-size: 13px; color: var(--muted); }

.lesson-nav { position: sticky; top: 62px; z-index: 9; display: flex; gap: 4px; overflow-x: auto; margin: 22px 0 24px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); scrollbar-width: none; }
.lesson-nav::-webkit-scrollbar { display: none; }
.lesson-nav button { flex: none; white-space: nowrap; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.lesson-nav button:hover { background: var(--soft); color: var(--blue); }
.lesson-section { scroll-margin-top: 128px; }
.lesson-section + .lesson-section { margin-top: 46px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }

/* 播放器 */
.paper, .transport, .player, #notice { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
#notice { padding: 10px 14px; font-size: 14px; }
.player { overflow: hidden; }
.stage { position: relative; display: grid; width: 100%; place-items: center; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 40%, #25324a, #10182a); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.audio-face { position: absolute; top: 32%; }
.audio-bars { display: flex; align-items: flex-end; gap: 5px; height: 46px; }
.audio-bars i { width: 7px; height: 16px; border-radius: 4px; background: linear-gradient(#9dbdff, #5b8bf2); animation: bar 1.1s ease-in-out infinite; }
.audio-bars i:nth-child(2) { height: 28px; animation-delay: .15s; }
.audio-bars i:nth-child(3) { height: 44px; animation-delay: .3s; }
.audio-bars i:nth-child(4) { height: 24px; animation-delay: .45s; }
.audio-bars i:nth-child(5) { height: 34px; animation-delay: .6s; }
@keyframes bar { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1); } }
.play { position: relative; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; color: #fff; background: var(--ink); font-weight: 750; letter-spacing: .01em; box-shadow: 0 8px 22px rgba(16, 24, 40, .28); }
.play:hover { background: #0f1a2b; }
.play[hidden] { display: none; }
.play-icon { margin-right: 8px; font-size: 13px; }
.stage:not([data-mode="audio"]) .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); backdrop-filter: blur(2px); }

/* 「看无字幕视频」控制条：点画面/悬停时淡入，播放中自动淡出 */
.stage { cursor: pointer; }
.video-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px;
  background: linear-gradient(transparent, rgba(9, 15, 27, .82)); opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.stage.controls-on .video-controls { opacity: 1; transform: none; pointer-events: auto; }
.video-toggle { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, .16); font-size: 13px; line-height: 1; }
.video-toggle:hover { background: rgba(255, 255, 255, .28); }
.video-toggle.small { font-size: 15px; }
.video-controls input[type="range"] { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--played, 0%), rgba(255, 255, 255, .28) var(--played, 0%)); }
.video-controls input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.video-controls input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.video-toggle:focus-visible, .video-controls input[type="range"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.video-time { flex: none; color: rgba(255, 255, 255, .88); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 560px) { .video-controls { gap: 8px; padding: 8px 10px 10px; } .video-toggle { width: 30px; height: 30px; } .video-time { display: none; } }
.modes { display: flex; gap: 4px; align-items: center; padding: 6px 10px; }
.modes button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.modes button[aria-pressed="true"] { background: var(--soft); color: var(--blue-strong); font-weight: 750; }
.media-error { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 12px 12px; padding: 10px 12px; border-radius: 10px; background: #fff4ea; color: #7a3a06; font-size: 14px; }
.transport { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 14px; }
.round-play { display: grid; place-items: center; width: 44px; min-height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: 15px; }
#seek { min-width: 12px; flex: 1; margin: 0; height: 34px; accent-color: var(--blue); }
.time { white-space: nowrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.speed select { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 13px; font-weight: 650; }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

/* ---------------- 听写填空 ---------------- */
.score { margin: 0 0 4px; white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: #f1f4f9; font-size: 13px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; position: relative; overflow: hidden; }
.score::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--progress, 0%); background: linear-gradient(90deg, #dcebff, #cfe2ff); transition: width .4s ease; }
.score[data-done="true"] { color: #125c3c; background: #e3f6ec; }
.score[data-done="true"]::before { width: 100%; background: linear-gradient(90deg, #c9efd9, #b6e8cb); }
.practice-paper { overflow: hidden; }
.passage { padding: 22px 28px 26px; }
.passage-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.passage-head .time { padding: 2px 9px; border-radius: 7px; background: #eef2f8; color: var(--ink-soft); font-weight: 650; }
.passage-len { font-size: 12.5px; color: var(--muted); }
.passage-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.replay, .check { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 40px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: var(--soft); color: var(--blue-strong); font-size: 13.5px; font-weight: 700; transition: .15s; }
.replay:hover { background: #dce8ff; }
.replay[data-playing="true"] { background: var(--blue); color: #fff; }
.check { background: var(--ink); color: #fff; }
.check:hover { background: #0f1a2b; }
.check.busy { background: var(--ink-soft); }
.practice-original {
  margin: 6px 0 0;
  font-size: 20.5px;
  font-weight: 620;
  line-height: 2.05;
  letter-spacing: .002em;
  overflow-wrap: anywhere;
  color: #13203a;
}
.practice-translation {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 17px;
  line-height: 2;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
/* 空位的定位盒：inline-block 让便签可以相对它绝对定位。 */
.blank-wrap { position: relative; display: inline-block; max-width: 46%; vertical-align: baseline; }
.blank-wrap .blank { max-width: 100%; }
.practice-original .blank {
  width: calc(var(--blank-size, 8) * 1ch + 10px);
  min-width: 4.5em;
  max-width: min(46%, calc(var(--answer-size, 22) * 1.1ch + 12px));
  height: auto;
  margin: 0 3px;
  padding: 0 6px 1px;
  border: 0;
  border-bottom: 2px solid #7d8fb0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#f8faff, #f4f7ff);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  line-height: inherit;
  text-align: center;
  vertical-align: baseline;
  transition: border-color .15s, background .15s, color .15s;
}
.practice-original .blank::placeholder { color: transparent; }
/* 查看答案时松掉空格子的 min-width，让答案按自身长度撑开（受 46% 上限约束）。 */
.practice-original:has(.blank-wrap.answering) .blank-wrap.answering .blank { min-width: 0; }
.practice-original .blank:hover { border-bottom-color: #4f6fa8; }
.practice-original .blank:focus-visible { outline: 2px solid #7aa2ff; outline-offset: 1px; border-bottom-color: var(--blue); background: #f2f6ff; }
.practice-original .blank[data-status="correct"] { border-bottom-color: #1f9d63; background: #e9f9f0; color: #11643f; }
.practice-original .blank[data-status="wrong"] { border-bottom-color: #e2723c; background: #fff3ec; color: #a43f17; }
.zh-mark { font-weight: 750; color: var(--mark-color, #c2185b); }
.feedback { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 14px; border-radius: 11px; font-size: 14px; background: #f4f6fa; color: var(--ink-soft); }
.feedback[data-kind="retry"] { background: #fff5ef; color: #8b3c13; }
.feedback[data-kind="done"] { background: #e9f9f0; color: #11643f; font-weight: 650; }
.practice-reference { display: none; }
/* 查看答案：白色便签浮在空白正上方，原文整体压暗，答案成为视觉焦点。 */
/* 查看答案：答案以半透明底色直接落在原来的空上，原文其余部分轻微压暗。 */
.practice-original:has(.blank-wrap.answering) { color: rgba(19, 32, 58, .58); }
.practice-original:has(.blank-wrap.answering) .blank-wrap.answering { color: var(--ink); }
.practice-original:has(.blank-wrap.answering) .blank-wrap.answering .blank {
  color: var(--ink); font-weight: 760;
  letter-spacing: -.01em;
  border-bottom-color: transparent;
  background: rgba(255, 106, 26, .14);
  box-shadow: inset 0 0 0 1px rgba(226, 84, 10, .16);
  animation: answer-in .18s ease-out;
}
@keyframes answer-in { from { opacity: .2; } to { opacity: 1; } }

/* 发音与图标按钮 */
.speak { display: inline-grid; place-items: center; flex: none; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-soft); font-size: 14px; font-weight: 650; transition: .15s; }
.speak:hover { border-color: #c5d4f4; background: var(--soft); color: var(--blue); }
.speak[data-playing="true"] { border-color: #b6cdfa; background: #e4edff; color: var(--blue-strong); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(59, 118, 246, .12); } }

/* ---------------- 中英对照 ---------------- */
.reading-controls { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); }
.reading-controls button { min-height: 34px; padding: 0 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 650; }
.reading-controls button[aria-pressed="true"] { color: #fff; background: var(--ink); }
.reading-controls button:active { transform: scale(.97); }
.reading-paper { padding: 30px 34px; }
.bilingual-pair + .bilingual-pair { margin-top: 26px; }
/* 逐句成对：每句英文下紧跟对应中文，读完一句就能核对一句。 */
.sentence-pair + .sentence-pair { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.sentence-pair .article-translation { margin-top: 6px; }
.hide-original .sentence-pair + .sentence-pair, .hide-translation .sentence-pair + .sentence-pair { margin-top: 10px; padding-top: 10px; }
.article-original { margin: 0; font-size: 19px; line-height: 1.85; overflow-wrap: anywhere; color: #13203a; }
.article-translation { margin: 8px 0 0; color: var(--ink-soft); font-size: 16.5px; line-height: 1.9; overflow-wrap: anywhere; }
.hide-original .article-original, .hide-translation .article-translation { display: none; }
.hide-original .article-translation { margin: 0; color: var(--ink); }
mark { background: linear-gradient(transparent 58%, #ffe38a 58%); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------------- 重点词汇 ---------------- */
/* 卡片最小宽度 340px：手机上一列、平板两列，不需要单独的断点。 */
.expression-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.expression { position: relative; overflow: hidden; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.expression::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; opacity: .85; background: var(--accent, var(--blue)); }
.expression-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.expression h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.phonetic { font-size: 13.5px; color: var(--muted); font-family: "Noto Sans IPA", "Lucida Sans Unicode", system-ui, sans-serif; }
.pos { padding: 1px 7px; border-radius: 6px; background: #eef1f7; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.expression-tools { display: flex; gap: 5px; margin-left: auto; }
.word-speak { min-height: 30px; padding: 0 11px; border-radius: 999px; background: #f6f8fc; border-color: var(--line); color: var(--blue-strong); font-size: 12.5px; }
.word-speak:hover { background: var(--soft); border-color: #cfdcf6; }
.word-speak[data-playing="true"] { background: var(--blue); border-color: var(--blue); color: #fff; animation: none; box-shadow: 0 0 0 4px rgba(47, 99, 217, .12); }
.expression-meaning { margin: 6px 0 0; font-size: 14.5px; font-weight: 650; color: var(--ink-soft); }
.expression-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 13.5px; }
.expression-meta dt { color: var(--muted); white-space: nowrap; }
.expression-meta dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.expression-example { margin-top: 12px; padding: 10px 13px; border-radius: 11px; background: #f6f8fc; border-left: 3px solid #c4d3f4; }
.expression-example p { margin: 0; font-size: 14.5px; line-height: 1.7; }
.expression-translation { margin: 4px 0 0; color: var(--muted); }
.expression-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------- 口语跟练：沉浸式字幕跟读器 ---------------- */
.speak-card { --speak-accent: var(--accent); --speak-accent-weak: var(--accent-soft); --speak-accent-line: var(--accent-line); --speak-ink: #3d3730;
  position: relative; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #efe8e1; border-radius: 18px; background: #fbf9f6; box-shadow: var(--shadow-sm); }
.speak-stage { position: relative; isolation: isolate; width: 100%; min-width: 0; overflow: hidden; aspect-ratio: 16 / 10; background: radial-gradient(circle at 50% 35%, #2c3450, #141a2b 70%); }
.speak-stage.has-video { aspect-ratio: 16 / 9; background: #0e1626; }
.speak-stage video { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; background: #0e1626; cursor: pointer; }
.speak-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 44px 108px 42px; color: #fff; text-align: center; pointer-events: none; background: linear-gradient(to top, rgba(8, 12, 22, .82), rgba(8, 12, 22, .42) 48%, transparent); }
.speak-caption-en { margin: 0; font-size: clamp(17px, 1.75vw, 22px); font-weight: 720; line-height: 1.45; letter-spacing: -.005em; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); overflow-wrap: anywhere; text-wrap: pretty; }
.speak-caption-zh { margin: 6px 0 0; font-size: clamp(14px, 1.5vw, 16.5px); line-height: 1.6; color: rgba(255, 255, 255, .9); overflow-wrap: anywhere; }
.speak-caption mark { padding: 0 3px; border-radius: 5px; background: var(--speak-accent); color: #fff; text-decoration: none; }
.speak-caption[data-lang="original"] .speak-caption-zh, .speak-caption[data-lang="translation"] .speak-caption-en { display: none; }
.speak-caption[data-zh="off"] .speak-caption-zh { display: none; }
.speak-caption[data-lang="hidden"], .speak-caption[hidden] { display: none; }
.speak-caption[data-lang="translation"] .speak-caption-zh { margin: 0; font-size: clamp(17px, 1.9vw, 21px); font-weight: 700; color: #fff; }
.speak-counter { position: absolute; right: 14px; top: 14px; z-index: 3; padding: 5px 11px; border-radius: 999px; background: rgba(15, 20, 32, .68); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); pointer-events: none; }

/* 进度条与字幕同处画面底部：字幕留出 36px 下内边距给进度条，两者互不遮挡。 */
.speak-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; background: rgba(8, 12, 22, .5); backdrop-filter: blur(6px); }
.speak-progress-time { flex: none; color: rgba(255, 255, 255, .82); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
#speakSeek { flex: 1; min-width: 0; height: 18px; margin: 0; background: transparent; appearance: none; cursor: pointer; }
#speakSeek::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--speak-accent) var(--played, 0%), rgba(255, 255, 255, .34) var(--played, 0%)); }
#speakSeek::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .34); }
#speakSeek::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--speak-accent); }
#speakSeek::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .4); appearance: none; }
#speakSeek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
#speakSeek:focus-visible { outline: 2px solid #ffd2ae; outline-offset: 3px; border-radius: 999px; }

.speak-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f1ece6; background: #fff; }
.speak-langs { display: flex; flex: 1; gap: 2px; min-width: 0; padding: 3px; border-radius: 11px; background: #f4f1ec; }
.speak-card button { flex: none; }
.speak-langs button { flex: 0 1 auto; min-width: 0; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #8a8378; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, color .15s; }
.speak-langs button:hover { color: var(--ink); }
.speak-langs button[aria-pressed="true"] { background: #fff; color: var(--speak-accent); box-shadow: 0 1px 3px rgba(60, 40, 20, .12); }
.speak-speed { flex: none; display: flex; }
.speak-speed select { min-height: 38px; padding: 0 26px 0 12px; border: 1px solid #ece7e0; border-radius: 999px; background: #fff; color: var(--ink-soft); font: inherit; font-size: 13.5px; font-weight: 750; font-variant-numeric: tabular-nums; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23a9a399' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.speak-caption-toggle { min-height: 32px; padding: 0 11px; border: 1px solid #ece7e0; border-radius: 999px; background: #fff; color: #8a8378; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.speak-caption-toggle:hover { color: var(--speak-accent); border-color: var(--speak-accent-line); }
.speak-caption-toggle[aria-pressed="true"] { color: var(--speak-accent); border-color: var(--speak-accent-line); background: var(--speak-accent-weak); }
.speak-play { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--speak-accent); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.speak-play:hover { background: var(--speak-accent-strong); }
.speak-play:focus-visible { outline: 2px solid var(--speak-accent-strong); outline-offset: 2px; }
.speak-export { min-height: 36px; padding: 0 13px; border: 1px solid #ece7e0; border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 13.5px; font-weight: 650; }
.speak-export:hover { border-color: #d9d2c8; background: #fff; }

.speak-panel { position: relative; width: 100%; min-width: 0; overflow: hidden; background: #fbf9f6; }
.speak-back { position: absolute; top: 10px; right: 12px; z-index: 4; min-height: 32px; padding: 0 13px; border: 1px solid #e9e3db; border-radius: 999px; background: rgba(255, 255, 255, .96); color: var(--ink-soft); font-size: 12.5px; font-weight: 650; box-shadow: var(--shadow-sm); backdrop-filter: blur(4px); }
.speak-back:hover { border-color: var(--speak-accent-line); color: var(--speak-accent); }
.follow-lines { list-style: none; margin: 0; padding: 6px 0 10px; max-height: min(46vh, 440px); overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; scroll-behavior: smooth; }
.follow-line { position: relative; min-width: 0; padding: 13px 20px 13px 18px; border-bottom: 1px solid #f0ebe4; cursor: pointer; transition: background .15s; }
.follow-line:hover { background: #fff; }
.follow-line.active { background: #fff6ee; box-shadow: inset 3px 0 0 var(--speak-accent); }
.follow-stamp { display: block; margin-bottom: 4px; color: #a9a399; font-size: 12px; font-variant-numeric: tabular-nums; }
.follow-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.follow-original { margin: 0; flex: 1; min-width: 0; font-size: 17.5px; font-weight: 650; line-height: 1.6; color: var(--speak-ink); overflow-wrap: anywhere; }
.follow-star { flex: none; width: 32px; height: 32px; margin: -4px -6px 0 0; border: 0; border-radius: 50%; background: transparent; color: #c9c2b7; font-size: 19px; line-height: 1; }
.follow-star:hover { background: #f6f1ea; color: #a39a8c; }
.follow-star[aria-pressed="true"] { color: var(--speak-accent); }
.follow-translation { margin: 5px 0 0; font-size: 15px; line-height: 1.7; color: #777067; overflow-wrap: anywhere; }
.follow-lines[data-lang="original"] .follow-translation { display: none; }
.follow-lines[data-lang="translation"] .follow-original { display: none; }
.follow-lines[data-lang="translation"] .follow-translation { margin-top: 0; font-size: 16px; color: var(--speak-ink); }
.follow-lines[data-lang="hidden"] .follow-translation, .follow-lines[data-lang="hidden"] .follow-original { display: none; }
.follow-lines[data-lang="hidden"] .follow-line { padding-block: 9px; }

/* ---------------- 窄屏：手机与平板 ---------------- */
@media(max-width: 768px) {
  .lesson-nav { top: 56px; }
  .speak-caption { padding: 34px 24px 34px; }
  .follow-lines { max-height: none; }
  .follow-line { padding: 12px 16px 12px 15px; }
  .follow-original { font-size: 16.5px; }
  .follow-translation { font-size: 14.5px; }
}
@media(max-width: 560px) {
  .site-inner { gap: 8px; min-height: 56px; }
  .learner-identity { max-width: 108px; padding: 4px 9px; font-size: 12px; }
  .identity-libs { display: none; }
  .site-actions { gap: 2px; }
  .site-actions > .text-button { min-height: 36px; padding: 0 8px; font-size: 13px; letter-spacing: 0; }
  main { padding-top: 18px; padding-bottom: 64px; }
  [data-view="catalog"] .course-title { min-height: 0; margin-bottom: 18px; padding: 20px 16px; border-radius: 16px; }
  [data-view="catalog"] .course-title::after { display: none; }
  .catalog-summary { font-size: 14px; }
  .catalog-stats { gap: 6px; margin-top: 12px; }
  .catalog-stats span { padding: 4px 10px; font-size: 12.5px; }
  .filters { gap: 4px; margin-bottom: 10px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; min-height: 34px; padding: 0 13px; font-size: 13.5px; }
  .lessons { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .catalog-heading-row { margin: 20px 0 12px; }
  .catalog-heading { font-size: 17px; }
  .catalog-greeting { font-size: 18px; }
  .card-info { padding: 13px 14px 14px; }
  .filter-row select { flex: 1 1 0; min-width: 0; max-width: none; }
  .filter-row .search-field { flex: 1 1 100%; }
  .course-title, .lesson-info, .lesson-section, #notice { padding-inline: 16px; }
  .lesson-section .paper, .lesson-section .player, .lesson-section .transport { margin-inline: -16px; border-radius: 0; border-inline: 0; box-shadow: none; }
  .lesson-nav { top: 56px; margin-bottom: 18px; }
  .lesson-nav button { min-height: 34px; padding: 0 11px; font-size: 13.5px; }
  .lesson-section + .lesson-section { margin-top: 32px; }
  .lesson-metadata { gap: 8px 14px; }
  .passage { padding: 16px 14px 20px; }
  /* 手机上的文章不放进卡片：白底直接铺满，读起来更像对照稿。 */
  .practice-paper { border-color: transparent; border-radius: 0; background: transparent; box-shadow: none; }
  .practice-paper .passage { padding: 4px 0 8px; }
  .passage-head { gap: 8px; }
  .passage-actions { width: 100%; margin-left: 0; gap: 6px; flex-wrap: nowrap; }
  .passage-actions .replay, .passage-actions .check, .passage-actions .text-button { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .practice-original { font-size: 17.5px; line-height: 2.1; }
  .practice-translation { font-size: 15.5px; }
  .practice-original .blank { font-size: 15.5px; }
  .transport { gap: 8px; padding: 6px 8px; }
  .round-play { width: 40px; min-height: 40px; }
  .reading-paper { padding: 20px 16px; }
  .reading-controls button { min-height: 32px; padding: 0 12px; }
  .article-original, .practice-original { text-wrap: pretty; }
  .article-original { font-size: 17.5px; }
  .article-translation { font-size: 15.5px; }
  .expression { padding: 14px 15px 16px; border-radius: 14px; }
  .expression-example { margin-top: 10px; padding: 9px 11px; }
  .expression-list { gap: 12px; }
  /* 手机上释义与同义替换按行排，不再挤成窄窄的两列。 */
  .expression-meta { grid-template-columns: 1fr; gap: 1px; }
  .expression-meta dt { margin-top: 6px; }
  .speak-card { border-radius: 14px; }
  .speak-toolbar { padding: 8px; gap: 5px; flex-wrap: wrap; }
  .speak-langs { flex: 1 1 100%; }
  .speak-langs button { flex: 1 1 0; padding: 0 4px; font-size: 12.5px; }
  .speak-caption-toggle { flex: none; }
  .speak-speed { flex: 1; min-width: 0; }
  .speak-speed select { width: 100%; }
  .speak-export { min-height: 36px; padding: 0 12px; font-size: 13px; }
  /* 手机上画面偏矮，字幕贴着画面底、进度条压在它下面。 */
  .speak-caption { padding: 26px 12px 36px; }
  .speak-caption-en { font-size: 16px; line-height: 1.42; }
  .speak-caption-zh { margin-top: 4px; font-size: 13.5px; }
  .speak-caption[data-lang="translation"] .speak-caption-zh { font-size: 15.5px; }
  .speak-counter { right: 9px; top: 9px; padding: 4px 9px; font-size: 12px; }
  .speak-progress { padding: 12px 9px 5px; gap: 6px; }
  .speak-progress-time { font-size: 11px; }
  .follow-line { padding: 11px 12px 11px 12px; }
  .follow-original { font-size: 16px; }
  .follow-star { width: 30px; height: 30px; margin: -2px -6px 0 0; }
  .speak-back { top: 8px; right: 8px; }
}
@media(prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 素材库列表：中屏两列。 */
@media (max-width: 1024px) and (min-width: 561px) {
  .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
