/* 全局重置与基础 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 品牌色 —— 品红为主，紫为辅 */
  --brand: #E8446B;
  --brand-strong: #C7335A;
  --brand-soft: #FDEEF2;
  --purple: #9B6BCB;
  --purple-soft: #F3EDFB;

  /* 中性色 */
  --ink: #343A40;
  --ink-soft: #5B5B5B;
  --ink-muted: #8A8A8A;

  /* 表面（白底） */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F8;
  --bg-panel: #FFFFFF;
  --bg-panel-strong: #F2F2F4;
  --bg-card: #FAFAFB;
  --bg-card-hover: #F2F2F4;
  --bg-card-latest: #FDEEF2;

  /* 状态色（白底可读） */
  --success: #2E9E6B;
  --warning: #C87F1A;
  --danger: #D64545;

  /* 语义文字 */
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--ink-muted);

  /* 分隔线 */
  --border-color: #E3E3E6;
  --border-soft: rgba(52, 58, 64, 0.08);

  /* 阴影：白底要极淡 */
  --shadow-soft: 0 8px 24px rgba(52, 58, 64, 0.06);
  --shadow-tight: 0 4px 14px rgba(52, 58, 64, 0.05);

  --font-sans: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', 'Fira Code', monospace;

  /* 圆角梯度 */
  --r-lg: 10px;
  --r-md: 8px;
  --r-sm: 6px;
  --r-pill: 999px;

  --t: 0.15s linear;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  background: var(--bg-primary);
}

button,
select,
textarea {
  font: inherit;
}

button,
label.upload-btn,
select {
  -webkit-tap-highlight-color: transparent;
}

/* 顶部导航（品红 → 紫 渐变菜单背景） */
.toolbar {
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(420px, 1fr) minmax(160px, auto);
  grid-template-areas:
    "brand controls script"
    "custom custom custom";
  align-items: center;
  gap: 12px 18px;
  min-height: 104px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 42%, var(--purple) 100%);
  background-size: 160% 160%;
  border-bottom: none;
  color: #FFFFFF;
  flex-shrink: 0;
  position: relative;
  animation: brandShift 18s linear infinite alternate;
}

/* 导航底部短促粗装饰横线 */
.toolbar::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: #FFFFFF;
}

.toolbar-left {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  flex: 0 0 auto;
  background: #FFFFFF;
  color: var(--brand);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-copy {
  min-width: 0;
}

.app-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1.15;
  text-transform: uppercase;
}

.app-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.toolbar-center {
  grid-area: controls;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  flex-wrap: wrap;
}

.toolbar-right {
  grid-area: script;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.audio-source,
.scene-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--r-md);
  transition: border-color var(--t), background var(--t);
}

.audio-source:hover,
.scene-mode:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
}

.audio-source label,
.scene-mode label,
.custom-prompt-row label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.audio-source label,
.scene-mode label {
  color: rgba(255, 255, 255, 0.85);
}

/* 下拉去掉白底，做成与导航融合的玻璃感 */
.audio-source select,
.scene-mode select {
  height: 30px;
  max-width: 220px;
  /* 比原始 128px 多 3 个字宽（13px × 3），容纳「部门-姓名」 */
  min-width: calc(128px + 3em);
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 10px 7px;
  color: #FFFFFF;
  border: none;
  padding: 0 24px 0 2px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: color var(--t), opacity var(--t);
}

/* 场景 / 音频源：整块与「生成述职评估」按钮等长（114px）
   标签缩成 1 个字（场 / 音）以塞进 114px；窄屏（≤680px）走下方媒体查询恢复整行 */
@media (min-width: 681px) {
  .scene-mode,
  .audio-source {
    flex: 0 0 114px;
    width: 114px;
    gap: 4px;
    padding: 0 6px;
  }

  /* 在场人下拉需要放下「部门-姓名」，比默认多留 3 个字（13px × 3 = 39px） */
  .person-picker {
    flex: 0 0 171px;
    width: 171px;
  }

  .scene-mode select,
  .audio-source select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0 16px 0 0;
  }
}

