/* ═══════════════════════════════════════════════════════════════
 * enhance.css — 阶段 1 前端增强样式
 * 追加到 app.css 末尾即可。所有样式都是叠加性的,不覆盖已有规则。
 * ═══════════════════════════════════════════════════════════════ */

/* ─── ① 时间选择器 ────────────────────────────────────────── */
.time-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.time-quick {
  /* 复用 .tag 已有样式,这里只加点独特的标识 */
}

.time-divider {
  width: 1px;
  height: 18px;
  background: var(--border2);
  margin: 0 4px;
}

.year-select-wrap {
  display: inline-flex;
  align-items: center;
}

.year-select {
  background: var(--card);
  color: var(--text);
  border: none;
  box-shadow: inset 0 0 0 0.5px var(--border2);
  border-radius: 999px;
  padding: 0.35rem 2rem 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5L5 6.5L8 3.5' fill='none' stroke='%2385776A' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: all 0.15s;
}
.year-select:hover { box-shadow: inset 0 0 0 0.5px var(--gold); }
.year-select:focus { box-shadow: inset 0 0 0 1px var(--gold); }

.month-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  flex: 1;
  min-width: 260px;
}
.month-cell {
  text-align: center;
  font-size: 0.78rem;
  padding: 0.3rem 0.2rem;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  background: var(--card);
  box-shadow: inset 0 0 0 0.5px var(--border2);
  transition: all 0.15s;
}
.month-cell:hover { color: var(--text); box-shadow: inset 0 0 0 0.5px var(--gold); }
.month-cell.on { background: var(--text); color: var(--bg); box-shadow: none; font-weight: 500; }
.month-cell.disabled {
  color: var(--dim);
  cursor: not-allowed;
  background: transparent;
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.month-cell.disabled:hover { color: var(--dim); box-shadow: inset 0 0 0 0.5px var(--border); }

/* ─── ② 侧边栏主播分组 ────────────────────────────────────── */
.anchor-groups {
  margin: 2px 0 6px 8px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}
.anchor-groups .nav-item.sub {
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  gap: 8px;
}
.anchor-groups .nav-item.sub .group-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  flex-shrink: 0;
}
.anchor-groups .nav-item.sub.active .group-icon { color: var(--gold); }
.anchor-groups .nav-item.sub > span:nth-child(2) { flex: 1; }
.anchor-groups .nav-item.sub .group-count {
  font-size: 0.72rem;
  color: var(--dim);
  padding: 1px 7px;
  background: var(--bg);
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.anchor-groups .nav-item.sub.active .group-count { color: var(--gold); background: rgba(107, 84, 66, 0.1); }

/* ─── ③ 视图切换按钮 ──────────────────────────────────────── */
.view-toggle-btn {
  background: var(--card);
  border: none;
  box-shadow: inset 0 0 0 0.5px var(--border2);
  color: var(--muted);
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.view-toggle-btn:hover { color: var(--gold); box-shadow: inset 0 0 0 0.5px var(--gold); }
.view-toggle-btn .vt-icon-list { display: none; }
.view-toggle-btn .vt-icon-card { display: inline; }
.view-toggle-btn.is-compact .vt-icon-card { display: none; }
.view-toggle-btn.is-compact .vt-icon-list { display: inline; }

/* 紧凑视图:压缩卡片间距 + 隐藏头像 */
body.view-compact .anchor-card {
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
body.view-compact .anchor-head {
  padding: 0.65rem 0.9rem;
}
body.view-compact .anc-av {
  width: 28px;
  height: 28px;
  font-size: 0.85rem;
}
body.view-compact .session-item {
  padding: 0.5rem 0.9rem;
}
body.view-compact .s-bar {
  height: 28px;
}
body.view-compact .s-chips {
  margin-top: 2px;
}
body.view-compact .sessions {
  /* 紧凑模式下 session 行间加浅分隔 */
}

/* ─── ⑤ 主播星标按钮 ──────────────────────────────────────── */
.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dim);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
  user-select: none;
}
.fav-star:hover { color: var(--gold); background: var(--hover); }
.fav-star.on { color: var(--gold); }
.fav-star.on:hover { color: var(--gold2); }

/* 紧凑视图下星标稍小 */
body.view-compact .fav-star { font-size: 0.95rem; padding: 4px; }

/* ─── 响应式微调 ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .month-grid { grid-template-columns: repeat(6, 1fr); }
  .time-selector { gap: 6px; }
}

@media (max-width: 640px) {
  .month-grid { grid-template-columns: repeat(4, 1fr); }
  .year-select { font-size: 0.78rem; padding: 0.3rem 1.8rem 0.3rem 0.75rem; }
  .view-toggle-btn { padding: 0.3rem 0.45rem; }

  /* 移动端:侧边栏分组缩进更紧凑 */
  .anchor-groups { margin-left: 6px; padding-left: 5px; }
  .anchor-groups .nav-item.sub { font-size: 0.8rem; padding: 0.45rem 0.55rem; }
}

