/* =============================================================================
 * recall-detail.css — 「易译」录音详情页（契约 §8.4 / §8.5）
 *
 * 约束（Lead 修订版 §8.5）：
 *  1. 现有 App 的主题机制是 documentElement[data-theme="dark|light"]，不是 html.dark；
 *     深色规则一律写 [data-theme="dark"] #recall-detail …。
 *  2. 现有 styles.css 已在 :root 占用 --bg/--surface/--line/--muted/--violet/--shadow 等，
 *     语义不同：**禁止全局重定义**。设计 token 只在 #recall-detail 子树内覆盖。
 *  3. 所有 class 一律 recall- 前缀，不碰 .page/.tab/.sheet/.toast/.tiny/.switch 等全局类。
 *  4. 兼容 Android 10 WebView / Chrome 80：不用 :has、不用 inset 简写、不用 flex/grid gap。
 *  5. 页面是 shell（recall-shell.css）提供的全屏固定层；本文件只负责内部布局与组件，
 *     不设置 position/top/bottom（安全区由 shell 处理），根节点内部独立滚动。
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. 设计 token：仅在 #recall-detail 子树内生效（零全局污染）
 * ------------------------------------------------------------------------ */
#recall-detail {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #ecf0f7;
  --ink: #202633;
  --sub: #758092;
  --muted: #a0a9b7;
  --line: #e8ebf0;
  --brand: #5179e8;
  --brand-light: #eef3ff;
  --violet: #9673e8;
  --mint: #21ab91;
  --shadow: 0 10px 35px rgba(34, 45, 66, .035);
  --recall-danger: #e05a5f;
  --recall-warn-bg: #fff6e8;
  --recall-warn-line: #f2ddb8;
  --recall-warn-ink: #9a6a22;
  --recall-failed-bg: #fff1f2;
  --recall-failed-line: #f3d2d4;
  --recall-tree-line: #dce3ee;
  color-scheme: light;
}

[data-theme="dark"] #recall-detail {
  --bg: #11151d;
  --surface: #1b202b;
  --surface-2: #242b38;
  --surface-3: #2d3543;
  --ink: #f0f2f7;
  --sub: #a0aabd;
  --muted: #778498;
  --line: #313947;
  --brand: #91aaff;
  --brand-light: #293752;
  --violet: #bba0ff;
  --mint: #5bd5bc;
  --shadow: 0 10px 35px rgba(0, 0, 0, .13);
  --recall-danger: #ff6b70;
  --recall-warn-bg: #342b1c;
  --recall-warn-line: #5a4828;
  --recall-warn-ink: #e8c27a;
  --recall-failed-bg: #3a2427;
  --recall-failed-line: #5a3438;
  --recall-tree-line: #39424f;
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
 * 2. 根布局：固定顶栏 + 内部独立滚动
 * ------------------------------------------------------------------------ */
.recall-detail-page {
  -webkit-tap-highlight-color: transparent;
}