.audio-source select option,
.scene-mode select option {
  background: #FFFFFF;
  color: var(--ink);
}

.audio-source select:hover,
.scene-mode select:hover {
  opacity: 0.82;
}

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

.custom-prompt-row {
  grid-area: custom;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 0 0;
  background: transparent;
}

.custom-prompt-row label {
  padding-top: 8px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.82);
}

.custom-prompt-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-md);
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
}

.custom-prompt-input::placeholder {
  color: var(--ink-muted);
}

/* 按钮（导航内一律白系，保证渐变上可读） */
.btn {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 36px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
  white-space: nowrap;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* 导航内的开始按钮：实心白底 + 品红字，最高优先级 */
.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.toolbar .btn-primary {
  background: #FFFFFF;
  color: var(--brand);
  border-color: #FFFFFF;
}

.toolbar .btn-primary:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.btn-primary.recording {
  background: var(--danger);
  color: #FFFFFF;
  border-color: #FFFFFF;
  animation: pulse 1.5s ease-in-out infinite;
}

.toolbar .btn-primary.recording {
  background: var(--danger);
  color: #FFFFFF;
  border-color: #FFFFFF;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.42);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #FFFFFF;
}

.btn-accent {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-accent:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: #FFFFFF;
}

.btn-review,
.btn-export {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.38);
}

.btn-review:hover,
.btn-export:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #FFFFFF;
}

.btn-deep {
  background: rgba(255, 255, 255, 0.26);
  color: #FFFFFF;
  border-color: #FFFFFF;
}

.btn-deep:hover {
  background: rgba(255, 255, 255, 0.4);
}

.btn-small {
  min-height: 28px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}

.btn-small:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--brand);
}

.btn-small.is-edited {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--brand);
}

/* 自动深度开关：与旁边按钮同高、同圆角 */
.btn-deep-toggle {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 36px;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-deep-toggle.active {
  color: var(--brand);
  background: #FFFFFF;
  border-color: #FFFFFF;
}

.upload-btn {
  cursor: pointer;
}

.script-status {
  max-width: 260px;
  color: #FFFFFF;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 主内容区 */
.main-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  background: var(--bg-secondary);
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-color);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.panel-suggestions {
  border-top-color: var(--brand);
}

.panel-transcript {
  border-top-color: var(--purple);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 13px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
}

/* 标题下方短促粗装饰横线 */
.panel-header::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: -1px;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--brand);
}

.panel-transcript .panel-header::after {
  background: var(--purple);
}

/* 细边框标题框 */
.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 11px;
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--ink);
}

.panel-transcript .panel-header h2 {
  border-color: var(--purple);
}

.panel-label {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 7px;
  background: var(--brand);
  border-radius: var(--r-sm);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-transcript .panel-label {
  background: var(--purple);
}

.transcript-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.speaker-role-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  background: var(--purple-soft);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
}

.speaker-role-controls[hidden] {
  display: none;
}

.speaker-role-hint {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.speaker-role-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 5px 3px 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
}

.speaker-role-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.speaker-role-select {
  height: 26px;
  min-width: 78px;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  padding: 0 24px 0 8px;
  font-size: 12px;
  outline: none;
}

.speaker-role-swap {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}

.speaker-role-swap:hover {
  background: var(--brand);
  color: #FFFFFF;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  background: #FFFFFF;
  color: var(--ink-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--r-pill);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 追问建议列表 */
.suggestions-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  /* 左右留出列切换箭头的空间 */
  padding: 16px 44px;
  display: flex;
}

/* 观察板：三列（一页纸概览 / 资料追问 / 现场观察），视口同时显示两列，箭头滑动切换
   三列各自独立纵向滚动，切换列不重新渲染 */
