:root {
  --ui-scale: 1;
  --compact-control-height: 25.92px;
  --primary-action-height: 34.56px;
  --bili-pink: #fb7299;
  --bili-blue: #00a1d6;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f7f8;
  --text-primary: #18191c;
  --text-secondary: #61666d;
  --text-muted: #9499a0;
  --border-color: #e3e5e7;
  --hover-blue-bg: #f0f9ff;
  --hover-pink-bg: #fff0f3;
  --error-bg: #fff2f0;
  --title-color: var(--bili-pink);
  --accent-color: var(--text-primary);
  --start-button-color: var(--text-primary);
  --radius-sm: 4px;
  --radius-md: 6px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  font-size: 13px; color: var(--text-primary); background: var(--bg-primary); line-height: 1.6;
}
html, body, .container { background: var(--bg-primary); }
body.ui-scale-small { --ui-scale: .9; }
body.ui-scale-large { --ui-scale: 1.1; }
body.dark-mode {
  color-scheme: dark;
  --bg-secondary: #25262b;
  --text-primary: #f1f2f3;
  --text-secondary: #c6c9ce;
  --text-muted: #92979f;
  --border-color: #3c3f46;
  --hover-blue-bg: #183846;
  --hover-pink-bg: #422933;
  --error-bg: #442629;
}

.container {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0;
  padding: 10px 8px 10px; gap: 8px; overflow: hidden; overflow-x: hidden;
}
.container::-webkit-scrollbar { width: 4px; }
.container::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.workspace-top {
  flex: 0 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  overflow: visible;
}
.workspace-top::-webkit-scrollbar { width: 4px; }
.workspace-top::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
@media (max-height: 399px) {
  .workspace-top { overflow-y: auto; overflow-x: hidden; }
}

.top-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.top-action-btn:hover {
  border-color: var(--bili-blue);
  color: var(--bili-blue);
  background: var(--hover-blue-bg);
}
.top-action-btn.server-btn {
  border-color: rgba(251, 114, 153, 0.38);
  color: var(--bili-pink);
}
.top-action-btn.server-btn:hover {
  border-color: var(--bili-pink);
  background: var(--hover-pink-bg);
}

/* ============ 通用按钮 ============ */
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-secondary);
  padding: 4px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* ============ 视频信息 ============ */
.video-info {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.video-thumb { width: 77px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.video-meta { flex: 1; min-width: 0; }
/* 视频信息未就绪时保持常规模块轮廓，用中性扫光表达加载而非选中。 */
.video-info.video-info-loading {
  position: relative; overflow: hidden; background: var(--bg-secondary);
}
.video-info.video-info-loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.58) 45%, transparent 70%);
  transform: translateX(-100%); animation: video-info-loading-sweep 1.4s ease-in-out infinite; pointer-events: none;
}
/* 默认模式外（夜间/阅读/自然）模块底色与大背景色差太小，重新加回外框避免看混。 */
body.alt-bg .video-info,
body.alt-bg .empty-actions,
body.alt-bg .result { border: 1px solid var(--border-color); }
.video-actions {
  flex: 0 0 62px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  margin-left: auto;
}
.video-actions .top-action-btn {
  width: 100%;
  height: var(--compact-control-height);
  min-height: var(--compact-control-height);
  padding: 0 4px;
}
.empty-actions {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.empty-page-message { flex: 1; min-width: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.empty-page-actions { flex-basis: 62px; margin-left: 0; }
.history-btn { color: var(--text-secondary); }
.notification-badge {
  position: absolute; top: -5px; right: -5px; z-index: 2;
  min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--bg-primary);
  border-radius: 999px; background: #ff4d4f; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
}
.notification-tip {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 12;
  width: max-content; max-width: 220px; padding: 6px 9px; border-radius: 6px;
  background: rgba(24,25,28,.94); color: #fff; font-size: 11px; line-height: 1.4;
  opacity: 0; pointer-events: none; transform: translateY(2px);
  transition: opacity .08s ease, transform .08s ease;
}
.server-btn.has-notifications:hover .notification-tip,
.server-btn.has-notifications:focus-visible .notification-tip { opacity: 1; transform: translateY(0); }
.video-title {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-title-link { color: inherit; text-decoration: none; }
.video-title-link:hover { color: var(--bili-blue); text-decoration: underline; }
.video-owner, .video-duration, .video-page { font-size: 11px; line-height: 1.3; color: var(--text-muted); }
.video-page { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes video-info-loading-sweep { to { transform: translateX(100%); } }

@media (max-width: 340px) {
  .video-actions { flex-basis: 32px; }
  .empty-page-actions { flex-basis: 32px; }
  .video-actions .top-action-btn { width: var(--compact-control-height); height: var(--compact-control-height); padding: 0; }
  .video-actions .top-action-btn span { display: none; }
  .video-actions .notification-badge:not(.hidden) { display: block; }
}

/* ============ 状态 ============ */
.advanced-notice {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 7px 10px; border: 1px solid #ffd2df; border-radius: var(--radius-md);
  color: var(--text-primary); background: var(--hover-pink-bg); font-size: 11px;
}
.advanced-notice.hidden { display: none; }
.advanced-notice-icon { flex: 0 0 auto; font-size: 13px; }
.advanced-notice-copy { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; }
.advanced-notice-copy strong { flex: 0 0 auto; font-size: 11px; }
.advanced-notice-copy span { min-width: 0; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advanced-notice-action {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 4px 9px;
  color: #fff; background: var(--bili-pink); font-family: inherit; font-size: 10px; font-weight: 700; cursor: pointer;
}
.advanced-notice-close { flex: 0 0 auto; width: 20px; height: 20px; border: 0; border-radius: 50%; color: var(--text-muted); background: transparent; font-size: 15px; line-height: 20px; cursor: pointer; }
.advanced-notice-close:hover { color: var(--text-primary); background: rgba(0,0,0,.06); }
@media (max-width: 340px) {
  .advanced-notice-copy { display: block; }
  .advanced-notice-copy strong { display: block; }
}
.status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-md);
  font-size: 12px; background: var(--bg-secondary);
}
.status-bar.error { background: var(--error-bg); color: #ff4d4f; }
.status-bar.login-required { align-items: flex-start; }
#status-text { flex: 1; min-width: 0; white-space: pre-line; }
.status-close {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: currentColor;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  opacity: 0.72;
}
.status-close:hover { background: rgba(0,0,0,0.06); opacity: 1; }
.status-bar.login-required #status-text {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.status-login-btn {
  border: 0; border-radius: 999px;
  padding: 4px 10px;
  background: var(--bili-pink);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(251, 114, 153, 0.25);
}
.status-login-btn:hover { filter: brightness(0.96); }
.status-register-btn { background: #52c41a; box-shadow: 0 2px 6px rgba(82, 196, 26, 0.25); }

/* ============ 控制区 ============ */
.controls { position: relative; display: flex; flex-direction: column; gap: 8px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }

.style-row { display: grid; grid-template-columns: minmax(0, 1fr) 25.92px 20px 52px auto; gap: 4px; align-items: center; min-height: var(--compact-control-height); }
/* 学分余额占风格行最后一列（播放速度右边），宽度按内容自适应，
   让出的空间全部由左侧风格提示词下拉栏（1fr 弹性列）承担 */
.credit-estimate-slot { display: flex; align-items: center; justify-content: stretch; min-width: 0; height: var(--compact-control-height); }
.credit-estimate-slot .credit-estimate-box { width: 100%; justify-content: flex-start; }
.style-select {
  width: 100%; min-width: 0; height: var(--compact-control-height);
  padding: 0 8px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary);
  font-size: 12px; line-height: 1; font-family: inherit; color: var(--text-primary);
  cursor: pointer; appearance: auto; transition: border-color var(--transition);
}
.style-select:focus { outline: none; border-color: var(--bili-blue); }

.custom-prompt-input {
  width: 100%; min-width: 0;
  padding: 6px 8px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font-size: 12px; font-family: inherit;
  line-height: 1.5; resize: none; transition: border-color var(--transition);
}
.custom-prompt-input:focus { outline: none; border-color: var(--bili-blue); }
.custom-prompt-input::placeholder { color: var(--text-muted); }
@keyframes style-assist-flash {
  0%, 100% { border-color: var(--bili-blue); background: var(--hover-blue-bg); }
  50% { border-color: var(--bili-pink); background: var(--hover-pink-bg); }
}
.custom-prompt-input.style-assist-highlight { animation: style-assist-flash 1.2s ease 2; }
.manage-styles-btn { width: var(--compact-control-height); height: var(--compact-control-height); color: var(--text-muted); }
.manage-styles-btn:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.mobile-summary-btn { border-color: var(--border-color); }
.mobile-summary-entry {
  width: 20px; height: 20px; padding: 0; flex: 0 0 auto;
}
.mobile-summary-entry svg { width: 20px; height: 20px; }
.mobile-summary-entry.mobile-summary-entry-locked { color: var(--text-muted); opacity: 0.38; cursor: not-allowed; filter: grayscale(1); }
.mobile-summary-entry.mobile-summary-entry-locked:hover { border-color: var(--border-color); color: var(--text-muted); background: transparent; }
.mobile-summary-entry-wrap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
}
/* 手机端总结入口的黑窗：仅在锁定（未开放）时显示「暂未开放」，替代浏览器原生 title；
   开放态不显示（按钮走原生 title，与自定义风格按钮一致） */
.mobile-summary-entry-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 100;
  max-width: min(220px, calc(100vw - 24px)); padding: 6px 9px;
  border-radius: var(--radius-sm); background: rgba(24, 25, 28, 0.94); color: #fff;
  font-size: 11px; line-height: 1.45; white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateX(-50%);
  transition: opacity 0.08s ease;
}
.mobile-summary-entry-wrap:hover .mobile-summary-entry-locked + .mobile-summary-entry-tooltip,
.mobile-summary-entry-wrap:focus-within .mobile-summary-entry-locked + .mobile-summary-entry-tooltip { opacity: 1; visibility: visible; }