/* ═══════════════════════════════════════════════════════════════
 * polish.css — 字幕面板 & 详情弹窗美化(追加)
 * ═══════════════════════════════════════════════════════════════ */

/* 字幕面板容器:定位父元素 */
.subtitle-panel {
  position: relative;
  margin-top: 0.5rem;
  background: var(--card);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 0.5px var(--border2);
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 字幕滚动区 */
.subtitle-panel .sub-scroll {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
  padding: 4px 0;
}
.subtitle-panel .sub-scroll::-webkit-scrollbar { width: 4px; }
.subtitle-panel .sub-scroll::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }

/* 展开模式 */
.subtitle-panel.sub-expanded .sub-scroll {
  max-height: 440px;
}

/* 字幕行:更大间距,中老年友好 */
.sub-line {
  display: flex;
  gap: 10px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.88rem;
  line-height: 1.65;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.sub-line:last-child { border-bottom: none; }
.sub-line:hover { background: var(--hover); }
.sub-line.active {
  background: rgba(107, 84, 66, 0.1);
  border-left: 3px solid var(--gold);
  padding-left: calc(0.85rem - 3px);
}
.sub-line.active .sub-text {
  color: var(--text);
  font-weight: 500;
}

/* 搜索命中闪烁 */
@keyframes subFlash {
  0%, 100% { background: rgba(107, 84, 66, 0.1); }
  25%, 75% { background: rgba(184, 135, 78, 0.35); }
}
.sub-line.sub-flash {
  animation: subFlash 0.6s ease-in-out 3;
}

/* 时间戳 */
.sub-ts {
  color: var(--dim);
  font-size: 0.74rem;
  flex-shrink: 0;
  min-width: 42px;
  font-family: ui-monospace, "SF Mono", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}
.sub-text { color: var(--muted); }

/* 加载中提示 */
.sub-loading {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 1rem 0.85rem;
  text-align: center;
}

/* ─── "回到当前"浮动胶囊按钮 ────────────────────────────── */
.subtitle-panel .sub-back-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(107, 84, 66, 0.3);
  font-family: inherit;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}
.subtitle-panel .sub-back-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.subtitle-panel .sub-back-btn:hover {
  background: var(--gold2);
  box-shadow: 0 6px 18px rgba(107, 84, 66, 0.4);
  transform: translateY(-1px);
}
.subtitle-panel .sub-back-btn:active {
  transform: translateY(0);
}
.subtitle-panel .sub-back-btn svg {
  flex-shrink: 0;
}

/* ─── 展开按钮(右上角小图标) ─────────────────────────── */
.subtitle-panel .sub-expand-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(107, 84, 66, 0.1);
  transition: all 0.15s;
  z-index: 2;
  opacity: 0.7;
}
.subtitle-panel:hover .sub-expand-btn { opacity: 1; }
.subtitle-panel .sub-expand-btn:hover {
  color: var(--gold);
  box-shadow: 0 2px 6px rgba(107, 84, 66, 0.2);
}
.subtitle-panel .sub-expand-btn.is-expanded {
  background: var(--gold);
  color: var(--bg);
  opacity: 1;
}

/* ─── "显示字幕"开关按钮(原有.sub-toggle-btn)美化 ──────── */
.sub-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  color: var(--gold);
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  margin-top: 0.5rem;
  border: none;
  background: var(--bg);
  border-radius: var(--r-sm);
  transition: all 0.15s;
}
.sub-toggle-btn:hover {
  background: var(--hover);
  color: var(--gold2);
}

/* ─── 详情弹窗更大一点,配合展开字幕 ──────────────────── */
.modal.session-detail-lg {
  max-width: 760px;
}
#session-modal .modal {
  max-width: 720px;
}