.board-viewport {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.board-track {
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 100%;
  transition: transform 0.28s ease;
}

/* 列宽 =（视口宽 − 2×列间距 12px − 露出宽 28px）/ 2
   位置 0：第三列在最右侧露出 28px；位置 1：第一列在最左侧露出 28px
   切换位移 = −50% + (1.5×露出宽 + 列间距) = −50% + 54px */
.board-viewport[data-board-position="1"] .board-track {
  transform: translateX(calc(-50% + 54px));
}

.board-column {
  flex: 0 0 calc((100% - 52px) / 2);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.column-title {
  font-size: 14px;
  font-weight: 700;
}

/* 有资料时「一页纸概览」标题可点，打开资料预览（可重新提取追问） */
.column-title-btn {
  cursor: pointer;
  transition: color var(--t);
}

.column-title-btn:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.column-count {
  min-width: 22px;
  padding: 0 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  text-align: center;
}

/* 每一列自己滚动，互不影响 */
.column-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 概览列直接铺在列容器上，避免嵌套滚动 */
.board-column .material-preview {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: none;
  overflow-wrap: anywhere;
}

.board-column .material-preview h1,
.board-column .material-preview h2,
.board-column .material-preview h3 {
  font-size: 15px;
}

.board-column .material-preview h1:first-child,
.board-column .material-preview h2:first-child,
.board-column .material-preview h3:first-child {
  margin-top: 0;
}

/* 列切换箭头：浮在面板两侧，到边界自动隐藏 */
.board-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--brand);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--brand);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.board-nav:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand);
  color: #FFFFFF;
}

.board-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.board-nav-prev {
  left: 2px;
}

.board-nav-next {
  right: 2px;
}

/* ── 悬浮按钮 ──────────────────────────────────────────── */
.fab-stack {
  position: fixed;
  right: 22px;
  bottom: 58px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fab {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-panel);
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--t), background var(--t), color var(--t), box-shadow var(--t);
}

.fab:hover {
  transform: translateY(-2px);
}

.fab svg {
  width: 24px;
  height: 24px;
}

.fab svg path {
  fill: currentColor;
}

.fab svg path[fill="none"] {
  fill: none;
}

.fab svg[hidden] {
  display: none;
}

/* 场景 / 音频源：显示当前项首字（音频）/ 末字（场景）的切换悬浮按钮 */
.fab-char-btn {
  color: var(--brand);
  border-color: var(--brand);
}

.fab-char-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.fab-char {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

/* 场景 / 音频源弹窗里的可选项 */
.picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.picker-item {
  min-height: 34px;
  padding: 0 14px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}

.picker-item:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.picker-item.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

/* 工具栏里已改为悬浮按钮的控件只作为取值来源保留 */
.hidden-controls {
  display: none;
}

.fab.recording {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
  animation: fabPulse 1.6s ease-in-out infinite;
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 68, 107, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(232, 68, 107, 0); }
}

/* ── 转写弹窗 ──────────────────────────────────────────── */
.transcript-modal-panel {
  width: min(1200px, 94vw);
}

.transcript-modal-panel .transcript-list {
  flex: 1;
  min-height: 45vh;
  max-height: 70vh;
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
}

/* ── 弹窗全屏 / 自适应 ────────────────────────────────── */
.prompt-modal.is-fullscreen {
  padding: 0;
}

.prompt-modal.is-fullscreen .prompt-modal-panel {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

/* ── AI 会话（模型交互记录）弹窗 ──────────────────────── */
.llm-trace-panel {
  width: min(1200px, 94vw);
}

.llm-trace-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.llm-trace-empty {
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ── 测试模式：AI 会话弹窗内注入测试转写 ─────────────────── */
.test-transcript-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--brand);
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.test-transcript-panel[hidden] {
  display: none;
}

.test-transcript-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.test-transcript-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-strong);
}

.test-transcript-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.test-transcript-hint code {
  padding: 1px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
}

.test-transcript-input {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  background: var(--bg-panel);
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

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

.test-transcript-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.test-transcript-count {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.test-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.test-mode-badge[hidden] {
  display: none;
}

.llm-trace-card {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
}

.llm-trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.llm-trace-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.llm-trace-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.llm-trace-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.llm-trace-block-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-strong);
}