.recall-detail-root {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 490px;
  height: 100%;
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.recall-detail-root *,
.recall-detail-root *:before,
.recall-detail-root *:after {
  box-sizing: border-box;
}

.recall-detail-root button,
.recall-detail-root input {
  font-family: inherit;
}

.recall-detail-root button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.recall-detail-root button:focus-visible,
.recall-detail-root input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 图标 */
.recall-svg {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recall-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recall-svg--xs { width: 12px; height: 12px; }
.recall-svg--sm { width: 15px; height: 15px; }
.recall-svg--lg { width: 22px; height: 22px; }
.recall-svg--xl { width: 30px; height: 30px; }

.recall-tiny {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * 3. 固定顶栏
 * ------------------------------------------------------------------------ */
.recall-detail-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 12;
  background: var(--bg);
  padding: 8px 18px 4px;
}

.recall-detail-bar {
  display: flex;
  align-items: center;
  min-height: 46px;
}

.recall-icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
}

.recall-icon-btn:active {
  background: var(--surface-2);
}

.recall-icon-btn[aria-disabled="true"] {
  opacity: .45;
}

.recall-detail-name {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  margin: 0 2px;
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.4;
  letter-spacing: -.2px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 10px;
}

.recall-detail-name.is-expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
 * 4. 滚动区 / 内容宽度
 * ------------------------------------------------------------------------ */
.recall-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.recall-detail-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.recall-detail-main {
  padding: 0 23px;
}

.recall-tab-body {
  padding: 18px 0 30px;
}

/* ---------------------------------------------------------------------------
 * 5. 音频播放器
 * ------------------------------------------------------------------------ */
.recall-audio-panel {
  margin: 10px 0 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.recall-audio-main {
  display: flex;
  align-items: center;
}

.recall-play-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #232938;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.recall-play-btn:active {
  opacity: .85;
}

.recall-play-btn.is-disabled,
.recall-play-btn.is-disabled:active {
  opacity: .42;
}

.recall-audio-body {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-wave {
  display: flex;
  align-items: center;
  width: 100%;
  height: 24px;
  overflow: hidden;
}

.recall-wave span {
  display: block;
  flex: 1 1 auto;
  min-width: 2px;
  max-width: 4px;
  margin-right: 3px;
  background: #dce3ef;
  border-radius: 3px;
}

.recall-wave span:last-child {
  margin-right: 0;
}

/* 波形高度：CSS 装饰（无演示数据），前 13 根强调色同设计稿 */
.recall-wave span:nth-child(1) { height: 8px; }
.recall-wave span:nth-child(2) { height: 13px; }
.recall-wave span:nth-child(3) { height: 19px; }
.recall-wave span:nth-child(4) { height: 11px; }
.recall-wave span:nth-child(5) { height: 16px; }
.recall-wave span:nth-child(6) { height: 21px; }
.recall-wave span:nth-child(7) { height: 12px; }
.recall-wave span:nth-child(8) { height: 8px; }
.recall-wave span:nth-child(9) { height: 18px; }
.recall-wave span:nth-child(10) { height: 23px; }
.recall-wave span:nth-child(11) { height: 12px; }
.recall-wave span:nth-child(12) { height: 17px; }
.recall-wave span:nth-child(13) { height: 9px; }
.recall-wave span:nth-child(14) { height: 14px; }
.recall-wave span:nth-child(15) { height: 20px; }
.recall-wave span:nth-child(16) { height: 13px; }
.recall-wave span:nth-child(17) { height: 7px; }
.recall-wave span:nth-child(18) { height: 18px; }
.recall-wave span:nth-child(19) { height: 23px; }
.recall-wave span:nth-child(20) { height: 15px; }
.recall-wave span:nth-child(21) { height: 11px; }
.recall-wave span:nth-child(22) { height: 19px; }
.recall-wave span:nth-child(23) { height: 14px; }
.recall-wave span:nth-child(24) { height: 9px; }
.recall-wave span:nth-child(25) { height: 20px; }
.recall-wave span:nth-child(26) { height: 16px; }
.recall-wave span:nth-child(27) { height: 10px; }
.recall-wave span:nth-child(28) { height: 13px; }
.recall-wave span:nth-child(29) { height: 22px; }
.recall-wave span:nth-child(30) { height: 11px; }
.recall-wave span:nth-child(31) { height: 14px; }
.recall-wave span:nth-child(32) { height: 18px; }

.recall-wave span:nth-child(-n+13) {
  background: #718ce0;
}

.recall-progress {
  height: 3px;
  margin-top: 9px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.recall-progress-fill {
  width: 0;
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
}

.recall-audio-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.recall-audio-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.recall-icon-text {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.recall-icon-text .recall-svg {
  margin-right: 5px;
}

.recall-icon-text > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recall-mini-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 7px;
  margin-left: 8px;
  border-radius: 7px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.4;
  white-space: nowrap;
}

.recall-mini-badge .recall-svg {
  margin-right: 4px;
}

.recall-audio-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
 * 6. 标签栏
 * ------------------------------------------------------------------------ */
.recall-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin: 2px 0 0;
}

.recall-tab {
  flex: 1 1 0;
  position: relative;
  padding: 13px 4px 12px;
  background: transparent;
  border: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--sub);
  text-align: center;
  white-space: nowrap;
}

.recall-tab.is-active {
  color: var(--ink);
  font-weight: 750;
}

.recall-tab.is-active:after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -1px;
  height: 3px;
  border-radius: 5px;
  background: var(--brand);
}