/* ============ B站播放速度（按钮 + 档位弹层） ============ */
.playback-speed-wrap { position: relative; display: flex; align-items: center; width: 52px; height: var(--compact-control-height); }
.playback-speed-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: var(--compact-control-height); padding: 0 6px;
  border: 1px solid var(--border-color); border-radius: 999px;
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 11px; font-weight: 400; line-height: 1; font-family: inherit;
  white-space: nowrap; transition: all var(--transition);
}
.playback-speed-btn:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.playback-speed-btn:disabled { opacity: 0.55; cursor: default; border-color: var(--border-color); color: var(--text-muted); background: var(--bg-primary); }
.playback-speed-popover {
  position: absolute; top: 50%; right: calc(100% + 14px); transform: translateY(-50%);
  z-index: 120;
  width: 132px; padding: 6px;
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-secondary); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.playback-speed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.playback-speed-grid button {
  height: 26px; padding: 0 2px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--text-primary);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: background var(--transition);
}
.playback-speed-grid button:hover { background: var(--hover-blue-bg); }
.playback-speed-grid button.active {
  background: #3366ff; color: #fff; font-weight: 600;
}
body.dark-mode .playback-speed-grid button.active { background: #3366ff; }

/* ============ 享字按钮浮窗（评论分享） ============ */
.share-comment-wrap { position: relative; display: inline-flex; align-items: center; }
.share-comment-tooltip {
  position: absolute; right: 0; bottom: calc(100% + 7px); z-index: 100;
  width: max-content; max-width: min(240px, calc(100vw - 24px)); padding: 6px 9px;
  border-radius: var(--radius-sm); background: rgba(24, 25, 28, 0.94); color: #fff;
  font-size: 11px; line-height: 1.45; white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.share-comment-tooltip::after {
  content: ''; position: absolute; top: 100%; right: 8px;
  border: 4px solid transparent; border-top-color: rgba(24, 25, 28, 0.94);
}
/* JS 按按钮位置在侧栏可视区内定位，避免浮窗被侧栏右边缘裁切 */
.share-comment-tooltip.share-comment-tooltip-visible {
  position: fixed; right: auto; bottom: auto;
  opacity: 1; visibility: visible;
}
.share-comment-tooltip.share-comment-tooltip-visible::after {
  left: var(--share-tooltip-arrow, 50%); right: auto; transform: translateX(-50%);
}
.share-comment-tooltip.share-comment-tooltip-below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: rgba(24, 25, 28, 0.94);
}

/* ============ 手机端总结面板 ============ */
.mobile-summary-body { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.mobile-summary-card {
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-secondary); padding: 8px;
}
.mobile-summary-card-head { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.mobile-summary-card-head-compact { align-items: center; }
.mobile-summary-card-index {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  background: var(--hover-blue-bg); color: var(--bili-blue);
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.mobile-summary-card-head h4 { margin: 0; font-size: 13px; font-weight: 700; }
.mobile-summary-title-row { display: flex; align-items: center; gap: 7px; }
.mobile-summary-service-status {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border: 1px solid currentColor; border-radius: 5px; font-size: 10px; font-weight: 700;
  line-height: 1; white-space: nowrap;
}
.mobile-summary-service-available { color: #00a870; background: rgba(0, 168, 112, 0.08); }
.mobile-summary-service-unavailable { color: #f03e3e; background: rgba(240, 62, 62, 0.08); }
.mobile-summary-card-head p { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.mobile-summary-bound-text {
  margin: 6px 0 8px; font-size: 12px; line-height: 1.65; color: var(--text-primary);
}
.mobile-summary-bound-text strong { color: var(--bili-pink); font-weight: 700; }
.mobile-summary-bound-text .mobile-summary-account { color: var(--bili-blue); font-weight: 600; }
.mobile-summary-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mobile-summary-account-panel {
  margin-top: 10px; padding: 9px 10px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary);
}
.mobile-summary-account-head { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mobile-summary-account-head > span { color: var(--text-primary); font-size: 12px; font-weight: 700; }
.mobile-summary-account-actions .mobile-summary-btn { background: var(--bg-secondary); }
.mobile-summary-account-actions { flex-wrap: nowrap; }
.mobile-summary-follow-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 9px 10px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary);
}
.mobile-summary-follow-row > div { min-width: 0; }
.mobile-summary-follow-row b { display: block; color: var(--text-primary); font-size: 12px; }
.mobile-summary-follow-row span { display: block; margin-top: 1px; color: var(--text-muted); font-size: 10px; }
.mobile-summary-follow {
  flex: 0 0 auto; min-width: 70px; height: 28px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--bili-pink); color: #fff; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: filter var(--transition);
}
.mobile-summary-follow:hover { filter: brightness(0.96); }
.mobile-summary-follow.mobile-summary-followed {
  background: #e3e5e7; color: var(--text-muted); font-weight: 400; cursor: default;
}
.mobile-summary-btn {
  flex: 1 1 auto; height: 28px; padding: 0 10px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.mobile-summary-btn:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.mobile-summary-btn:disabled { opacity: 0.55; cursor: default; border-color: var(--border-color); color: var(--text-muted); background: var(--bg-primary); }
.mobile-summary-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-muted); min-height: 16px; }
.mobile-summary-hint:empty { display: none; }
.mobile-summary-manual-row { display: flex; gap: 6px; margin-top: 8px; }
.mobile-summary-manual-row.hidden { display: none; }
.mobile-summary-uid-input {
  flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 12px; font-family: inherit;
}
.mobile-summary-uid-input:focus { outline: none; border-color: var(--bili-blue); }
.mobile-summary-coming { margin: 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--text-primary); }
.mobile-summary-experiment-note { color: var(--text-muted); font-size: 11px; }
.mobile-summary-agent-preview {
  margin: 0 0 10px; overflow: hidden;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary);
}
.mobile-summary-agent-preview img { display: block; width: 100%; height: auto; }
.mobile-summary-agent-btn {
  width: 100%; min-height: 34px; padding: 7px 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--bili-blue); color: #fff; font: 600 12px/1.4 inherit; cursor: pointer;
  transition: filter var(--transition), opacity var(--transition);
}
.mobile-summary-agent-btn:hover { filter: brightness(0.96); }
.mobile-summary-agent-btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.mobile-summary-os-options { display: flex; gap: 8px; }
.mobile-summary-os-btn {
  flex: 1 1 0; min-width: 0; height: 32px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: all var(--transition); white-space: nowrap; overflow: hidden;
}
.mobile-summary-os-btn:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.mobile-summary-os-btn.mobile-summary-os-chosen {
  border-color: var(--bili-pink); color: var(--bili-pink); background: var(--hover-pink-bg);
}
.mobile-summary-os-count { margin-left: 4px; font-size: 11px; color: var(--text-muted); }
.mobile-summary-how { display: grid; gap: 6px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.mobile-summary-how strong { color: var(--bili-pink); font-weight: 700; }
.mobile-summary-how-step { display: flex; align-items: flex-start; gap: 7px; }
.mobile-summary-how-step > span:first-child {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--hover-blue-bg);
  color: var(--bili-blue); font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
}
.mobile-summary-how-note { padding-left: 25px; color: var(--text-muted); font-size: 10px; }
.mobile-summary-lookup {
  color: var(--bili-blue); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; font-weight: 600;
}
.mobile-summary-lookup:hover { color: var(--bili-pink); }
.mobile-summary-vote-bar { margin-top: 10px; }
.mobile-summary-vote-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px;
  font-size: 12px; color: var(--text-primary);
}
.mobile-summary-vote-track {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--bg-primary); border: 1px solid var(--border-color);
}
.mobile-summary-vote-seg { display: block; height: 100%; transition: width 0.35s ease; }
.mobile-summary-vote-ios { background: var(--bili-pink); }
.mobile-summary-vote-android { background: var(--bili-blue); }
.mobile-summary-progress { margin-top: 12px; }
.mobile-summary-progress-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px;
  font-size: 12px; color: var(--text-primary);
}
.mobile-summary-progress-head b { color: var(--bili-blue); font-size: 13px; }
.mobile-summary-progress-track {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--bg-primary); border: 1px solid var(--border-color);
}
.mobile-summary-progress-track > span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--bili-blue), var(--bili-pink));
  transition: width 0.35s ease;
}
.mobile-summary-progress-note {
  margin-top: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.6;
  color: var(--text-primary); background: var(--bg-primary);
  border: 1px dashed var(--border-color); border-radius: var(--radius-sm);
  white-space: pre-wrap; word-break: break-word;
}
.mobile-summary-progress-link {
  display: block; margin-top: 8px; padding: 8px 10px; font-size: 12px;
  color: var(--bili-blue); background: var(--hover-blue-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  text-decoration: none; word-break: break-all; cursor: pointer;
}
.mobile-summary-progress-link:hover { border-color: var(--bili-blue); }
.mobile-summary-progress-link::after { content: ' ↗'; }

/* 无字幕视频特征附图弹窗 */
.mobile-summary-modal-mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(24, 25, 28, 0.5);
}
.mobile-summary-modal-mask.hidden { display: none; }
.mobile-summary-modal {
  width: min(420px, 100%); max-height: 100%; overflow-y: auto;
  padding: 12px; border-radius: var(--radius-md);
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.mobile-summary-modal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.mobile-summary-modal-head b { font-size: 13px; }
.mobile-summary-figure {
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg-primary); border: 1px solid var(--border-color);
}
.msf-img { display: block; width: 100%; height: auto; border-radius: 4px; }
.mobile-summary-modal-caption {
  margin: 10px 2px 0; font-size: 11px; line-height: 1.7; color: var(--text-muted);
}