.llm-trace-block-body {
  padding: 8px 10px;
  max-height: 320px;
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 默认只露 2 行，点「展开」看全文 */
.llm-trace-block-body.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: none;
  overflow: hidden;
}

.llm-trace-block-toggle[hidden] {
  display: none;
}

.llm-trace-error {
  padding: 8px 10px;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  color: var(--brand-strong);
  font-size: 12px;
}

/* ── 场次列表 ──────────────────────────────────────────── */
.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
}

.session-card-main {
  min-width: 0;
}

.session-card-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.session-card-stats {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.session-card-id {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.session-card-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

/* ── 切换在场人确认弹窗 ────────────────────────────────── */
.switch-confirm-panel {
  width: min(560px, 100%);
}

.switch-confirm-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
}

.switch-confirm-body p {
  margin: 0 0 8px;
}

.switch-confirm-body ul {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--text-muted);
}

.switch-confirm-body ul li {
  margin: 4px 0;
}

.switch-confirm-warn {
  padding: 8px 10px;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  color: var(--brand-strong);
  font-size: 12px;
}

.suggestion-group {
  animation: slideIn 0.24s linear;
}

.suggestion-group .group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.suggestion-group .group-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.suggestion-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  padding: 14px 18px 15px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), box-shadow var(--t), opacity var(--t);
  animation: slideIn 0.24s linear;
}

.suggestion-card + .suggestion-card {
  margin-top: 10px;
}

.suggestion-card:first-of-type {
  background: var(--brand-soft);
  border-color: var(--brand);
  border-left-color: var(--brand);
}

.suggestion-card.tag-fact,
.suggestion-card.tag-material,
.suggestion-card.tag-icebreaker {
  border-left-color: var(--brand);
}

.suggestion-card.tag-risk,
.suggestion-card.tag-boundary {
  border-left-color: var(--danger);
}

.suggestion-card.tag-action,
.suggestion-card.tag-structure,
.suggestion-card.tag-share {
  border-left-color: var(--success);
}

.suggestion-card.tag-deal,
.suggestion-card.tag-intent,
.suggestion-card.tag-question,
.suggestion-card.tag-empathy,
.suggestion-card.tag-transition {
  border-left-color: var(--purple);
}

.suggestion-card.review-card {
  border-left-color: var(--purple);
  background: var(--purple-soft);
}

.suggestion-group.deep-group {
  margin-bottom: 18px;
}

.suggestion-group.deep-group .deep-header {
  color: var(--purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.suggestion-group.deep-group .deep-header::after {
  background: linear-gradient(90deg, var(--purple), var(--border-color));
}

.deep-notice {
  width: fit-content;
  margin: 0 2px 9px;
  padding: 5px 9px;
  background: var(--purple-soft);
  border: 1px solid var(--purple);
  border-radius: var(--r-sm);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
}

.suggestion-card.deep-card {
  background: var(--purple-soft);
  border-color: var(--purple);
  border-left-color: var(--purple);
}

.suggestion-card.deep-card:first-of-type {
  background: #EBE0F8;
  border-color: var(--purple);
  border-left-color: var(--purple);
}

.deep-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.deep-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  background: var(--purple);
  border-radius: var(--r-sm);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deep-meta .suggestion-tag {
  margin-bottom: 0;
}

.suggestion-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 0 7px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.suggestion-card .deep-question {
  font-size: 20px;
  line-height: 1.5;
}

.suggestion-card:first-of-type .deep-question {
  font-size: 21px;
}

.suggestion-detail {
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.suggestion-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-tight);
}

.suggestion-card.used {
  opacity: 0.44;
  border-left-color: var(--ink-muted);
}

/* 卡片右上角「投屏」放大镜按钮 */
.card-project-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity var(--t), color var(--t), border-color var(--t), background var(--t);
}

.suggestion-card:hover .card-project-btn {
  opacity: 1;
}

.card-project-btn:hover {
  color: #FFFFFF;
  background: var(--brand);
  border-color: var(--brand);
}