/* 移动端:字幕面板占更多高度 */
@media (max-width: 640px) {
  .subtitle-panel .sub-scroll { max-height: 260px; }
  .subtitle-panel.sub-expanded .sub-scroll { max-height: 60vh; }
  .sub-line { padding: 0.55rem 0.8rem; font-size: 0.92rem; }
  .subtitle-panel .sub-back-btn {
    bottom: 10px; right: 10px;
    padding: 8px 16px;
    font-size: 0.82rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v2 样式 — 播放器增强
 * ═══════════════════════════════════════════════════════════════ */

/* 播放器下方的功能条(倍速等) */
.player-extras {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding: 6px 2px;
}

/* 倍速控制 */
.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 0.5px var(--border2);
}
.speed-control .speed-label {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 6px 0 8px;
  letter-spacing: 0.04em;
}
.speed-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.74rem;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  font-variant-numeric: tabular-nums;
}
.speed-btn:hover { color: var(--text); }
.speed-btn.active {
  background: var(--gold);
  color: var(--bg);
  font-weight: 500;
}

/* ─── 字幕内搜索框 ──────────────────────────────────── */
.sub-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.sub-search-bar svg {
  color: var(--muted);
  flex-shrink: 0;
}
.sub-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.84rem;
  font-family: inherit;
  padding: 2px 0;
}
.sub-search-input::placeholder { color: var(--dim); }
.sub-search-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.88rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.sub-search-clear:hover { color: var(--text); background: var(--hover); }
.sub-search-count {
  font-size: 0.74rem;
  color: var(--muted);
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

/* 字幕高亮 */
.sub-line mark {
  background: rgba(184, 135, 78, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 500;
}

/* ─── 键盘快捷键 toast ────────────────────────────── */
#player-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(46, 40, 36, 0.9);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}
#player-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 移动端:倍速按钮更紧凑 */
@media (max-width: 640px) {
  .speed-control .speed-label { display: none; }
  .speed-btn { padding: 3px 6px; font-size: 0.72rem; }
  .sub-search-bar { padding: 7px 10px; }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v4.1 — 双击 ±10 秒视觉提示
 * ═══════════════════════════════════════════════════════════════ */

.skip-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  background: rgba(46, 40, 36, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FAF7F0;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
  animation: skipHintFade 0.65s ease-out forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  font-variant-numeric: tabular-nums;
}

.skip-hint-left  { left: 14%; }
.skip-hint-right { right: 14%; }

@keyframes skipHintFade {
  0%   { opacity: 0; transform: translateY(-50%) scale(0.8); }
  20%  { opacity: 1; transform: translateY(-50%) scale(1); }
  80%  { opacity: 1; transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) scale(1.05); }
}

/* 手机上更紧凑 */
@media (max-width: 640px) {
  .skip-hint {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  .skip-hint svg { width: 18px; height: 18px; }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v5 — 监控页增强样式
 * ═══════════════════════════════════════════════════════════════ */

/* 暂停按钮(复用 btn-ghost,加个标识) */
.progress-pause-btn {
  font-size: 0.76rem;
  padding: 0.3rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 录制中卡片呼吸灯 */
@keyframes recordingPulse {
  0%, 100% {
    box-shadow: var(--shadow-sm), 0 0 0 0 rgba(161, 60, 47, 0.4);
  }
  50% {
    box-shadow: var(--shadow), 0 0 0 6px rgba(161, 60, 47, 0);
  }
}
.progress-card.is-recording {
  animation: recordingPulse 2s ease-in-out infinite;
}
.progress-card.is-recording::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(161, 60, 47, 0.2);
  animation: recordingDotPulse 1.5s ease-in-out infinite;
}
@keyframes recordingDotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(161, 60, 47, 0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(161, 60, 47, 0); }
}
.progress-card { position: relative; }

/* 僵死诊断弹框 */
.diagnose-popup {
  position: fixed;
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  width: 320px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  font-size: 0.82rem;
  color: var(--text);
}
.diagnose-popup .dp-title {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 500;
}
.diagnose-popup .dp-list {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
}
.diagnose-popup .dp-list li {
  padding: 3px 0;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.diagnose-popup .dp-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--gold);
  font-weight: 700;
}
.diagnose-popup .dp-list code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.86em;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--gold);
}
.diagnose-popup .dp-code {
  background: var(--bg);
  padding: 5px 9px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.8rem;
  color: var(--text);
  margin: 3px 0;
  word-break: break-all;
}

/* 僵死标签本身增强提示 */
.tag-stale {
  cursor: pointer;
  transition: all 0.15s;
}
.tag-stale:hover {
  background: rgba(161, 60, 47, 0.15) !important;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
 * polish v5.2 — 监控页完整样式(原主题 CSS 丢失的补齐)
 * ═══════════════════════════════════════════════════════════════ */

/* 卡片网格 */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 1.25rem;
}

/* 进度卡片本体 */
.progress-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--border2);  /* 会被 inline style 覆盖 */
  transition: box-shadow 0.2s;
  position: relative;
}
.progress-card:hover { box-shadow: var(--shadow); }