.pending-feature-tooltip-host {
  position: relative; display: inline-flex; align-items: center; flex: 0 0 auto;
}
.toolbar-row > .btn-reload { flex: 0 0 auto; }
.toolbar-row .toolbar-action-wrap > .btn-reload,
.toolbar-row .study-action-wrap > .btn-reload { width: 100%; justify-content: center; }
.toolbar-row .btn-reload svg { flex: 0 0 auto; }
.pending-feature-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  background: rgba(24,25,28,0.88); color: #fff;
  font-size: 11px; line-height: 1.4; padding: 5px 8px;
  border-radius: 4px; white-space: nowrap;
  pointer-events: none; opacity: 0 !important; transform: translateX(-50%);
  transition: opacity 0.08s ease; z-index: 100;
  visibility: hidden;
}
.pending-feature-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: rgba(24,25,28,0.88);
}
.pending-feature-tooltip-host:hover > .pending-feature-tooltip {
  opacity: 1 !important;
  visibility: visible;
}
.fact-check-feature-focus { gap: 5px; }

/* ============ 工具栏行 ============ */
.toolbar-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.toolbar-sep {
  color: var(--border-color); font-size: 14px; margin: 0 2px;
  user-select: none;
}

.btn-reload {
  display: flex; align-items: center; height: var(--compact-control-height); gap: 3px;
  padding: 2px 5px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary);
  color: var(--text-primary); font-size: 11px; line-height: 1.2; font-family: inherit;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-reload:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.toolbar-action-wrap,