.card-project-btn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.suggestion-card .suggestion-time {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.suggestion-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 0 9px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.suggestion-card .suggestion-text {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.suggestion-card:first-of-type .suggestion-text {
  color: var(--brand-strong);
  font-size: 19px;
}

/* 转写区 */
.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--bg-panel);
}

.transcript-line {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 7px 0 8px;
  font-size: 16px;
  line-height: 1.8;
  animation: fadeIn 0.18s linear;
  overflow-wrap: anywhere;
}

.transcript-line .timestamp {
  display: inline-flex;
  margin-right: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  vertical-align: 1px;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-right: 9px;
  padding: 0 9px;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--r-pill);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.speaker-chip[hidden] {
  display: none;
}

.transcript-content {
  overflow-wrap: anywhere;
}

/* 连续转写流：一整块文本，说话人标签内联，不再逐条分行 */
.transcript-stream {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.transcript-speaker {
  margin-right: 4px;
  color: var(--brand-strong);
  font-weight: 700;
}

.transcript-text {
  overflow-wrap: anywhere;
}

.transcript-text.interim {
  color: var(--text-muted);
}

.transcript-line.interim-line {
  margin: 1px 0;
  padding: 8px 10px;
  border: 1px dashed var(--purple);
  border-radius: var(--r-md);
  background: var(--purple-soft);
  color: var(--ink-soft);
}

.transcript-line.interim-line .timestamp {
  color: var(--purple);
}

.interim-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-right: 9px;
  padding: 0 9px;
  background: var(--purple);
  border: 1px solid var(--purple);
  border-radius: var(--r-pill);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  padding: 32px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state::before {
  content: "";
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand), var(--purple));
  animation: brandBreath 2.6s linear infinite alternate;
}

.empty-state p {
  max-width: 360px;
  margin-bottom: 7px;
  font-size: 15px;
}

.empty-state .hint {
  color: var(--ink-muted);
  font-size: 13px;
}

/* 底部状态栏 */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 7px 22px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.status-left,
.status-center,
.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 24px;
}

.status-center {
  justify-content: center;
  flex-wrap: wrap;
}

.status-right {
  justify-content: flex-end;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--t), box-shadow var(--t);
  flex: 0 0 auto;
}

.status-dot.ready {
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.status-dot.recording {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.16);
  animation: pulse 1.5s linear infinite;
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.16);
}

/* 运行状态文字（由 JS 切换 class） */
.is-ok {
  color: var(--success) !important;
}

.is-warn {
  color: var(--warning) !important;
}

.is-error {
  color: var(--danger) !important;
}

.separator {
  color: var(--border-color);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #D4D4D8;
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* 动画 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

@keyframes brandShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes brandBreath {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.55; transform: scale(0.92); }
}

/* 响应式 */
@media (max-width: 1120px) {
  .toolbar {
    grid-template-columns: minmax(220px, auto) 1fr;
    grid-template-areas:
      "brand script"
      "controls controls"
      "custom custom";
  }

  .toolbar-center {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 46vh) minmax(420px, 1fr);
    min-height: auto;
    overflow: visible;
  }

  .panel {
    min-height: 0;
  }

  .suggestion-card .suggestion-text {
    font-size: 17px;
  }

  .suggestion-card:first-of-type .suggestion-text {
    font-size: 18px;
  }

  .suggestion-card .deep-question,
  .suggestion-card:first-of-type .deep-question {
    font-size: 19px;
  }
}

@media (max-width: 680px) {
  .toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "controls"
      "script"
      "custom";
    min-height: 0;
    padding: 12px;
  }

  .toolbar-left {
    align-items: center;
  }

  .toolbar-center {
    align-items: stretch;
  }

  .audio-source,
  .scene-mode {
    width: 100%;
  }

  .audio-source select,
  .scene-mode select,
  .btn,
  .upload-btn,
  .btn-deep-toggle {
    width: 100%;
    max-width: none;
  }

  .toolbar-right {
    justify-content: flex-start;
  }

  .script-status {
    max-width: 100%;
    text-align: left;
  }

  .custom-prompt-row {
    flex-direction: column;
  }

  .custom-prompt-row label {
    padding-top: 0;
  }

  .main-content {
    padding: 8px;
    gap: 8px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .transcript-actions {
    justify-content: flex-start;
  }

  .statusbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-center,
  .status-right {
    justify-content: flex-start;
  }
}

