/* 一茶万象 · 音频播放器、课程页、听审页的样式（2026-10-09 起：浅色用配色方案 B，深色用方案 C）
 * 播放器是一个 <dialog>，首页、课程页都用它。浅色纸面，深色模式下换成夜茶席。
 */
.voice-dialog {
  --vp: #f5f0e8;
  --vp-2: #d7e2de;
  --vi: #2f322e;
  --vm: #5c564f;
  --vl: #cfc6bc;
  --va: #7a5b43;
  --va-ink: #fff;
  color: var(--vi);
  background: var(--vp);
  border: 1px solid var(--vl);
  border-radius: 4px;
  padding: 0;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .voice-dialog {
    --vp: #1b2627; --vp-2: #223031; --vi: #f5f0e8; --vm: #b7c6c2; --vl: #3a4f4c; --va: #c9a688; --va-ink: #1f2a2a;
  }
}
:root[data-theme="dark"] .voice-dialog {
  --vp: #1b2627; --vp-2: #223031; --vi: #f5f0e8; --vm: #b7c6c2; --vl: #3a4f4c; --va: #c9a688; --va-ink: #1f2a2a;
}
.voice-dialog::backdrop { background: rgba(15, 20, 16, .78); }
.voice-dialog [hidden] { display: none !important; }
.voice-shell { padding: clamp(18px, 4vw, 40px); }
.voice-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.voice-eyebrow { margin: 0; font-size: 13px; letter-spacing: .15em; color: var(--vm); }
.voice-dialog h2 { font-family: "Noto Serif SC", serif; font-weight: 400; font-size: clamp(22px, 4vw, 32px); line-height: 1.4; margin: 14px 0 6px; overflow-wrap: anywhere; }
.voice-note { font-size: 13px; line-height: 1.8; color: var(--vm); max-width: 70ch; margin: 0 0 8px; overflow-wrap: anywhere; }

.voice-dialog button, .voice-dialog a { font: inherit; cursor: pointer; color: var(--va); }
.voice-dialog button {
  border: 1px solid var(--vl);
  background: transparent;
  padding: 10px 18px;
  border-radius: 3px;
  min-height: 44px;
}
.voice-dialog button:hover { background: var(--vp-2); }
.voice-dialog button.voice-main { background: var(--va); color: var(--va-ink); border-color: var(--va); }
.voice-dialog button:focus-visible, .voice-dialog input:focus-visible, .voice-dialog a:focus-visible { outline: 3px solid var(--va); outline-offset: 3px; }
.voice-led-hint { font-size: 13px; line-height: 1.8; color: var(--vi); margin: 0 0 8px; padding: 8px 12px; border-left: 2px solid var(--va); }
.voice-modes { display: inline-flex; border: 1px solid var(--vl); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.voice-dialog .voice-modes button { border: 0; border-radius: 0; min-height: 36px; padding: 6px 18px; background: none; font-size: 14px; }
.voice-dialog .voice-modes button[aria-checked="true"] { background: var(--va); color: var(--va-ink); }
.voice-steps { list-style: none; margin: 4px 0 14px; padding: 0; max-height: 40vh; overflow-y: auto; border-top: 1px solid var(--vl); }
.voice-steps li { border-bottom: 1px solid var(--vl); }
.voice-dialog .voice-steps button { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 10px 6px; color: var(--vi); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.voice-steps .voice-step-t { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--vm); padding-top: 2px; }
.voice-dialog .voice-steps li.on button { background: var(--vp-2); color: var(--vi); box-shadow: inset 3px 0 0 var(--va); }
.voice-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 14px; }

/* 准备页 */
.voice-prep-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; max-width: 34em; line-height: 1.85; font-size: 15px; }
.voice-prep-list li { padding-left: 18px; position: relative; }
.voice-prep-list li::before { content: "·"; position: absolute; left: 2px; color: var(--va); }
.voice-blocked-msg { font-family: "Noto Serif SC", serif; font-size: 18px; line-height: 1.9; margin: 24px 0 8px; max-width: 32em; }