/* ---------------------------------------------------------------------------
 * 7. 通用文字 / 区块标题
 * ------------------------------------------------------------------------ */
.recall-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.recall-eyebrow .recall-svg {
  margin-right: 6px;
}

.recall-eyebrow-text {
  display: inline;
}

.recall-eyebrow-sep {
  margin: 0 3px;
}

.recall-lead-title {
  margin: 18px 0 10px;
  font-size: 21px;
  line-height: 1.4;
  font-weight: 740;
  letter-spacing: -.4px;
  color: var(--ink);
}

.recall-content-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 13px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
}

.recall-content-title {
  min-width: 0;
}

.recall-section-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 10px;
}

.recall-summary-band {
  margin: 15px 0;
  padding: 15px 16px;
  border-left: 3px solid var(--brand);
  border-radius: 0 13px 13px 0;
  background: var(--brand-light);
  color: #445c96;
  font-size: 13.5px;
  line-height: 1.9;
}

.recall-transcript-note {
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.recall-soft-note {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--sub);
}

.recall-soft-note--tight {
  margin-top: 0;
}

/* ---------------------------------------------------------------------------
 * 8. 思维导图速览（AI 纪要里的 chapters 折叠列表）
 * ------------------------------------------------------------------------ */
.recall-outline {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
}

.recall-outline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}

.recall-outline-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.recall-outline-title {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}

.recall-outline-title .recall-svg {
  margin-right: 6px;
  color: var(--brand);
}

.recall-outline-item {
  border-bottom: 1px solid var(--line);
}

.recall-outline-item:last-child {
  border-bottom: 0;
}

.recall-outline-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 15px 15px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.5;
}

.recall-outline-name {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-dot {
  display: block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-right: 10px;
  border-radius: 50%;
}

.recall-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 8px;
  color: var(--muted);
  transition: transform .15s ease;
}

.recall-arrow.is-open {
  transform: rotate(90deg);
}

.recall-outline-content {
  padding: 0 16px 14px 34px;
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.8;
}

.recall-outline-point {
  position: relative;
  padding-left: 12px;
  margin-top: 6px;
}

.recall-outline-point:before {
  content: "\00b7";
  position: absolute;
  left: 0;
}

.recall-btn-outline--sm {
  flex: 0 0 auto;
  padding: 7px 9px;
  margin-left: 10px;
  font-size: 11px;
  border-radius: 9px;
}

.recall-btn-outline--sm .recall-svg {
  margin-left: 3px;
  margin-right: 0;
}

/* ---------------------------------------------------------------------------
 * 9. 详细纪要 / 引用 / 知识点 / 待办
 * ------------------------------------------------------------------------ */
.recall-note-item {
  padding-left: 16px;
  border-left: 2px solid var(--line);
  margin-bottom: 18px;
}

.recall-note-item:last-child {
  margin-bottom: 6px;
}

.recall-note-title {
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.6;
  color: var(--ink);
}

.recall-note-num {
  margin-right: 8px;
  color: var(--muted);
  font-weight: 700;
}

.recall-note-p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--sub);
  white-space: pre-wrap;
}

.recall-quote {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f6f1ff;
  border-left: 3px solid var(--violet);
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  line-height: 1.9;
  color: #776095;
}

.recall-quote-original {
  white-space: pre-wrap;
}

.recall-quote-translation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e9dcfb;
  color: #867d97;
  white-space: pre-wrap;
}

.recall-points {
  margin: 0;
}

.recall-point {
  position: relative;
  margin-top: 9px;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--sub);
}

.recall-point:before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

.recall-action {
  display: flex;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
}

.recall-action:last-child {
  border-bottom: 0;
}

.recall-check {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 2px;
  margin-right: 10px;
  border: 1.5px solid #bdc7d8;
  border-radius: 6px;
}

.recall-action-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------------------------------------------------------------------------
 * 10. 转录
 * ------------------------------------------------------------------------ */
.recall-utterance {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.recall-utterance:last-of-type {
  margin-bottom: 12px;
}

.recall-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8edfb;
  color: var(--brand);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 750;
}