.study-action-wrap { position: relative; display: flex; flex: 1 1 0; min-width: 0; }
.toolbar-action-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 7px); z-index: 100;
  width: max-content; max-width: min(260px, calc(100vw - 24px)); padding: 6px 9px;
  border-radius: var(--radius-sm); background: rgba(24,25,28,.94); color: #fff;
  font-size: 11px; line-height: 1.45; white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateX(-50%);
}
.toolbar-action-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: rgba(24,25,28,.94);
}
.toolbar-action-wrap-start .toolbar-action-tooltip { left: 0; transform: none; }
.toolbar-action-wrap-start .toolbar-action-tooltip::after { left: 18px; transform: none; }
.toolbar-action-wrap:hover .toolbar-action-tooltip,
.toolbar-action-wrap:focus-within .toolbar-action-tooltip { opacity: 1; visibility: visible; }
.study-action { font-weight: 400; }
/* 记忆闪卡/知识测验：合并进同一个按钮框，中间用相对水平约 75° 的 1px 细斜杠分隔——
   斜杠是真实元素（新增 `.study-slash`，纯色背景 + skewX(15deg) 即水平 75°），
   与工具栏同帧绘制、不再像渐变背景那样在合成线程栅格化而慢半拍出现；
   框比两侧按钮更宽（flex 2.894），框内按钮高 22px 与 24px 边框框的内容区对齐，
   字重与周边按钮一致；悬停时边框与斜杠一起变蓝 */
.study-actions-box {
  position: relative;
  display: flex;
  flex: 2.894 1 0;
  min-width: 0;
  height: var(--compact-control-height);
  border: 1px solid var(--border-color, #e3e5e7);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary, #ffffff);
}
.study-slash {
  position: absolute;
  left: 33.3333%;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--border-color, #e3e5e7);
  transform: skewX(15deg);
  pointer-events: none;
}
.study-slash-2 { left: 66.6667%; }
.study-actions-box:hover {
  border-color: var(--bili-blue, #00a1d6);
}
.study-actions-box:hover .study-slash {
  background: var(--bili-blue, #00a1d6);
}
.study-actions-box .btn-reload.study-action {
  border: 0;
  background: transparent;
  width: 100%;
  height: calc(var(--compact-control-height) - 2px);
  justify-content: center;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}
.study-actions-box .btn-reload.study-action:hover { color: var(--bili-blue, #00a1d6); }
.study-action.study-action-blocked { opacity: .5; cursor: not-allowed; }
.study-action.subtitle-pending-action:disabled { opacity: 1; cursor: not-allowed; }
.study-action-tooltip {
  position: absolute; right: 0; bottom: calc(100% + 7px); z-index: 100;
  width: max-content; max-width: min(280px, calc(100vw - 24px)); padding: 6px 9px;
  border-radius: var(--radius-sm); background: rgba(24,25,28,.94); color: #fff;
  font-size: 11px; line-height: 1.45; white-space: pre-line; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.study-action-tooltip::after {
  content: ''; position: absolute; top: 100%; right: 14px;
  border: 4px solid transparent; border-top-color: rgba(24,25,28,.94);
}
/* JS 按按钮位置在侧栏可视区内定位（居中于按钮，放不下时翻到按钮下方），
   不再被侧栏边缘裁切 */
.study-action-tooltip.study-action-tooltip-visible {
  position: fixed;
  right: auto;
  bottom: auto;
  opacity: 1;
  visibility: visible;
}
.study-action-tooltip.study-action-tooltip-visible::after {
  left: var(--study-tooltip-arrow, 50%); right: auto;
  transform: translateX(-50%);
}
.study-action-tooltip.study-action-tooltip-below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(24,25,28,.94);
}
.study-flashcards-wrap .study-action-tooltip { max-width: min(252px, calc(100vw - 24px)); }
.study-mindmap-wrap .study-action-tooltip { max-width: min(280px, calc(100vw - 24px)); }
.pending-feature {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-reload:disabled {
  cursor: not-allowed;
}
/* 子控件不二次降透明；排除 tooltip，避免「上线中」被强制显示 */
.pending-feature .btn-reload,
.pending-feature .btn-reload:disabled,
.pending-feature input,
.pending-feature > span:not(.pending-feature-tooltip),
.pending-feature .fact-check-feature-focus > span:not(.pending-feature-tooltip) {
  opacity: 1;
}
.btn-reload:disabled:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
  background: var(--bg-primary);
}
.btn-reload.subtitle-pending-action:disabled,
.btn-reload.subtitle-pending-action:disabled:hover {
  opacity: 1;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-primary);
  background: var(--bg-primary);
}
.checkbox-label.pending-feature {
  opacity: 0.43;
  cursor: not-allowed;
}
.checkbox-label.pending-feature input,
.checkbox-label.pending-feature span:not(.pending-feature-tooltip) {
  cursor: not-allowed;
}
.checkbox-label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; }
.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--bili-pink); color-scheme: light; cursor: pointer; }
.credit-estimate-box {
  display: flex;
  align-items: center; height: var(--compact-control-height);
  justify-content: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  text-align: left;
  font-size: 12px; line-height: 1; font-weight: 400; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.credit-estimate-box:hover { border-color: var(--bili-blue); color: var(--bili-blue); background: var(--hover-blue-bg); }
.credit-estimate-box span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: 5ch;
  min-width: 5ch;
  max-width: 5ch;
  text-align: right;
  overflow: hidden;
  color: var(--text-primary); font-weight: 400;
}

/* hover 问号提示 */
.fact-check-hover { position: relative; white-space: nowrap; min-width: 0; justify-self: start; }
.hover-dot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: 10px;
  background: var(--bg-secondary); color: var(--text-muted); cursor: help;
  user-select: none; flex-shrink: 0;
}
.hover-tip {
  display: none; position: absolute; right: 0; bottom: calc(100% + 6px);
  width: max-content; max-width: 220px; padding: 6px 10px;
  background: rgba(24,25,28,0.88); color: #fff; font-size: 11px; line-height: 1.5;
  border-radius: 6px; white-space: normal; pointer-events: none; z-index: 50;
}
.hover-tip::after {
  content: ''; position: absolute; top: 100%; right: 6px;
  border: 5px solid transparent; border-top-color: rgba(24,25,28,0.88);
}
.hover-dot:hover .hover-tip { display: block; }