/* 播放中 */
.voice-chapter { margin: 18px 0 0; font-size: 13px; letter-spacing: .12em; color: var(--vm); min-height: 1.6em; }
.voice-caption-wrap { min-height: 170px; display: flex; flex-direction: column; justify-content: center; padding: 18px 0; }
.voice-caption { font-family: "Noto Serif SC", serif; font-size: clamp(19px, 2.4vw, 24px); line-height: 1.9; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-status { color: var(--vm); font-size: 13px; line-height: 1.7; min-height: 22px; margin: 0; }
.voice-dialog[data-state="error"] .voice-status { color: #a4472a; }
.voice-progress { display: flex; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--vm); margin-top: 8px; }
.voice-progress input { flex: 1; min-width: 0; accent-color: var(--va); }
.voice-settings { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; font-size: 13px; }
.voice-settings label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.voice-settings input { accent-color: var(--va); }
.voice-settings input[type="range"] { max-width: 110px; }
.voice-outline { border-top: 1px solid var(--vl); margin-top: 20px; padding-top: 16px; font-size: 14px; line-height: 1.8; }
.voice-outline summary { cursor: pointer; min-height: 36px; }
.voice-chapters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.voice-chapters button { font-size: 12px; padding: 8px 12px; }
.voice-chapters [aria-current="true"] { background: var(--vp-2); border-color: var(--va); }
.voice-outline h3 { font-weight: 500; font-size: 15px; margin: 18px 0 4px; }
.voice-outline p { margin: 0; overflow-wrap: anywhere; }

/* 结束页 */
.voice-after-line { font-family: "Noto Serif SC", serif; font-size: clamp(20px, 3vw, 26px); letter-spacing: .1em; line-height: 1.8; margin: 26px 0 6px; }
.voice-after-sub { color: var(--vm); line-height: 1.9; margin: 0; max-width: 30em; }
.voice-dialog button.voice-link { border: 0; padding: 4px 0; min-height: 36px; text-decoration: underline; text-underline-offset: 4px; color: var(--vm); background: none; }
.voice-settle { max-width: 30em; display: grid; gap: 6px; padding: 16px 18px; margin: 10px 0; border: 1px solid var(--vl); border-radius: 4px; line-height: 1.85; }
.voice-settle p { margin: 0; }
.voice-help { color: var(--vm); font-size: 13px; line-height: 1.8; max-width: 34em; }
.voice-feedback { display: grid; gap: 8px; font-size: 13px; color: var(--vm); margin-top: 12px; }
.voice-feedback-row { display: flex; gap: 8px; }
.voice-feedback input { font: inherit; color: var(--vi); background: transparent; border: 0; border-bottom: 1px solid var(--vl); padding: 6px 2px; width: min(60vw, 260px); }

@media (max-width: 600px) {
  .voice-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .voice-caption-wrap { min-height: 130px; padding: 14px 0; }
  .voice-dialog button { padding: 10px 14px; }
}

/* ================= 课程页 ================= */
.course-page { background: #f5f0e8; color: #2f322e; margin: 0; font: 16px/1.8 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.course-main { max-width: 1120px; margin: auto; padding: 36px clamp(16px, 5vw, 60px); }
.course-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.course-page a { color: #7a5b43; }
.course-page h1 { font: 400 clamp(30px, 5vw, 50px)/1.3 "Noto Serif SC", serif; margin: 48px 0 18px; }
.course-page h2 { font-weight: 400; font-size: 24px; margin: 48px 0 6px; }
.course-intro { max-width: 65ch; color: #5c564f; }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.course-card { border-top: 1px solid #cfc6bc; padding: 22px 0; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.course-card h3 { font-weight: 400; margin: 0 0 6px; font-size: 20px; overflow-wrap: anywhere; }
.course-card .course-meta { font-size: 13px; color: #5c564f; margin: 0 0 6px; }
.course-card .course-note { font-size: 14px; color: #45413c; margin: 0 0 14px; overflow-wrap: anywhere; }
.course-tag { display: inline-block; font-size: 12px; border: 1px solid #ada297; padding: 0 8px; margin-left: 6px; border-radius: 2px; color: #5c564f; }
.course-page button, .course-page .course-btn {
  font: inherit; border: 1px solid #7a5b43; background: transparent; color: #7a5b43;
  padding: 10px 16px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; box-sizing: border-box;
}
.course-page button:hover, .course-page .course-btn:hover { background: #d7e2de; }
.course-page button:focus-visible, .course-page input:focus-visible, .course-page select:focus-visible, .course-page a:focus-visible { outline: 3px solid #7a5b43; outline-offset: 3px; }
.course-page input, .course-page select { font: inherit; padding: 10px; max-width: 100%; border: 1px solid #91857a; background: #fbf8f3; box-sizing: border-box; }
.module-filter { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.module-filter label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.module-filter input { flex: 1; min-width: 180px; }
.module-list { list-style: none; padding: 0; }
.module-list li { border-top: 1px solid #cfc6bc; padding: 16px 0; display: flex; align-items: center; gap: 20px; }
.module-list article { flex: 1; min-width: 0; }
.module-list strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.module-list p { font-size: 14px; margin: 6px 0; color: #45413c; overflow-wrap: anywhere; }
.module-list small { color: #5c564f; }
.course-error { color: #6b4f3a; }
@media (max-width: 600px) {
  .course-grid { grid-template-columns: 1fr; }
  .module-list li { align-items: flex-start; gap: 10px; }
  .module-list button { font-size: 13px; }
}

/* ================= 听审页 ================= */
.listen-bar { position: sticky; top: 0; z-index: 5; background: #f5f0e8; border-bottom: 1px solid #cfc6bc; padding: 10px 0; }
.listen-progress { margin: 0; font-weight: 500; }
.listen-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 6px; font-size: 14px; }
.listen-tools label { display: flex; align-items: center; gap: 6px; }
.listen-now { margin: 4px 0 0; font-size: 13px; color: #7a5b43; min-height: 1.4em; }
.listen-version { margin: 0 0 8px; font-size: 14px; color: #45413c; border-left: 3px solid #a78468; padding: 4px 10px; overflow-wrap: anywhere; }
.listen-item .listen-stale { margin: 0; font-size: 13px; color: #8a6a50; overflow-wrap: anywhere; }
.listen-row button:disabled { opacity: .5; }
.listen-course { margin-top: 36px; }
.listen-course h3 { font-weight: 400; font-size: 19px; margin: 0 0 4px; }
.listen-seg { font-size: 13px; color: #5c564f; margin: 14px 0 0; letter-spacing: .08em; }
.listen-item { border-top: 1px solid #cfc6bc; padding: 12px 0; display: grid; gap: 6px; }
.listen-item.is-clip { padding-left: 18px; border-top-style: dashed; }
.listen-item header { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.listen-item strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.listen-item .listen-text { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.listen-flags { margin: 0; padding: 0; list-style: none; font-size: 13px; color: #8a6a50; }
.listen-tag { font-size: 12px; border: 1px solid #ada297; padding: 0 6px; border-radius: 2px; color: #5c564f; }
.listen-tag.warn { border-color: #a78468; color: #8a6a50; }
.listen-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.listen-row button { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.listen-row button[aria-pressed="true"] { background: #7a5b43; color: #fff; }
.listen-row button.is-playing { background: #d7e2de; }
.listen-row input[type="text"] { flex: 1; min-width: 160px; padding: 6px 8px; }
.listen-item[data-mark="ok"] { background: rgba(94, 107, 85, .08); }
.listen-item[data-mark="bad"] { background: rgba(164, 71, 42, .08); }

/* ================= 音频页：分类标签 ================= */
.tabs-bar { position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 28px 0 8px; padding-top: 6px; background: #f5f0e8; border-bottom: 1px solid #cfc6bc; }
.tabs-bar::-webkit-scrollbar { display: none; }
.course-page .tabs-bar button { flex: none; border: 0; border-bottom: 2px solid transparent; background: none; color: #5c564f;
  padding: 10px 14px; min-height: 44px; font-size: 16px; letter-spacing: .06em; gap: 6px; }
.course-page .tabs-bar button:hover { background: none; color: #2f322e; }
.course-page .tabs-bar button[aria-selected="true"] { color: #2f322e; border-bottom-color: #7a5b43; }
.tabs-bar .lock { color: #91857a; }
.tab-panel { padding-top: 10px; }
.tab-panel > .course-intro { margin: 8px 0 18px; }
.unlock { padding: 24px 0 40px; }
.unlock-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.unlock-form input { width: 220px; }
.unlock-err { min-height: 1.6em; color: #6b4f3a; margin: 8px 0 0; }

/* 回到顶部：一条横线加一个向上的箭头 */
.course-page .to-top { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  width: 46px; height: 46px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%;
  border: 1px solid #cfc6bc; background: rgba(245, 246, 240, .94); color: #7a5b43; box-shadow: 0 4px 14px rgba(29, 33, 30, .1); }
.course-page .to-top:hover { background: #fff; }
.module-list strong { font-size: 15px; }

/* ===== 音频页：分组列表，点开一行看详情 ===== */
.au-group { margin: 30px 0 0; }
.au-group:first-of-type { margin-top: 14px; }
.course-page .au-gname { margin: 0 0 4px; font: 400 15px/1.6 "Noto Sans SC", sans-serif; letter-spacing: .14em; color: #5c564f; }
.au-gnote { margin: 0 0 8px; font-size: 14px; color: #5c564f; }
.au-list { border-bottom: 1px solid #cfc6bc; }
.au-row { border-top: 1px solid #cfc6bc; }
.course-card.au-row { display: block; padding: 0; }
.au-row > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 4px; min-height: 28px; }
.au-row > summary::-webkit-details-marker { display: none; }
.au-row > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 6px; border-right: 1.5px solid #5c564f; border-bottom: 1.5px solid #5c564f; transform: rotate(45deg); transition: transform .2s; }
.au-row[open] > summary::after { transform: rotate(-135deg); }
.au-row > summary:hover .au-name { color: #7a5b43; }
.au-name { flex: 1; min-width: 0; font: 400 18px/1.5 "Noto Serif SC", serif; color: #2f322e; overflow-wrap: anywhere; }
.au-len { flex: none; font-size: 14px; color: #5c564f; }
.au-body { padding: 0 4px 20px; }
.au-body .course-note { margin: 0 0 10px; font-size: 15px; color: #45413c; }
.au-body .course-meta { font-size: 14px; color: #5c564f; margin: 0 0 12px; }
.au-acts { display: flex; flex-wrap: wrap; gap: 10px; }
/* 单句音频：按类别收起 */
.module-list .mod-fam { display: block; padding: 0; border-top: 0; }
.module-list .mod-fam:last-child { border-bottom: 1px solid #cfc6bc; }
.mod-fam .module-list { margin: 0 0 8px; padding: 0 0 0 4px; }
.mod-fam .module-list li:first-child { border-top: 1px dashed #ddd5cb; }