.progress-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.progress-card-anchor {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.progress-card-url {
  font-size: 0.72rem;
  color: var(--dim);
  font-family: ui-monospace, "SF Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.progress-card-stage {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--gold);
  margin: 8px 0 10px;
  letter-spacing: 0.01em;
}
.progress-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-bar.warn .progress-bar-fill {
  background: linear-gradient(90deg, var(--gold), #d9a55a);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

/* ─── Pipeline 流程图(核心) ──────────────────────────── */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: 12px 0 6px;
  padding: 4px 0;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.pipeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border2);
  box-shadow: inset 0 0 0 1px var(--border2);
  transition: all 0.25s;
  flex-shrink: 0;
}
.pipeline-step.done .pipeline-dot {
  background: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.pipeline-step.active .pipeline-dot {
  width: 11px;
  height: 11px;
  background: var(--gold);
  box-shadow:
    inset 0 0 0 1px var(--gold),
    0 0 0 4px rgba(184, 135, 78, 0.18);
  animation: pipelineActive 1.6s ease-in-out infinite;
}

@keyframes pipelineActive {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 4px rgba(184, 135, 78, 0.18); }
  50%      { box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 8px rgba(184, 135, 78, 0); }
}

.pipeline-label {
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-weight: 400;
}
.pipeline-step.done .pipeline-label { color: var(--muted); }
.pipeline-step.active .pipeline-label {
  color: var(--gold);
  font-weight: 500;
}

/* 连接线 */
.pipeline-line {
  flex: 1;
  height: 1px;
  background: var(--border2);
  margin: 0 4px;
  position: relative;
  top: -9px;  /* 跟圆点垂直对齐(因为 label 在下方) */
  min-width: 8px;
}
/* 完成步骤之间的连接线变金色 */
.pipeline-step.done + .pipeline-line {
  background: var(--gold);
}

/* 僵死标签 */
.tag-stale {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(161, 60, 47, 0.12);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 6px;
}

/* 实时指示点(录制进程运行中) */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 133, 99, 0.2);
  animation: liveDotPulse 2s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle;
}
.live-dot.off {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(161, 60, 47, 0.2);
  animation: none;
}
@keyframes liveDotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74, 133, 99, 0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(74, 133, 99, 0); }
}

/* 移动端适配:pipeline 变得更紧凑 */
@media (max-width: 640px) {
  .progress-grid { grid-template-columns: 1fr; }
  .progress-card { padding: 14px 14px; }
  .pipeline-label { font-size: 0.66rem; }
  .pipeline-line { min-width: 4px; margin: 0 2px; }
  .progress-card-url { max-width: 140px; }
}

/* 重新适配呼吸灯:跟 box-shadow 协调 */
.progress-card.is-recording {
  animation: recordingPulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════
 * polish v5.3 — 详情弹窗板块烫金样式(书籍装帧风)
 * ═══════════════════════════════════════════════════════════════ */

/* 每个板块:顶部 2px 烫金线 + 更柔更深的阴影 */
.detail-section {
  background: var(--card);
  border: none;
  border-top: 2px solid var(--gold);
  border-radius: var(--r-md);
  padding: 1.15rem 1.15rem 1.1rem;
  box-shadow:
    0 4px 18px rgba(107, 84, 66, 0.1),
    0 1px 3px rgba(107, 84, 66, 0.05);
  margin-bottom: 18px;
  transition: box-shadow 0.2s ease;
}
.detail-section:hover {
  box-shadow:
    0 6px 24px rgba(107, 84, 66, 0.13),
    0 2px 4px rgba(107, 84, 66, 0.06);
}
.detail-section:last-child {
  margin-bottom: 0;
}

/* 标题行:底部金色虚线分隔 */
.detail-section .detail-label {
  padding-bottom: 0.55rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px dashed rgba(184, 135, 78, 0.28);
  font-size: 0.88rem;
}

/* 字数 / 文件大小等数字用等宽字体,更整齐 */
.detail-section .detail-label span:first-child {
  font-variant-numeric: tabular-nums;
}

/* 移动端:金线保持 2px,阴影稍收 */
@media (max-width: 640px) {
  .detail-section {
    padding: 1rem 0.95rem;
    margin-bottom: 14px;
    box-shadow:
      0 3px 12px rgba(107, 84, 66, 0.09),
      0 1px 2px rgba(107, 84, 66, 0.04);
  }
  .detail-section .detail-label {
    padding-bottom: 0.5rem;
    margin-bottom: 0.7rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v5.4 — 监控页顶部状态栏窄屏修复
 * ═══════════════════════════════════════════════════════════════ */

/* 这个 stat-card 被 main.js 写了 inline style: display:flex;gap:10px
   窄屏下会把文字挤成竖列,必须覆盖它 */

/* 宽屏:让 3 段文字不挤(主体文字优先,右侧时间次要) */
#admin-content .stat-card[style*="display:flex"] {
  flex-wrap: wrap;
  row-gap: 4px !important;
  column-gap: 14px !important;
}
#admin-content .stat-card[style*="display:flex"] > div {
  min-width: 0;      /* 允许子元素缩小,不把父撑爆 */
  white-space: nowrap;
}

/* 窄屏:3 段文字堆叠成竖列 */
@media (max-width: 700px) {
  #admin-content .stat-card[style*="display:flex"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 4px !important;
  }
  #admin-content .stat-card[style*="display:flex"] > div {
    white-space: normal;
    width: 100%;
  }
  /* 主状态那句不要 flex:1,避免被 min-content 压缩 */
  #admin-content .stat-card[style*="display:flex"] > div:nth-child(2) {
    flex: unset !important;
  }
}