.recall-avatar.is-b {
  background: #f0eafd;
  color: var(--violet);
}

.recall-utterance-body {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-utterance-head {
  display: flex;
  align-items: center;
  margin: 3px 0 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.recall-utterance-title {
  margin-right: 9px;
  color: var(--ink);
  font-weight: 700;
}

.recall-utterance-original {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink);
}

.recall-utterance-translated {
  margin-top: 6px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--sub);
}

/* ---------------------------------------------------------------------------
 * 11. 思维导图（纵向缩进树，不做横向画布）
 * ------------------------------------------------------------------------ */
.recall-mind-tree {
  width: 100%;
  min-width: 0;
}

.recall-tree-root {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 4px auto 26px;
  padding: 12px 16px;
  background: #222a39;
  color: #ffffff;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  box-shadow: 0 8px 19px rgba(34, 42, 57, .14);
}

.recall-tree-root .recall-svg {
  margin-right: 8px;
  color: #9db4ff;
}

.recall-tree-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recall-tree-branches {
  position: relative;
  min-width: 0;
}

.recall-tree-branches:before {
  content: "";
  position: absolute;
  top: -27px;
  bottom: 17px;
  left: 16px;
  width: 2px;
  background: var(--recall-tree-line);
}

.recall-branch {
  position: relative;
  padding-left: 32px;
  margin-bottom: 10px;
}

.recall-branch:before {
  content: "";
  position: absolute;
  top: 22px;
  left: 16px;
  width: 15px;
  height: 2px;
  background: var(--recall-tree-line);
}

.recall-branch-button {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 13px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.5;
  color: var(--ink);
}

.recall-branch-button--leaf {
  cursor: default;
}

.recall-branch-bullet {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-right: 10px;
  border-radius: 50%;
}

.recall-branch-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.recall-branch-child {
  margin: 6px 0 8px 14px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.recall-mind-group {
  margin: 6px 0;
}

.recall-leaf {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: left;
  overflow-wrap: anywhere;
}

.recall-leaf--toggle {
  display: flex;
  align-items: center;
}

.recall-leaf-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.recall-leaf--toggle .recall-arrow {
  margin-left: auto;
}

.recall-mind-children {
  margin: 6px 0 4px 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

/* ---------------------------------------------------------------------------
 * 12. 工具栏 / 按钮
 * ------------------------------------------------------------------------ */
.recall-toolbar {
  display: flex;
  align-items: stretch;
  margin: 22px 0 4px;
}

.recall-toolbar button {
  flex: 1 1 0;
  min-width: 0;
  margin-right: 8px;
}

.recall-toolbar button:last-child {
  margin-right: 0;
}

.recall-toolbar--single {
  margin-top: 6px;
}

.recall-toolbar--single button {
  max-width: 100%;
}

.recall-toolbar--mind {
  margin-top: 20px;
}

.recall-btn-soft,
.recall-btn-outline,
.recall-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.recall-btn-soft {
  background: var(--brand-light);
  border: 0;
  color: var(--brand);
}

.recall-btn-outline {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--sub);
  font-weight: 600;
}

.recall-btn-danger {
  background: var(--recall-danger);
  border: 0;
  color: #ffffff;
}

.recall-btn-soft .recall-svg,
.recall-btn-outline .recall-svg {
  margin-right: 5px;
}

.recall-btn-soft:active,
.recall-btn-outline:active {
  opacity: .8;
}

.recall-btn-soft[disabled],
.recall-btn-outline[disabled],
.recall-btn-danger[disabled] {
  opacity: .55;
  cursor: default;
}

/* ---------------------------------------------------------------------------
 * 13. 轻量状态条（整理中 / 内容不足）
 * ------------------------------------------------------------------------ */
.recall-status-strip {
  display: flex;
  align-items: flex-start;
  margin: 14px 0 4px;
  padding: 14px 15px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.recall-status-strip--sync,
.recall-status-strip--pending,
.recall-status-strip--analyzing,
.recall-status-strip--waiting,
.recall-status-strip--loading,
.recall-status-strip--unknown {
  background: var(--brand-light);
  border-color: transparent;
}

.recall-status-strip--failed {
  background: var(--recall-failed-bg);
  border-color: var(--recall-failed-line);
}

.recall-status-strip--timeout,
.recall-status-strip--poll-error {
  background: var(--recall-warn-bg);
  border-color: var(--recall-warn-line);
}

.recall-status-strip--skipped,
.recall-status-strip--done-empty {
  background: var(--surface-2);
  border-color: var(--line);
}

.recall-status-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand);
}