.help-text { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.help-text a { color: var(--bili-blue); text-decoration: none; }
.help-text a:hover { text-decoration: underline; }

/* ============ 按钮 ============ */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: var(--primary-action-height); padding: 0 10px; background: var(--bili-pink); color: white;
  border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary:hover { background: #e5577d; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(251,114,153,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #e3e5e7; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.subtitle-pending-action:disabled,
.btn-primary.subtitle-pending-action:disabled:hover {
  background: var(--start-button-color);
  color: #fff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}
#btn-start { background: var(--start-button-color); }
#btn-start:hover { background: var(--start-button-color); filter: brightness(0.96); box-shadow: 0 4px 12px rgba(24,25,28,0.16); }
.start-summary-wrap { position: relative; }
.start-credit-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 2;
  width: max-content; max-width: calc(100% - 16px); padding: 7px 9px;
  border-radius: var(--radius-sm); background: var(--text-primary); color: #fff;
  font-size: 11px; line-height: 1.4; pointer-events: none;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .1s ease, transform .1s ease;
}
.start-summary-wrap.has-credit-estimate:hover .start-credit-tooltip,
.start-summary-wrap.has-credit-estimate:focus-within .start-credit-tooltip { opacity: 1; transform: translate(-50%, 0); }
.audio-summary-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.audio-summary-actions.hidden { display: none; }
.audio-summary-option { position: relative; min-width: 0; }
.audio-summary-option .btn-primary { width: 100%; padding-inline: 4px; background: var(--start-button-color); font-size: 13px; white-space: nowrap; }
.audio-summary-option .btn-primary:hover { background: var(--start-button-color); filter: brightness(0.96); box-shadow: 0 4px 12px rgba(24,25,28,0.16); }
.audio-summary-option .btn-primary:disabled { background: #e3e5e7; filter: none; box-shadow: none; }
.audio-summary-option .btn-primary.subtitle-pending-action:disabled,
.audio-summary-option .btn-primary.subtitle-pending-action:disabled:hover {
  background: var(--start-button-color);
  color: #fff;
  opacity: 1;
  filter: none;
  box-shadow: none;
  transform: none;
}
.audio-summary-option:hover .start-credit-tooltip,
.audio-summary-option:focus-within .start-credit-tooltip { opacity: 1; transform: translate(-50%, 0); }
.audio-summary-option .start-credit-tooltip {
  width: max-content; max-width: min(240px, calc(100vw - 24px));
  white-space: pre-line; text-align: center;
}
.audio-summary-option:first-child .start-credit-tooltip { left: 0; transform: translate(0, 4px); }
.audio-summary-option:last-child .start-credit-tooltip { left: auto; right: 0; transform: translate(0, 4px); }
.audio-summary-option:first-child:hover .start-credit-tooltip,
.audio-summary-option:first-child:focus-within .start-credit-tooltip,
.audio-summary-option:last-child:hover .start-credit-tooltip,
.audio-summary-option:last-child:focus-within .start-credit-tooltip { opacity: 1; transform: translate(0, 0); }

/* ============ 进度 ============ */
.progress { padding: 8px 0; }
.progress-bar { width: 100%; height: 4px; background: var(--bg-secondary); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--bili-pink), var(--bili-blue)); transition: width 0.3s ease; }
.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: center; }

/* ============ 结果 ============ */
.result {
  position: relative;
  background: var(--bg-secondary); border-radius: var(--radius-md); overflow: hidden;
  flex: 1 1 0; display: flex; flex-direction: column; min-height: 92px;
}
.result-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px;
  padding: 5px 12px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.result-title-wrap { display: flex; align-items: center; gap: 2.24px; min-width: 0; }