/* Pipeline 在窄屏下进一步优化:标签不要换行,连接线再短 */
@media (max-width: 500px) {
  .pipeline { padding: 2px 0; }
  .pipeline-dot { width: 8px; height: 8px; }
  .pipeline-step.active .pipeline-dot { width: 10px; height: 10px; }
  .pipeline-label { font-size: 0.62rem; }
  .pipeline-line { min-width: 3px; margin: 0 1px; top: -8px; }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v5.5 — 录制列表:文稿 chip + 时间不换行 + 手机端两行布局
 * ═══════════════════════════════════════════════════════════════ */

/* 文稿标签:金棕色 */
.chip-text {
  background: rgba(184, 135, 78, 0.15);
  color: var(--gold2);
}

/* 时间不换行(关键修复) */
.s-date {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 手机端 session-item (v13d: 点击空白处能进详情) */
@media (max-width: 640px) {
  .session-item {
    flex-wrap: wrap;
    row-gap: 4px;
    position: relative;
    cursor: pointer;
  }
  .session-item .s-info {
    flex: 1 1 auto;
    min-width: 0;
  }
  .session-item .s-words {
    flex-shrink: 0;
    margin-left: auto;
  }
  /* s-admin-btns:不铺满整行,只占实际按钮宽度
     这样容器的 onclick="stopPropagation()" 只拦住按钮周围一小圈,
     其他空白落在 session-item 本身,v13.1 的委托就能接到点击 */
  .session-item .s-admin-btns {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 2;
  }
  .session-item .bm-actions,
  .session-item .s-arrow {
    position: relative;
    z-index: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v6 — 全局 UX 打磨样式
 * ═══════════════════════════════════════════════════════════════ */

/* ─── ① Toast ─────────────────────────────────────────── */
.app-toast-wrap {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.app-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(107, 84, 66, 0.18), 0 2px 6px rgba(107, 84, 66, 0.08);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 420px;
  min-width: 200px;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.hide { opacity: 0; transform: translateY(-8px); }
.app-toast .at-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--bg);
  font-family: ui-monospace, monospace;
}
.app-toast.t-success .at-icon { background: var(--green); }
.app-toast.t-error   .at-icon { background: var(--red); }
.app-toast.t-info    .at-icon { background: var(--gold); }
.app-toast .at-msg { flex: 1; line-height: 1.45; }

@media (max-width: 640px) {
  .app-toast-wrap { top: 60px; width: calc(100% - 24px); }
  .app-toast { max-width: none; font-size: 0.84rem; }
}

/* ─── ② Modal 打开动画 ───────────────────────────────── */
.modal-overlay {
  transition: opacity 0.2s ease;
}
.modal {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}
.modal-overlay:not(.open) .modal {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
}

/* ─── ③ 键盘 Tab 聚焦金色描边 ─────────────────────────── */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.nav-item:focus-visible,
.session-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── ④ 按钮点击反馈 ──────────────────────────────────── */
.btn, button {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-clicked {
  transform: scale(0.96) !important;
  transition: transform 0.08s !important;
}

/* ─── ⑤ 滚动条统一书香色 ─────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(107, 84, 66, 0.25);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(107, 84, 66, 0.45); background-clip: padding-box; }

/* ─── ⑥ 空状态温馨化 ────────────────────────────────── */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 12px;
}
.state-box .state-icon {
  font-size: 2.4rem;
  color: var(--dim);
  opacity: 0.5;
  letter-spacing: 3px;
}
.state-box .state-msg {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.7;
}

/* ─── ⑦ 危险操作视觉警示 ─────────────────────────────── */
.btn-danger {
  transition: all 0.15s;
}
.btn-danger:hover {
  background: rgba(161, 60, 47, 0.1);
  color: var(--red);
  box-shadow: 0 0 0 1px rgba(161, 60, 47, 0.3);
}

/* ─── ⑧ topbar 滚动阴影 ─────────────────────────────── */
.topbar {
  transition: box-shadow 0.2s ease, background 0.2s ease;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(250, 247, 240, 0.85);
}
.topbar.topbar-scrolled {
  box-shadow: 0 2px 12px rgba(107, 84, 66, 0.08);
  background: rgba(250, 247, 240, 0.95);
}

/* ═══════════════════════════════════════════════════════════════
 * polish v7 — 监控页录制预览图样式
 * ═══════════════════════════════════════════════════════════════ */

.rec-preview {
  position: relative;
  margin: 10px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  cursor: zoom-in;
  box-shadow: 0 1px 4px rgba(107, 84, 66, 0.08);
}
.rec-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  background: #000;
}
.rec-preview-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rec-preview-badge.rec-ok {
  background: rgba(74, 133, 99, 0.85);
  color: #FAF7F0;
}
.rec-preview-badge.rec-bad {
  background: rgba(161, 60, 47, 0.9);
  color: #FAF7F0;
  animation: badgePulse 1.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.rec-preview-cap {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(46, 40, 36, 0.7);
  padding: 2px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 点击放大 overlay */
.rec-preview-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(46, 40, 36, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}
.rec-preview-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.rec-preview-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
 * polish v8 — 运维中心(告警 + 签名维护)样式
 * ═══════════════════════════════════════════════════════════════ */

.ax-page { padding-bottom: 2rem; }
.ax-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 1rem; flex-wrap: wrap;
}
.ax-title {
  font-size: 1.4rem; font-weight: 500; margin: 0 0 4px;
  color: var(--text); letter-spacing: 0.01em;
}
.ax-subtitle {
  font-size: 0.82rem; color: var(--muted); line-height: 1.6;
}
.ax-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ax-badge-unread {
  display: inline-block; background: var(--red); color: var(--bg);
  font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
  font-weight: 500; vertical-align: middle;
}

/* 筛选条 */
.ax-filters {
  display: flex; gap: 10px; margin-bottom: 1rem; flex-wrap: wrap;
}
.ax-select {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; font-size: 0.84rem;
  color: var(--text); cursor: pointer;
}
.ax-select:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 告警列表 */
.ax-list {
  display: flex; flex-direction: column; gap: 10px;
}
.ax-empty {
  background: var(--card); border-radius: var(--r-md);
  padding: 3rem 1rem; text-align: center; color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.ax-empty-icon {
  font-size: 2rem; color: var(--dim); opacity: 0.5; margin-bottom: 8px;
}
.ax-empty-tip { font-size: 0.78rem; color: var(--dim); margin-top: 6px; }
.ax-empty-mini { color: var(--muted); font-size: 0.84rem; padding: 1rem; text-align: center; }

/* 告警卡片 */
.ax-alert {
  background: var(--card); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--border2);
  transition: box-shadow 0.15s;
}
.ax-alert:hover { box-shadow: var(--shadow); }
.ax-alert.ax-resolved {
  opacity: 0.6;
  border-left-color: var(--dim);
}

.ax-color-red    { border-left-color: var(--red); }
.ax-color-orange { border-left-color: #C77B3F; }
.ax-color-yellow { border-left-color: #C9A35A; }
.ax-color-gray   { border-left-color: var(--dim); }

.ax-alert-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 6px;
}
.ax-alert-type {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.92rem; font-weight: 500; color: var(--text);
}
.ax-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.ax-dot-red    { background: var(--red); }
.ax-dot-orange { background: #C77B3F; }
.ax-dot-yellow { background: #C9A35A; }
.ax-dot-gray   { background: var(--dim); }

.ax-code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.74rem; color: var(--muted);
  background: var(--bg); padding: 1px 6px; border-radius: 3px;
}
.ax-resolved-tag {
  font-size: 0.7rem; color: var(--green);
  background: rgba(74, 133, 99, 0.12);
  padding: 1px 7px; border-radius: 999px;
}

.ax-alert-time {
  font-size: 0.75rem; color: var(--dim);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.ax-alert-anchor {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 4px;
}
.ax-alert-reason {
  font-size: 0.86rem; color: var(--text); line-height: 1.5; margin-bottom: 4px;
}
.ax-alert-action {
  font-size: 0.78rem; color: var(--gold2); line-height: 1.5;
  background: rgba(184, 135, 78, 0.06);
  padding: 5px 8px; border-radius: 4px; margin-top: 6px;
}

.ax-alert-footer {
  display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end;
}
.ax-mini-btn {
  font-size: 0.74rem; padding: 3px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; color: var(--text);
  transition: all 0.15s;
}
.ax-mini-btn:hover { background: var(--border); }
.ax-mini-primary {
  background: var(--gold); color: var(--bg); border-color: var(--gold);
}
.ax-mini-primary:hover { background: var(--gold2); }
.ax-mini-danger { color: var(--red); }
.ax-mini-danger:hover { background: rgba(161, 60, 47, 0.1); }

.ax-alert-detail {
  display: none;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border2);
  font-size: 0.8rem; color: var(--muted); line-height: 1.7;
}
.ax-alert-detail.open { display: block; }
.ax-alert-detail b { color: var(--text); }
.ax-alert-detail > div { margin-bottom: 6px; }
.ax-raw {
  background: var(--bg); padding: 8px 10px;
  border-radius: 4px; max-height: 220px; overflow: auto;
  font-family: ui-monospace, monospace; font-size: 0.74rem;
  color: var(--text); white-space: pre-wrap; word-break: break-all;
  margin: 4px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
 * 签名维护页样式
 * ═══════════════════════════════════════════════════════════════ */

.ax-section { margin-top: 1.5rem; }
.ax-h3 {
  font-size: 1.05rem; font-weight: 500; color: var(--text);
  margin: 0 0 0.8rem; letter-spacing: 0.01em;
}

.sig-card {
  background: var(--card); border-radius: var(--r-md);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
  border-top: 2px solid var(--gold);
}

.sig-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .sig-row { flex-direction: column; align-items: stretch; }
  .sig-arrow { display: none; }
}

.sig-cell {
  flex: 1; background: var(--bg);
  border-radius: 8px; padding: 12px 14px;
}
.sig-arrow {
  font-size: 1.4rem; color: var(--gold); flex-shrink: 0;
}
.sig-label {
  font-size: 0.74rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; font-weight: 500;
}
.sig-value code {
  font-family: ui-monospace, monospace;
  font-size: 0.92rem; font-weight: 500;
  color: var(--gold2); background: transparent; padding: 0;
}
.sig-meta {
  font-size: 0.72rem; color: var(--dim);
  margin-top: 4px; line-height: 1.5;
}
.sig-meta a { color: var(--gold); text-decoration: none; }
.sig-meta a:hover { text-decoration: underline; }

.sig-status-row {
  display: flex; justify-content: center;
  margin: 1rem 0;
}
.sig-badge {
  display: inline-flex; align-items: center;
  font-size: 0.84rem; font-weight: 500;
  padding: 6px 18px; border-radius: 999px;
}
.sig-badge.sig-ok {
  background: rgba(74, 133, 99, 0.12); color: var(--green);
}
.sig-badge.sig-warn {
  background: rgba(184, 135, 78, 0.15); color: var(--gold2);
}
.sig-badge.sig-bad {
  background: rgba(161, 60, 47, 0.12); color: var(--red);
}

.sig-actions {
  display: flex; gap: 10px; margin: 1rem 0; flex-wrap: wrap;
  justify-content: center;
}

.sig-tip {
  font-size: 0.78rem; color: var(--muted);
  background: var(--bg); padding: 10px 14px;
  border-radius: 6px; line-height: 1.7;
  margin-top: 1rem;
}
.sig-tip b { color: var(--text); }

/* 备份表 */
.sig-backup-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); font-size: 0.84rem;
}
.sig-backup-table th {
  background: var(--bg); padding: 10px 12px;
  font-size: 0.74rem; font-weight: 500;
  color: var(--muted); text-align: left;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.sig-backup-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.sig-backup-table tr:last-child td { border-bottom: none; }
.sig-backup-table code {
  font-family: ui-monospace, monospace; font-size: 0.78rem;
  color: var(--gold2); background: transparent; padding: 0;
}
@media (max-width: 640px) {
  .sig-backup-table th, .sig-backup-table td {
    padding: 8px 8px; font-size: 0.78rem;
  }
}

/* btn-primary 给签名更新主按钮(如果原 app.css 没有) */
.btn-primary {
  background: var(--gold); color: var(--bg);
  border: 1px solid var(--gold);
}
.btn-primary:hover { background: var(--gold2); border-color: var(--gold2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════
 * polish v9 — 全部录制:直播中标记
 * ═══════════════════════════════════════════════════════════════ */

.live-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 2px 10px 2px 8px;
  background: rgba(161, 60, 47, 0.12);
  color: var(--red);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.live-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(161, 60, 47, 0.6); }
  50%      { opacity: 0.8; box-shadow: 0 0 0 4px rgba(161, 60, 47, 0); }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v9 — pipeline 兜底提示(阶段识别不出时显示)
 * ═══════════════════════════════════════════════════════════════ */

.pipeline-inferred-tip {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 2px 0 0;
  font-style: italic;
  opacity: 0.7;
}

/* 确保文稿 chip 样式优先级(之前加过,这里再确认) */
.chip.chip-text {
  background: rgba(184, 135, 78, 0.15) !important;
  color: var(--gold2) !important;
}

/* ═══════════════════════════════════════════════════════════════
 * polish v10 — 侧栏子分组标签(管理菜单内的"运维"小标题)
 * ═══════════════════════════════════════════════════════════════ */

.nav-subsection-label {
  font-size: 0.64rem;
  color: var(--dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem 0.65rem 0.3rem 0.85rem;
  margin-top: 0.25rem;
  position: relative;
  font-weight: 500;
}
/* 在子标题左边画一条淡金色细线作为视觉分组提示 */
.nav-subsection-label::before {
  content: '';
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 4px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
  transform: translateY(1px);
}

/* ═══════════════════════════════════════════════════════════════
 * polish v10 — 站点设置卡片(告警中心页顶部)+ 开关样式
 * ═══════════════════════════════════════════════════════════════ */

.site-settings-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--gold);
  margin-bottom: 1.25rem;
}
.ssc-head {
  margin-bottom: 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed rgba(184, 135, 78, 0.2);
}
.ssc-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.ssc-tip {
  font-size: 0.72rem;
  color: var(--muted);
}
.ssc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0.35rem 0;
}
.ssc-row-info {
  flex: 1;
  min-width: 0;
}
.ssc-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
}
.ssc-desc {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.6;
}

/* iOS 风格 toggle switch */
.ssc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.ssc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ssc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border2);
  border-radius: 24px;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ssc-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.ssc-switch input:checked + .ssc-slider {
  background: var(--gold);
}
.ssc-switch input:checked + .ssc-slider::before {
  transform: translateX(20px);
}
.ssc-switch input:disabled + .ssc-slider {
  opacity: 0.5;
  cursor: wait;
}

/* ═══════════════════════════════════════════════════════════════
 * polish v12 — 录制进度卡片预览图 + 全屏 lightbox
 * ═══════════════════════════════════════════════════════════════ */

.preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0.8rem 0 0.6rem;
}