.recall-status-strip--failed .recall-status-icon {
  color: var(--recall-danger);
}

.recall-status-strip--timeout .recall-status-icon,
.recall-status-strip--poll-error .recall-status-icon {
  color: var(--recall-warn-ink);
}

.recall-status-strip--skipped .recall-status-icon,
.recall-status-strip--done-empty .recall-status-icon {
  color: var(--sub);
}

.recall-status-text {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-status-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.recall-status-sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--sub);
}

.recall-status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.recall-status-actions button {
  margin: 0 8px 0 0;
  padding: 8px 12px;
  font-size: 12px;
}

.recall-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--brand);
  border-top-color: transparent;
  border-radius: 50%;
  animation: recall-detail-spin .8s linear infinite;
}

.recall-status-strip--failed .recall-spinner {
  border-color: var(--recall-danger);
  border-top-color: transparent;
}

@keyframes recall-detail-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
 * 14. 空态 / 错误态 / 骨架
 * ------------------------------------------------------------------------ */
.recall-empty {
  margin-top: 18px;
  padding: 40px 18px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.recall-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--muted);
}

.recall-empty-title {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.recall-empty-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--sub);
}

.recall-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.recall-empty-actions button {
  margin: 4px;
  padding: 10px 14px;
  flex: 0 0 auto;
}

.recall-loading {
  padding-top: 10px;
}

.recall-skeleton-card {
  margin-top: 12px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.recall-skel-wave {
  height: 34px;
  margin-bottom: 18px;
  border-radius: 9px;
  background: var(--surface-2);
}

.recall-skel-line {
  position: relative;
  height: 14px;
  margin-top: 12px;
  border-radius: 7px;
  background: var(--surface-2);
  overflow: hidden;
}

.recall-skel-line--w90 { width: 90%; }
.recall-skel-line--w70 { width: 70%; }
.recall-skel-line--w50 { width: 50%; }

.recall-skel-line:after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  animation: recall-detail-shimmer 1.2s ease-in-out infinite;
}

@keyframes recall-detail-shimmer {
  from { left: -40%; }
  to { left: 100%; }
}

/* ---------------------------------------------------------------------------
 * 15. 底部弹出菜单
 * ------------------------------------------------------------------------ */
.recall-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 20, 32, .32);
}

/* 对话框居中；底部菜单贴底（用修饰类区分，避免 :has，兼容 Chrome 80） */
.recall-overlay--dialog {
  align-items: center;
  padding: 0 22px;
}

.recall-sheet {
  width: 100%;
  max-width: 490px;
  max-height: 88%;
  overflow-y: auto;
  padding: 18px 20px 18px;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .08);
}

.recall-sheet-grab {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 4px;
  background: var(--line);
}

.recall-sheet-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 740;
  line-height: 1.4;
  color: var(--ink);
}

.recall-sheet-option {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 0;
  border-radius: 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.recall-sheet-option .recall-svg {
  margin-right: 10px;
  color: var(--sub);
}

.recall-sheet-option--danger,
.recall-sheet-option--danger .recall-svg {
  color: var(--recall-danger);
}

.recall-sheet-option-text {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-sheet-close {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--sub);
  background: transparent;
  border: 0;
}

/* ---------------------------------------------------------------------------
 * 16. 对话框（修改标题 / 移动 / 删除确认）
 * ------------------------------------------------------------------------ */
.recall-dialog {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

.recall-dialog-title {
  font-size: 16px;
  font-weight: 740;
  line-height: 1.5;
  color: var(--ink);
}

.recall-dialog-text {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--sub);
}

.recall-input {
  width: 100%;
  height: 45px;
  margin-top: 14px;
  padding: 0 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.recall-input:focus {
  border-color: var(--brand);
}

.recall-dialog-error {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--recall-danger);
}

.recall-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

.recall-dialog-actions button {
  flex: 0 0 auto;
  padding: 10px 16px;
  margin-left: 8px;
}

/* ---------------------------------------------------------------------------
 * 17. Toast（页面内，高于弹层）
 * ------------------------------------------------------------------------ */
.recall-detail-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 90;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 11px 17px;
  background: #292f3a;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 12px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}

.recall-detail-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------------------
 * 18. 深色模式（现有 App 用 documentElement[data-theme="dark"]）
 * ------------------------------------------------------------------------ */
[data-theme="dark"] #recall-detail .recall-play-btn,
[data-theme="dark"] #recall-detail .recall-tree-root {
  background: #e4eaf5;
  color: #1d2533;
}