.result-header .icon-btn { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; }
.result-header .icon-btn:hover { color: var(--bili-blue); }
.result-font-btn { font-size: 16px; font-weight: 500; line-height: 1; }
.result-font-btn:disabled { color: var(--text-muted); cursor: default; opacity: .45; }
.result-font-btn:disabled:hover { color: var(--text-muted); }
/* 放大镜图标视觉重心偏高（镜柄伸向右下），下沉 1px 与旁边的瞄准镜对齐 */
.subtitle-search-btn svg { transform: translateY(1px); }
.subtitle-search-bar {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 5px 12px; border-bottom: 1px solid var(--border-color);
  background: transparent;
}
.subtitle-search-bar-icon { flex: 0 0 auto; color: var(--text-muted); }
.subtitle-search-input {
  flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-secondary); color: var(--text-primary);
  font: inherit; font-size: 12px; outline: none;
  transition: border-color var(--transition);
}
.subtitle-search-input:focus { border-color: var(--bili-blue); }
.subtitle-search-input::placeholder { color: var(--text-muted); }
.subtitle-search-close { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; color: var(--text-muted); }
.subtitle-search-results {
  position: sticky; top: 0; z-index: 3;
  flex: 0 0 auto; max-height: 42vh; overflow-y: auto;
  padding: 6px 8px; margin: -12px -12px 10px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.subtitle-search-results-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--text-muted); padding: 0 4px 5px;
}
.subtitle-search-results-clear { color: var(--bili-blue); background: none; border: 0; padding: 0; font: inherit; font-size: 11px; cursor: pointer; }
.subtitle-search-results-clear:hover { text-decoration: underline; }
.subtitle-search-match {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  padding: 4px 6px; border: 0; border-left: 2px solid transparent;
  background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 12px; line-height: 1.5; text-align: left;
  border-radius: 3px; cursor: pointer; white-space: pre-wrap;
}
.subtitle-search-match:hover, .subtitle-search-match:focus-visible { border-left-color: var(--bili-blue); background: var(--hover-blue-bg); color: var(--text-primary); outline: none; }
.subtitle-search-match.active { border-left-color: var(--bili-pink); background: var(--hover-pink-bg); color: var(--text-primary); }
.subtitle-search-match-time {
  flex: 0 0 auto; min-width: 42px; font-size: 10px; line-height: 18px;
  color: var(--bili-blue); font-variant-numeric: tabular-nums;
}
.subtitle-search-match-text { min-width: 0; overflow-wrap: anywhere; }
.subtitle-search-match-text mark { background: rgba(251, 114, 153, 0.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.subtitle-search-empty { padding: 4px 6px; font-size: 12px; color: var(--text-muted); }
.result-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 150px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-primary);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.result-tabs::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: var(--bili-blue);
  box-shadow: 0 1px 4px rgba(0,161,214,0.22);
  transition: transform var(--transition);
}
.result-tabs.summary-active::before { transform: translateX(100%); }
.tab-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  transition: color var(--transition);
}
.tab-btn.active { color: #fff; }
.result-actions { display: flex; gap: 2.24px; justify-content: flex-end; min-width: 0; align-items: center; }
.summary-comment-btn { font-size: 13.3px; font-weight: 700; transform: translateY(-0.5px); }
.tab-char-count { display:block; font-size:9px; line-height:11px; opacity:.82; min-height:11px; }
.result-content {
  position: relative; padding: 0;
  font-size: var(--result-font-size, 13px); line-height: 1.55;
  white-space: normal; word-break: break-word; flex: 1; min-height: 0;
}
/* 字幕/总结两个常驻视图：切换页签时只切 display，不销毁上万节点，
   避免来回切换时重建 DOM 导致卡顿；滚动与内边距落在视图上 */
.result-view {
  position: absolute; inset: 0;
  overflow-y: auto; padding: 12px; box-sizing: border-box;
}
.result-view.subtitle-view { white-space: pre-wrap; }
.subtitle-segment {
  display: block; width: 100%; padding: 0 6px; border: 0; border-left: 2px solid transparent;
  background: transparent; color: inherit; font: inherit; line-height: 1; text-align: left;
  margin-bottom: 10px;
  cursor: pointer; white-space: pre-wrap; border-radius: 3px;
}
.subtitle-segment:last-child { margin-bottom: 0; }
.subtitle-segment:hover { border-left-color: var(--bili-blue); background: var(--hover-blue-bg); color: var(--text-primary); }
.subtitle-segment.active { border-left-color: var(--bili-pink); background: var(--hover-pink-bg); color: var(--text-primary); }
.subtitle-segment-static { cursor: default; line-height: 1.55; }
.subtitle-segment-static:hover { border-left-color: transparent; background: transparent; color: inherit; }
.result-view::-webkit-scrollbar { width: 4px; }
.result-view::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.summary-generating-placeholder {
  min-height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1em; letter-spacing: .02em;
  opacity: .48; animation: summary-generating-pulse 2.3s ease-in-out infinite;
  transition: opacity .24s ease, transform .24s ease, filter .24s ease;
}
.audio-progress-main { text-align: center; }
.audio-progress-note { max-width: 360px; padding: 0 18px; text-align: center; font-size: .846em; line-height: 1.55; opacity: .82; }
.summary-generating-placeholder.audio-transcription-loading { opacity: .82; animation: none; }
.audio-transcription-loading .audio-progress-main { animation: summary-generating-pulse 2.3s ease-in-out infinite; }
.summary-generating-placeholder.is-leaving {
  opacity: 0; transform: translateY(-3px); filter: blur(1px); animation: none;
}
@keyframes summary-generating-pulse {
  0%, 100% { opacity: .42; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .summary-generating-placeholder { animation: none; opacity: .75; }
  .summary-generating-placeholder.is-leaving { transform: none; filter: none; }
}
.result-content h1, .result-content h2, .result-content h3 { margin: 8px 0 2px; color: var(--title-color, var(--bili-blue)); }
.result-content h1 { font-size: 1.308em; } .result-content h2 { font-size: 1.154em; } .result-content h3 { font-size: 1.077em; }
.result-content p { margin: 8px 0; }
.result-content p:first-child { margin-top: 0; }
.result-content p:last-child { margin-bottom: 0; }
.result-content ul, .result-content ol { padding-left: 18px; margin: 2px 0; }
.result-content li { margin: 1px 0; }
.result-content strong { color: var(--accent-color, var(--bili-pink)); }
.result-content blockquote { border-left: 3px solid var(--bili-blue); padding-left: 10px; color: var(--text-secondary); margin: 6px 0; }
.result-content hr { border: none; border-top: 1px solid var(--border-color); margin: 6px 0; }
.result-content .table-wrap { overflow-x: auto; margin: 6px 0; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.result-content table { border-collapse: collapse; width: 100%; min-width: 100%; font-size: .923em; table-layout: auto; }
.result-content th, .result-content td { padding: 4px 8px; border: 1px solid var(--border-color); text-align: left; white-space: normal; word-break: break-word; overflow-wrap: anywhere; vertical-align: top; max-width: 12em; }
.result-content th { background: var(--bg-secondary); font-weight: 600; }
.result-content tr:hover td { background: rgba(255,255,255,0.03); }
.result-content .table-wrap::-webkit-scrollbar { height: 8px; }
.result-content .table-wrap::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
.result-content .bili-math { color: var(--text-primary); }
.result-content .katex { font-size: 1.05em; }
.result-content .katex-display {
  max-width: 100%; margin: 8px 0; padding: 2px 0 5px;
  overflow-x: auto; overflow-y: hidden;
}
.result-content .katex-display > .katex { min-width: max-content; }
.result-content .katex-display::-webkit-scrollbar { height: 5px; }
.result-content .katex-display::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

.followup-question, .followup-answer {
  position: relative;
  margin-top: 16px; padding: 14px 10px 10px;
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-primary);
}
.followup-question { border-left: 3px solid var(--bili-pink); color: var(--text-secondary); }
.followup-question-title, .followup-answer-title {
  position: absolute;
  left: 10px;
  top: -9px;
  padding: 0 6px;
  background: var(--bg-secondary);
  color: var(--title-color, var(--bili-blue));
  font-size: .923em; font-weight: 700;
  line-height: 18px;
}
.followup-question-body, .followup-answer-body { font-size: 1em; line-height: 1.55; }
.followup-loading { color: var(--text-muted); }
.video-info, .status-bar, .controls, .progress { flex: 0 0 auto; }
.followup-dock {
  position: relative;
  flex: 0 0 auto; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 10px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}
.followup-input-wrap {
  position: relative; flex: 1 1 auto; min-width: 0; height: 28px;
}
.followup-input-wrap.no-attach .followup-dock-input { padding-right: 12px; }
.followup-dock-input {
  width: 100%; height: 28px; min-height: 28px; max-height: 28px; resize: none;
  padding: 0 34px 0 12px; border: 1px solid var(--border-color);
  border-radius: 999px; outline: none; background: var(--bg-primary);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  font-family: inherit; font-size: 12px; line-height: 26px; color: var(--text-primary);
}
.followup-dock-input:focus { border-color: var(--bili-blue); }
.followup-dock-input:disabled { background: var(--bg-secondary); color: var(--text-muted); cursor: not-allowed; }
.followup-attach-btn {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
}
.followup-attach-btn:hover { background: var(--bg-secondary); color: var(--text-secondary); }
.followup-attach-btn.active { color: var(--bili-blue); background: var(--hover-blue-bg); }
.followup-attach-tip {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: max-content; max-width: 200px; padding: 6px 9px;
  background: rgba(24, 25, 28, 0.94); color: #fff;
  font-size: 11px; line-height: 1.4; border-radius: 6px; white-space: pre-line;
  text-align: center;
  pointer-events: none; z-index: 12;
  opacity: 0; transition: opacity .12s ease;
}
.followup-attach-btn:hover .followup-attach-tip,
.followup-attach-btn:focus-visible .followup-attach-tip { opacity: 1; }
/* 点击后仍悬停时压住别针浮窗，避免遮挡底部开关提示；鼠标移开即恢复 */
.followup-attach-btn.tip-suppressed:hover .followup-attach-tip,
.followup-attach-btn.tip-suppressed:focus-visible .followup-attach-tip { opacity: 0; }
/* 锁定态下（非会员）别针浮窗让位给「仅会员支持追问」提示，避免两个浮窗重叠 */
.followup-dock.is-locked .followup-attach-tip { opacity: 0; }
.followup-dock-submit {
  flex: 0 0 auto;
  height: 28px; min-width: 44px; padding: 0 12px; border: none; border-radius: 999px;
  cursor: pointer; background: var(--start-button-color); color: #fff;
  font-size: 12px; font-weight: 700; transition: all var(--transition);
}
.followup-dock-submit:hover { background: var(--start-button-color); filter: brightness(0.96); }
.followup-dock-submit:disabled { background: #e3e5e7; cursor: not-allowed; filter: none; }
.followup-lock-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 2;
  width: max-content; max-width: 100%; padding: 7px 9px;
  border-radius: var(--radius-sm); background: var(--text-primary); color: #fff;
  font-size: 11px; line-height: 1.4; pointer-events: none;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .15s ease, transform .15s ease;
}
.followup-dock.is-locked { cursor: not-allowed; }
.followup-dock.is-locked:hover .followup-lock-tip,
.followup-dock.is-locked:focus-within .followup-lock-tip { opacity: 1; transform: translate(-50%, 0); }

/* ============ 设置 ============ */
.settings-panel {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); z-index: 100; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; overflow-y: scroll; overflow-x: hidden; scrollbar-gutter: stable;
}
.settings-panel::-webkit-scrollbar { width: 4px; }
.settings-panel::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.style-manager-body { display: grid; gap: 10px; padding: 2px 0; }
.style-manager-section { display: grid; gap: 4px; }
.style-manager-section-label { margin: 0; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.style-manager-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.style-manager-input-row .btn-secondary { min-width: 58px; height: 27px; }
.style-manager-limit { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.custom-style-list { display: grid; gap: 6px; }
.custom-style-item { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; align-items: center; padding: 7px 8px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-primary); }
.custom-style-item span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.custom-style-delete { width: 30px; height: 30px; color: var(--text-muted); }
.custom-style-delete:hover { color: #ff4d4f; border-color: #ff4d4f; background: var(--error-bg); }
.custom-style-empty { padding: 14px 8px; color: var(--text-muted); font-size: 12px; text-align: center; }
.settings-header { display: flex; align-items: center; justify-content: space-between; }
.settings-body { display: flex; flex-direction: column; gap: 14px; }
.settings-section { display: flex; flex-direction: column; gap: 12px; }
.settings-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  padding: 2px 0 1px;
}
.settings-section-divider {
  border: none; border-top: 1px solid var(--border-color); margin: 2px 0;
}
.control-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px;
}
.label-hint { font-weight: 400; color: var(--text-muted); }
.divider { border: none; border-top: 1px solid var(--border-color); margin: 2px 0; }
.input-field {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  font-size: 12px; font-family: inherit; transition: border-color var(--transition);
  background: var(--bg-primary); color: var(--text-primary);
}
.input-field:focus { outline: none; border-color: var(--bili-blue); }
.settings-checkbox-label { align-items: flex-start; line-height: 1.5; color: var(--text-secondary); }
.settings-checkbox-label input[type="checkbox"] { flex: 0 0 auto; margin-top: 2px; }
.settings-checkbox-label.is-disabled { opacity: .5; cursor: not-allowed; }
.md-help-wrap { position: relative; display: inline-flex; flex: 0 0 auto; align-self: center; margin-left: 2px; }
.md-help-mark {
  width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 14px;
  text-align: center; cursor: help; user-select: none;
}
.md-help-copy {
  min-width: 16px; height: 14px; margin-left: 3px; padding: 0 3px;
  border: 1px solid var(--border-color); border-radius: 3px;
  background: var(--bg-primary); color: var(--text-secondary);
  font-size: 9px; line-height: 1; font-family: inherit; cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.md-help-copy:hover { border-color: var(--bili-blue); color: var(--bili-blue); }
.md-help-tooltip {
  position: fixed; top: 0; left: 0; z-index: 1000;
  width: max-content; max-width: min(300px, calc(100vw - 24px)); padding: 8px 10px;
  border-radius: var(--radius-sm); background: rgba(24,25,28,.94); color: #fff;
  font-size: 11px; line-height: 1.55; white-space: pre-line; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.md-help-tooltip.md-help-tooltip-visible { opacity: 1; visibility: visible; }
.paid-theme-setting.is-disabled { opacity: .5; }
.background-mode-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.background-mode-options button {
  min-width: 0; height: 30px; padding: 0 4px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-secondary);
  font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer;
}
.background-mode-options button.active { border-color: var(--bili-blue); color: var(--bili-blue); box-shadow: inset 0 0 0 1px var(--bili-blue); }
.background-mode-options button:disabled { opacity: .5; cursor: not-allowed; }
.background-depth-slider { width: 100%; accent-color: var(--bili-pink); cursor: pointer; }
.background-depth-slider:disabled { opacity: .5; cursor: not-allowed; }
.display-scale-control { display: grid; grid-template-columns: 1fr; gap: 5px; }
.display-scale-slider { width: 100%; accent-color: var(--bili-pink); cursor: pointer; }
.display-scale-labels { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 10px; }
body.ui-scale-small .container {
  width: 111.111111%; height: 111.111111vh; height: 111.111111dvh;
  transform: scale(.9); transform-origin: top left;
}
body.ui-scale-large .container {
  width: 90.909091%; height: 90.909091vh; height: 90.909091dvh;
  transform: scale(1.1); transform-origin: top left;
}
.followup-length-group { gap: 7px; }
.collection-folder-setting { gap: 7px; }
.collection-folder-setting-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
}
.collection-folder-status {
  min-width: 0; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-secondary); font-size: 11px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.collection-folder-status.needs-permission { color: var(--text-secondary); border-color: var(--border-color); background: var(--bg-primary); }
.followup-length-hint,
.collection-folder-hint { color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.collection-folder-button { padding-left: 12px; padding-right: 12px; white-space: nowrap; }

/* ============ 收藏夹 ============ */
.collection-browser-body { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 10px; }
.collection-browser-toolbar { display: flex; flex-direction: column; gap: 8px; }
.collection-browser-folder {
  min-height: 34px; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-secondary); font-size: 11px; line-height: 1.45;
  word-break: break-word;
}
.collection-browser-actions { display: flex; gap: 8px; }
.collection-browser-actions .btn-secondary { flex: 1; }
.collection-list { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 7px; overflow-y: auto; }
.collection-list::-webkit-scrollbar, .collection-preview-content::-webkit-scrollbar { width: 4px; }
.collection-list::-webkit-scrollbar-thumb, .collection-preview-content::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.collection-list-state {
  display: grid; flex: 1; min-height: 120px; place-items: center; padding: 20px;
  border: 1px dashed var(--border-color); border-radius: var(--radius-md); color: var(--text-muted);
  font-size: 12px; text-align: center;
}
.collection-file-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  width: 100%; padding: 9px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary); font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.collection-file-item:hover { border-color: var(--bili-blue); background: var(--bg-secondary); }
.collection-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.collection-file-date { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.collection-preview { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
.collection-preview-header { display: flex; align-items: center; gap: 8px; }
.collection-preview-header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.collection-preview-content {
  flex: 1; min-height: 0; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-primary);
  font-family: inherit; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
/* 颜色选择 */
.color-palette {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}
.color-swatch {
  width: 100%; max-width: 24px; height: auto; aspect-ratio: 1; justify-self: center;
  border-radius: 50%; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active {
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3.5px var(--text-primary);
  transform: none;
}
.settings-section-hint { display: none; margin: -2px 0 8px; color: var(--text-muted); font-size: 11px; }
.settings-section.is-locked { opacity: .58; }
.settings-section.is-locked .settings-section-hint { display: block; }
.settings-section.is-locked .color-palette { cursor: not-allowed; }
.settings-section.is-locked .color-swatch { cursor: not-allowed; }
.settings-section.is-locked .color-swatch:hover { transform: none; }
.history-list { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.history-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.history-hint-text {
  margin: 0; flex: 1 1 auto; min-width: 0;
  font-size: 11px; line-height: 1.5; color: var(--text-secondary);
}
.history-hint.collapsed .history-hint-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-hint-toggle {
  flex: 0 0 auto; padding: 0; border: none; background: transparent;
  color: var(--bili-blue); font: inherit; font-size: 11px; line-height: 1.5; cursor: pointer;
}
.history-hint-toggle:hover { text-decoration: underline; }
.history-item {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); overflow: hidden;
}
.history-item:hover { border-color: var(--bili-blue); background: var(--hover-blue-bg); }
.history-item-open {
  flex: 1 1 auto; min-width: 0; padding: 9px 0 9px 10px;
  border: none; background: transparent; color: var(--text-primary);
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.history-item-title {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: inherit; text-decoration: none;
}
.history-item-title:hover { color: var(--bili-blue); text-decoration: underline; }
.history-item-delete {
  flex: 0 0 auto; width: 26px; height: 26px; margin-right: 3px;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 12px; line-height: 1; cursor: pointer; border-radius: 4px;
}
.history-item-delete:hover { color: #e74c3c; background: var(--hover-pink-bg); }

/* ============ B站工具箱 ============ */
.toolbox-panel { gap: 14px; }
.toolbox-panel .settings-header { align-items: flex-start; }
.toolbox-panel .settings-header h3 { margin-bottom: 3px; }
.toolbox-folder { margin: 0; color: var(--text-muted); font-size: 10px; }
.toolbox-body { display: flex; flex-direction: column; gap: 10px; }
.toolbox-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px;
  border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary);
  overflow: hidden;
}
.toolbox-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 42px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--bili-blue));
}
.toolbox-card-heading { display: flex; align-items: center; gap: 9px; }
.toolbox-card-index { color: var(--bili-blue); font: 700 10px/1 monospace; letter-spacing: .08em; }
.toolbox-card h4 { margin: 0; color: var(--text-primary); font-size: 13px; }
.toolbox-card-heading p { margin: 2px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.toolbox-action-row { display: flex; gap: 7px; }
.toolbox-action-row > * { flex: 1; min-width: 0; }
.toolbox-action-row > .hidden { display: none; }
.toolbox-comment-download { position: relative; display: flex; }
.toolbox-comment-download .toolbox-action { width: 100%; }
.toolbox-comment-download::after {
  content: attr(data-tooltip); position: absolute; z-index: 2; right: 0; bottom: calc(100% + 7px);
  width: 176px; padding: 7px 8px; border-radius: var(--radius-sm); background: #18191c; color: #fff;
  font-size: 10px; line-height: 1.45; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .15s, transform .15s;
}
.toolbox-comment-download:hover::after, .toolbox-comment-download:focus-within::after { opacity: 1; transform: translateY(0); }
.toolbox-action {
  min-height: 27px; padding: 0 10px; border: 1px solid var(--bili-blue); border-radius: var(--radius-sm);
  background: var(--bili-blue); color: #fff; font: 600 11px/1.2 inherit; cursor: pointer;
}
.toolbox-action:hover { filter: brightness(.95); }
.toolbox-action:disabled, .toolbox-card .btn-secondary:disabled { opacity: .55; cursor: wait; }
.toolbox-premium-action { border-color: var(--bili-pink, #fb7299) !important; background: var(--bili-pink, #fb7299) !important; color: #fff; }
.toolbox-hint { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.55; }
.toolbox-media-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 1fr); gap: 7px; }
.toolbox-media-grid > * { min-width: 0; }
.toolbox-media-grid > .toolbox-collection.hidden { visibility: hidden; display: block !important; pointer-events: none; }
.toolbox-media-grid > .toolbox-collection { white-space: nowrap; }
.toolbox-audio-action, .toolbox-video-action { display: grid; grid-template-columns: 55px minmax(0, 1fr); gap: 5px; }
.toolbox-audio-action .toolbox-action, .toolbox-video-action .toolbox-action { width: 100%; white-space: nowrap; }
.toolbox-audio-action select, .toolbox-video-action select {
  min-width: 0; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary); font: 11px inherit;
}
.toolbox-download-status { display: flex; flex-direction: column; gap: 6px; }
.toolbox-download-status-row { display: flex; justify-content: space-between; gap: 8px; color: var(--text-secondary); font-size: 10px; line-height: 1.4; }
.toolbox-download-status-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbox-download-progress { height: 5px; overflow: hidden; border-radius: 3px; background: var(--border-color); }
.toolbox-download-progress span { display: block; width: 0; height: 100%; background: var(--bili-blue); transition: width .15s linear; }
.toolbox-download-complete {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px;
  border: 1px solid #4caf50; border-radius: var(--radius-sm); background: #e8f5e9; color: #1b5e20; font-size: 11px; line-height: 1.35;
}
.toolbox-download-complete .icon-btn { flex: 0 0 auto; width: 22px; height: 22px; color: #1b5e20; }
.toolbox-favorites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.toolbox-favorite {
  min-width: 0; padding: 9px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-primary); color: var(--text-primary); font: 11px inherit; text-align: left; cursor: pointer;
}
.toolbox-favorite:hover { border-color: var(--bili-blue); }
.toolbox-favorite strong, .toolbox-favorite span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbox-favorite span { margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.toolbox-favorite-watchlater { border-color: var(--bili-blue); background: rgba(0, 161, 214, 0.07); }
.toolbox-favorite-watchlater span { color: var(--bili-blue); }
.toolbox-state { grid-column: 1 / -1; padding: 16px; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 11px; text-align: center; }


/* ============ Toast ============ */
#toast-container {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  gap: 6px; pointer-events: none; min-height: 0;
  /* 不参与 controls 的纵向间距，避免开始总结按钮上下空隙不对称 */
  height: 0; overflow: visible;
}
#global-toast-container {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
/* 侧栏底部提示：悬于追问条上方，不遮挡输入框 */
#global-toast-bottom-container {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text-primary); color: white; padding: 5px 12px;
  border-radius: 10px; font-size: 11px; white-space: normal;
  max-width: calc(100vw - 24px); text-align: center; line-height: 1.5;
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.7s forwards;
}
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: var(--bili-blue); }

@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

.hidden { display: none !important; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