.preview-thumb {
  position: relative;
  aspect-ratio: 9 / 16;  /* 竖屏直播比例 */
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}
.preview-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-thumb .preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 6px;
  font-size: 0.7rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  text-align: center;
  letter-spacing: 0.02em;
}

/* 图片还没生成(404) - 显示占位 */
.preview-thumb.preview-missing {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-thumb.preview-missing img {
  display: none;
}
.preview-thumb.preview-missing::before {
  content: '还没抽帧';
  color: var(--dim);
  font-size: 0.72rem;
}

/* 全屏查看器 */
#preview-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  animation: lightboxFadeIn 0.15s ease-out;
}
#preview-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}
#preview-lightbox .lightbox-tip {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 1rem;
  letter-spacing: 0.05em;
}
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
 * polish v13 — 失败任务的重试按钮
 * ═══════════════════════════════════════════════════════════════ */
.retry-btn {
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 0.72rem;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.retry-btn:hover {
  background: var(--gold2);
}
.retry-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ═══════════════════════════════════════════════════════════════
 * polish v13 — 视频上传页样式
 * ═══════════════════════════════════════════════════════════════ */

.upload-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-sm);
  border-top: 2px solid var(--gold);
}

.upload-row {
  margin-bottom: 1rem;
}

.upload-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.upload-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ax-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text);
  transition: border 0.15s;
}
.ax-input:focus {
  outline: none;
  border-color: var(--gold);
}

.upload-hint {
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 4px;
}

.upload-dropzone {
  position: relative;
  border: 2px dashed var(--border2);
  border-radius: 8px;
  padding: 1.8rem 1rem;
  text-align: center;
  background: var(--bg);
  transition: all 0.2s;
  cursor: pointer;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--gold);
  background: rgba(184, 135, 78, 0.05);
}
.upload-dropzone-inner {
  pointer-events: none;
}
.upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.7;
}
.upload-dropzone-text {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 4px;
}
.upload-dropzone-tip {
  font-size: 0.72rem;
  color: var(--muted);
}

#upload-file-info {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text);
}

.upload-progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.upload-progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