[data-theme="dark"] #recall-detail .recall-tree-root .recall-svg {
  color: #4a5f8f;
}

[data-theme="dark"] #recall-detail .recall-summary-band {
  color: #bed0ff;
}

[data-theme="dark"] #recall-detail .recall-quote {
  background: #322941;
  color: #c6b2e9;
}

[data-theme="dark"] #recall-detail .recall-quote-translation {
  border-top-color: #514365;
  color: #baafd0;
}

[data-theme="dark"] #recall-detail .recall-wave span {
  background: #414a58;
}

[data-theme="dark"] #recall-detail .recall-wave span:nth-child(-n+13) {
  background: #7793e1;
}

[data-theme="dark"] #recall-detail .recall-avatar {
  background: #303b58;
}

[data-theme="dark"] #recall-detail .recall-avatar.is-b {
  background: #453454;
}

[data-theme="dark"] #recall-detail .recall-check {
  border-color: #4a5466;
}

[data-theme="dark"] #recall-detail .recall-detail-toast {
  background: #edf0f7;
  color: #232936;
}

[data-theme="dark"] #recall-detail .recall-skel-line:after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .07), rgba(255, 255, 255, 0));
}

/* 宽屏（PWA 桌面）：详情页居中、两侧留灰底（同设计参考） */
@media (min-width: 600px) {
  #recall-detail {
    background: #e9edf4;
  }

  [data-theme="dark"] #recall-detail {
    background: #0b0e14;
  }

  #recall-detail .recall-detail-root {
    border-left: 1px solid #d9e1eb;
    border-right: 1px solid #d9e1eb;
    box-shadow: 0 18px 70px rgba(21, 31, 54, .12);
  }

  [data-theme="dark"] #recall-detail .recall-detail-root {
    border-left-color: #232c3a;
    border-right-color: #232c3a;
    box-shadow: 0 18px 70px rgba(0, 0, 0, .4);
  }

  [data-theme="dark"] #recall-detail .recall-sheet {
    border-radius: 23px;
    margin-bottom: 24px;
  }
}

/* 320px 小屏：收窄留白、压缩工具栏，保证无横向溢出 */
@media (max-width: 359px) {
  .recall-detail-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .recall-detail-main {
    padding: 0 18px;
  }

  .recall-lead-title {
    font-size: 19px;
  }

  .recall-content-h {
    font-size: 15px;
  }

  .recall-audio-panel {
    padding: 14px;
  }

  .recall-play-btn {
    width: 42px;
    height: 42px;
    margin-right: 10px;
  }

  .recall-toolbar button {
    margin-right: 6px;
    padding: 10px 6px;
    font-size: 11.5px;
  }

  .recall-toolbar button .recall-svg {
    margin-right: 4px;
  }

  .recall-branch {
    padding-left: 28px;
  }

  .recall-tree-branches:before {
    left: 14px;
  }

  .recall-branch:before {
    left: 14px;
    width: 13px;
  }

  .recall-overlay--dialog {
    padding: 0 14px;
  }
}

/* 减少动态：只影响详情页内部，避免影响现有页面 */
@media (prefers-reduced-motion: reduce) {
  #recall-detail .recall-spinner,
  #recall-detail .recall-skel-line:after {
    animation: none !important;
  }

  #recall-detail .recall-arrow,
  #recall-detail .recall-detail-toast {
    transition: none !important;
  }
}