/* 场景提示词弹窗 */
.prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(52, 58, 64, 0.5);
}

.prompt-modal[hidden] {
  display: none;
}

.prompt-modal-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(860px, 100%);
  max-height: 86vh;
  padding: 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--brand);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}

.prompt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.prompt-editor {
  flex: 1;
  min-height: 320px;
  padding: 14px;
  background: var(--bg-secondary);
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.prompt-editor:focus {
  border-color: var(--brand);
}

.prompt-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.prompt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── 访问口令遮罩（全屏黑色遮罩，进入系统前拦截）────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.77);
  backdrop-filter: blur(2px);
}

.auth-gate[hidden] {
  display: none;
}

/* 口令连续错误被锁定：整屏纯黑，只留提示，无法关闭 */
.auth-gate.is-locked {
  z-index: 400;
  background: #000000;
  backdrop-filter: none;
}

.auth-gate.is-locked .auth-gate-panel {
  border-top-color: var(--danger);
}

.auth-gate.is-locked .auth-gate-hint {
  color: var(--danger);
  font-weight: 700;
}

.auth-gate-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, 100%);
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--brand);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}

.auth-gate-badge {
  align-self: flex-start;
  padding: 2px 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-gate-panel h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.auth-gate-hint {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.auth-gate-input {
  height: 40px;
  padding: 0 12px;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  font-size: 14px;
  outline: none;
}

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

.auth-gate-error {
  min-height: 16px;
  font-size: 12px;
  color: var(--brand-strong);
}

.auth-gate-submit {
  align-self: flex-end;
}

/* ── 使用说明弹窗 ──────────────────────────────────────── */
.help-modal-panel {
  width: min(760px, 100%);
}

.help-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.7;
}

.help-section h4 {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}

.help-section p {
  color: var(--text-muted);
}

.help-section ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.help-table th,
.help-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
}

.help-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.help-table td {
  color: var(--text-muted);
}

.help-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}

/* ── 使用说明：流程图 ──────────────────────────────────── */
.help-flow {
  display: flex;
  flex-direction: column;
}

.help-flow-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
}

.help-flow-idx {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--brand);
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}

.help-flow-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.help-flow-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.help-flow-arrow {
  align-self: center;
  padding: 3px 0;
  color: var(--brand);
  font-size: 12px;
  line-height: 1;
}

/* ── 已加载资料预览 ────────────────────────────────────── */
.script-status.has-material {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-modal-panel {
  width: min(860px, 100%);
}

.material-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.material-preview {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink);
}

.material-preview h1,
.material-preview h2,
.material-preview h3,
.material-preview h4,
.material-preview h5,
.material-preview h6 {
  margin: 18px 0 8px;
  line-height: 1.4;
}

.material-preview h1 { font-size: 20px; }
.material-preview h2 { font-size: 17px; }
.material-preview h3 { font-size: 15px; }

.material-preview h1:first-child,
.material-preview h2:first-child,
.material-preview h3:first-child {
  margin-top: 0;
}

.material-preview p {
  margin: 8px 0;
}

.material-preview ul,
.material-preview ol {
  margin: 8px 0;
  padding-left: 22px;
}

.material-preview li {
  margin: 4px 0;
}

.material-preview blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid var(--brand);
  color: var(--text-muted);
}

.material-preview code {
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.material-preview pre {
  margin: 10px 0;
  padding: 12px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--r-md);
}

.material-preview pre code {
  padding: 0;
  background: none;
}

.material-preview table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 12.5px;
}

.material-preview th,
.material-preview td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border-color);
}

.material-preview th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
}

