*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --error: #ef4444;
  --success: #22c55e;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}

/* ── 面板通用 ── */
.panel { padding: 28px 24px; }

/* ── 表单面板 ── */
.form-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.panel-header h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-section { margin-bottom: 24px; }

.form-section h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 14px; }

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.form-group-half { flex: 1; margin-bottom: 0; }

select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  padding-right: 28px;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background-color: var(--surface);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
}

.required { color: var(--error); }

input[type="text"], textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: var(--surface);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .1s;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ── 结果面板 ── */
.result-panel {
  background: var(--bg);
  overflow-y: auto;
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
}

/* ── Tab 导航栏 ── */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
  padding-top: 14px;
}

.tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px 6px 0 0;
  transition: color .15s;
  position: relative;
  bottom: -2px;
  border: 2px solid transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--primary);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}

.tab-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

/* ── 空状态 ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon { font-size: 48px; margin-bottom: 8px; }

/* ── 进度区 ── */
.progress-area {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: calc(100vh - 80px);
}

.progress-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

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

.progress-msg {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}

/* ── 视频卡片网格（实时进度面板） ── */
.video-panel {
  width: 100%;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 14px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.video-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.vcard {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
}

.vcard:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99,102,241,.18);
}

.vcard-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

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

.vcard-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(99,102,241,.95);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

.vcard-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
}