.material-preview hr {
  margin: 16px 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

.material-preview a {
  color: var(--brand);
}

/* ── 评委投屏视图 ──────────────────────────────────────── */
.projection-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 36px;
  background: #0f1720;
  color: #f5f7fa;
}

.projection-view[hidden] {
  display: none;
}

.projection-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.projection-scene {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #9fb0c0;
}

.projection-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 28px;
  min-height: 0;
}

.projection-label {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #7f93a5;
}

.projection-question {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 滚筒：当前问题固定在正中，上下各排相邻问题，越靠外字号越小 */
.projection-drum {
  /* 各级问题固定槽高，保证换问题时位置不跳动 */
  --drum-current-h: clamp(140px, 22vh, 260px);
  --drum-near-h: clamp(60px, 8.5vh, 104px);
  --drum-far-h: clamp(50px, 7vh, 86px);
  --drum-gap: 10px;
  /* 上方两个问题间隔更大 */
  --drum-above-gap: 26px;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.projection-drum-empty {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  color: #7f93a5;
  font-size: clamp(18px, 1.8vw, 24px);
  text-align: center;
}

/* 上 / 下两组：绝对定位锚在中间问题两侧，内容变化不影响中线 */
.projection-drum-above,
.projection-drum-below {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--drum-gap);
  overflow: hidden;
}

.projection-drum-above {
  bottom: calc(50% + var(--drum-current-real-h, var(--drum-current-h)) / 2 + var(--drum-gap));
  gap: var(--drum-above-gap);
}

.projection-drum-below {
  top: calc(50% + var(--drum-current-real-h, var(--drum-current-h)) / 2 + var(--drum-gap));
}

/* 隐藏问题列表：只保留当前问题 */
.projection-drum.is-list-hidden .projection-drum-above,
.projection-drum.is-list-hidden .projection-drum-below {
  display: none;
}

.projection-drum-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #c7d3de;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  overflow: hidden;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.projection-drum-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #c7d3de;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.projection-drum-text {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 当前问题：固定在中线、最小高度，内容过长可自动撑高 */
.projection-drum-item.is-current {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  min-height: var(--drum-current-h);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 700;
  line-height: 1.45;
}

.projection-drum-item.is-current .projection-drum-text {
  -webkit-line-clamp: unset;
  display: block;
}

.projection-drum-item.is-current .projection-drum-index {
  background: var(--brand);
  color: #ffffff;
}

/* 上下相邻：固定槽高、中等字号，最多 2 行 */
.projection-drum-item.is-near {
  height: var(--drum-near-h);
  font-size: clamp(18px, 1.9vw, 26px);
  cursor: pointer;
  opacity: 0.85;
}

/* 最上 / 最下：固定槽高、最小字号，最多 2 行 */
.projection-drum-item.is-far {
  height: var(--drum-far-h);
  font-size: clamp(15px, 1.5vw, 20px);
  cursor: pointer;
  opacity: 0.6;
}

.projection-drum-item.is-near:hover,
.projection-drum-item.is-far:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  opacity: 1;
}

.projection-question-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.projection-index {
  font-size: 14px;
  color: #9fb0c0;
}

/* 切换动效：只让文字滚动（无透明度变化，块与背景保持不动） */
@keyframes projectionRollUp {
  from {
    transform: translateY(14px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes projectionRollDown {
  from {
    transform: translateY(-14px);
  }
  to {
    transform: translateY(0);
  }
}

.projection-roll-next {
  animation: projectionRollUp 0.22s ease-out;
}

.projection-roll-prev {
  animation: projectionRollDown 0.28s ease;
}

.projection-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.projection-obs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projection-obs {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.projection-obs-tag {
  flex-shrink: 0;
  color: #ffd479;
  font-weight: 600;
}

.projection-empty {
  color: #7f93a5;
}

.projection-transcript {
  flex-shrink: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.projection-transcript-text {
  font-size: clamp(18px, 1.6vw, 26px);
  line-height: 1.7;
  color: #dbe4ee;
}

@media (max-width: 900px) {
  .projection-main {
    grid-template-columns: 1fr;
  }
}