.vcard-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.vcard-badge[data-status="official"] { background: #22c55e; }
.vcard-badge[data-status="whisper"]  { background: #6366f1; }
.vcard-badge[data-status="failed"]   { background: #ef4444; }
.vcard-badge[data-status="skipped"]  { background: #94a3b8; }

.vcard-title {
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
  padding: 8px 10px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.vcard-meta {
  display: flex;
  gap: 8px;
  padding: 0 10px 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.vcard-viral { color: #f59e0b; font-weight: 600; }

/* 正在处理 ─ 动效高亮 */
.vcard-processing {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 4px rgba(245,158,11,.18), 0 4px 14px rgba(245,158,11,.2);
  animation: pulse-warning 1.8s ease-in-out infinite;
}

.vcard-processing::after {
  content: "处理中: " attr(data-action);
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  background: rgba(245,158,11,.92);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  text-align: center;
}

@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245,158,11,.18), 0 4px 14px rgba(245,158,11,.2); }
  50%      { box-shadow: 0 0 0 8px rgba(245,158,11,.32), 0 4px 18px rgba(245,158,11,.35); }
}

/* ── 日志区 ── */
.log-area {
  width: 100%;
  max-width: 720px;
  max-height: 380px;
  overflow-y: auto;
  background: #0d1117;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  scroll-behavior: smooth;
  border: 1px solid #30363d;
}

.log-area:empty { display: none; }

.log-line { white-space: pre-wrap; word-break: break-all; margin-bottom: 1px; }
.log-info    { color: #8b949e; }
.log-success { color: #3fb950; }
.log-warn    { color: #d29922; }
.log-error   { color: #f85149; }
.log-ai      { color: #a5d6ff; }

/* ── 结果区 ── */
.result-area { padding-top: 0; }

.result-toolbar {
  position: sticky;
  top: 52px;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 10px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.btn-secondary {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── 错误区 ── */
.error-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  gap: 14px;
  text-align: center;
}

.error-icon { font-size: 40px; }

.error-msg {
  font-size: 15px;
  color: var(--error);
  max-width: 440px;
  word-break: break-all;
}

/* ── 历史记录 ── */
.history-list {
  padding: 16px 0;
}

.history-loading,
.history-error {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

.history-error { color: var(--error); }

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.history-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(99,102,241,.1);
  transform: translateY(-1px);
}

.hcard-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  gap: 8px;
}

.hcard-brand {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hcard-date {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.hcard-channel {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hcard-cta {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* ── 工具说明页 ── */
.about-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 4px 60px;
}

.about-hero {
  text-align: center;
  padding: 28px 20px 24px;
  background: linear-gradient(135deg, rgba(99,102,241,.07), rgba(99,102,241,.02));
  border-radius: 14px;
  margin-bottom: 22px;
}

.about-hero h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.about-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.about-pill {
  display: inline-block;
  padding: 4px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.about-section {
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.about-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
  color: var(--text);
}

.about-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 8px;
}

.about-list {
  list-style: none;
  padding-left: 0;
}

.about-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  padding: 4px 0 4px 22px;
  position: relative;
}

.about-list li::before {
  content: "▸";
  position: absolute;
  left: 6px;
  color: var(--primary);
  font-weight: 700;
}

.about-list.small li { font-size: 13px; padding: 2px 0 2px 22px; }

.flow-list {
  counter-reset: flow;
  list-style: none;
  padding-left: 0;
}

.flow-list li {
  counter-increment: flow;
  position: relative;
  padding: 12px 14px 12px 52px;
  margin-bottom: 8px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}

.flow-list li::before {
  content: counter(flow);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.flow-list li b { color: var(--text); font-weight: 600; }
.flow-list li code { background: var(--surface); }

code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #4f46e5;
}

.formula-card {
  background: #0d1117;
  color: #a5d6ff;
  padding: 16px 18px;
  border-radius: 10px;
  margin: 8px 0 12px;
  text-align: center;
}

.formula-card code {
  background: transparent;
  color: #a5d6ff;
  font-size: 14px;
  padding: 0;
}

.path-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.path-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
}

.path-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 6px;
  color: var(--text);
}

.path-card p { font-size: 13px; line-height: 1.65; color: var(--text-muted); margin: 0; }

.path-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(99,102,241,.1);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .3px;
}

.path-arrow {
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-card {
  display: flex;
  gap: 14px;
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  align-items: flex-start;
}

.filter-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.filter-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.filter-card p { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0; }

.prompt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.prompt-table th, .prompt-table td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.prompt-table th {
  background: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
}

.prompt-table tbody tr:nth-child(even) td { background: var(--bg); }

.tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tech-grid > div {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.tech-grid b { color: var(--text); }

.about-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

@media (max-width: 700px) {
  .path-grid { grid-template-columns: 1fr; }
  .path-arrow { display: none; }
  .filter-grid, .tech-grid { grid-template-columns: 1fr; }
}

/* ── 结果区视图切换按钮 ── */
.tool-tab {
  font-weight: 500;
}
.tool-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.result-pane { padding-top: 4px; }

/* ── 交互结构化视图 ── */
.rich-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.rich-h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

.insight-group {
  margin-bottom: 18px;
}

.insight-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.igl-icon { font-size: 15px; }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.insight-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s, transform .1s;
}

.insight-card:hover {
  border-color: var(--primary);
}

.insight-head {
  margin-bottom: 6px;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.insight-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.evidence-toggle {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.evidence-toggle:hover {
  background: rgba(99,102,241,.08);
}

.ev-arrow {
  font-size: 9px;
  transition: transform .15s;
}

.evidence-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 单条证据：上方视频头（缩略图+标题），下方脚本片段。
   始终纵向堆叠以适配 insight-card 的窄宽度 */
.ev-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.ev-video {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.ev-video .ev-thumb {
  width: 110px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.ev-video-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.ev-video:hover .ev-video-title { color: var(--primary); }

.ev-scripts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.ev-scripts-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.ev-quote-row {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  background: rgba(99,102,241,.06);
  padding: 7px 11px;
  border-radius: 6px;
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  align-items: flex-start;
  word-break: break-word;
}

.ev-quote-text {
  flex: 1;
  min-width: 0;
  font-style: italic;
  color: var(--text);
  word-break: break-word;
}

.ev-seg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 9px;
  background: var(--bg);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid var(--primary);
  transition: background .12s;
  min-width: 0;
}

.ev-seg:hover {
  background: rgba(99,102,241,.07);
}

.ev-seg-ts {
  flex-shrink: 0;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,.1);
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
  height: fit-content;
}

.ev-seg-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}

.ev-no-seg {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  word-break: break-word;
}

/* ── 建议区 ── */
.advice-block {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));
  border-left: 4px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
}

.advice-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.advice-list {
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}

.advice-list li { margin-bottom: 4px; }

/* ── 红人风格摘要 3 卡片 ── */
.kol-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.summary-card {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}

.sc-icon { font-size: 22px; flex-shrink: 0; }

.sc-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.sc-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

/* ── 字幕原文核查视图 ── */
.tx-section {
  margin-bottom: 22px;
}

.tx-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-section-count {
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
}

.tx-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.tx-summary b {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.tx-summary .dot {
  width: 3px;
  height: 3px;
  background: var(--border);
  border-radius: 50%;
}

.tx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.tx-head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.tx-rank {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
  padding: 4px 9px;
  background: rgba(99,102,241,.1);
  border-radius: 6px;
}

.tx-thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.tx-meta {
  flex: 1;
  min-width: 0;
}

.tx-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.tx-title:hover {
  color: var(--primary);
}

.tx-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tx-source {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.src-official { background: rgba(34,197,94,.12); color: #16a34a; }
.src-whisper  { background: rgba(99,102,241,.12); color: var(--primary); }
.src-none     { background: rgba(148,163,184,.18); color: #64748b; }

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

.tx-text {
  background: #0d1117;
  color: #c9d1d9;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.tx-text.tx-empty {
  color: #6e7681;
  font-style: italic;
}

/* 字幕分段列表（带时间戳） */
.tx-seg-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tx-seg-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #0d1117;
  border-radius: 8px;
  padding: 10px;
}

.tx-seg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 5px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}

.tx-seg:hover {
  background: rgba(99,102,241,.18);
}

.tx-seg-ts {
  flex-shrink: 0;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #a5d6ff;
  background: rgba(99,102,241,.18);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  min-width: 50px;
  text-align: center;
}

.tx-seg-text {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #c9d1d9;
  word-break: break-word;
}

/* ── About 页 Prompt 展示 ── */
.prompts-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.prompt-card-head {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  user-select: none;
}

.prompt-card-head:hover {
  color: var(--primary);
}

.prompt-arrow {
  font-size: 11px;
  color: var(--primary);
}

.prompt-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 6px 0 0 18px;
  line-height: 1.55;
}

.prompt-body {
  margin-top: 12px;
}

.prompt-block {
  margin-bottom: 10px;
}

.prompt-block-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--primary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.prompt-pre {
  background: #0d1117;
  color: #c9d1d9;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 隐藏/显示 ── */
.hidden { display: none !important; }

/* ── Markdown 样式 ── */
.markdown-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  padding-bottom: 60px;
}

.markdown-body h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.markdown-body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}

.markdown-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.markdown-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--text-muted);
}

.markdown-body p { margin-bottom: 12px; }

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.markdown-body li { margin-bottom: 4px; }

.markdown-body blockquote {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin: 12px 0;
  color: #92400e;
  font-size: 14px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
  display: block;
  overflow-x: auto;
}

.markdown-body th {
  background: #f1f5f9;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.markdown-body td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.markdown-body tr:nth-child(even) td { background: #f8f9fc; }

.markdown-body a { color: var(--primary); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body code {
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "SF Mono", Consolas, monospace;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .form-panel {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .result-panel { min-height: 60vh; }
}
