/* ═══════════════════════════════════════════════════════════
   视频解析 · Liquid Glass 设计系统

   规范：
   · 玻璃：rgba(255,255,255,.1) + blur(20px) + 1px 白色高光边
   · 缓动：cubic-bezier(.33,1,.68,1)，时长 200-300ms
   · 圆角：统一 8px / 10px（不用大圆角）
   · 渐变：conic-gradient 三色低饱和缓慢旋转
   · 图标：全部 SVG（Lucide 路径），禁止 emoji
   · 交互：全部 Lottie，禁止 CSS keyframes
   ═══════════════════════════════════════════════════════════ */

:root {
  --ease: cubic-bezier(.33, 1, .68, 1);
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --sh-accent: 0 4px 16px rgba(20,30,45,.18);
  --dur: 240ms;
  --dur-fast: 200ms;
  --r: 10px;
  --r-sm: 8px;

  /* 玻璃三件套 */
  --glass: rgba(255, 255, 255, .10);
  --glass-strong: rgba(255, 255, 255, .18);
  --glass-card: rgba(255, 255, 255, .42);
  --glass-border: rgba(255, 255, 255, .26);
  --glass-hi: rgba(255, 255, 255, .55);

  /* 文字（玻璃底上保证对比度） */
  --fg: #14181d;
  --fg2: rgba(20, 24, 29, .62);
  --fg3: rgba(20, 24, 29, .42);
  --fg-inv: #ffffff;

  /* 深色（主按钮 / 用户气泡） */
  --ink: rgba(24, 32, 42, .88);
  --ink-hover: rgba(24, 32, 42, .94);

  --ok: #34a853;
  --warn: #b8860b;
  --danger: #c0392b;

  --blur: blur(20px) saturate(150%);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--fg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  background: #eef2f6;
}

input, textarea, select, button { font-family: inherit; font-size: 15px; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── 动态渐变底层 ── */
.gradient-bg {
  position: fixed; inset: -40%; z-index: -2; pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%,
    #e8eef4 0deg, #dfe7ee 70deg, #eae6e2 140deg,
    #e4ece9 210deg, #e9e8ef 280deg, #e8eef4 360deg);
  filter: blur(70px);
  animation: gradient-spin 42s linear infinite;
}
@keyframes gradient-spin { to { transform: rotate(360deg); } }

.gradient-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 18% 8%, rgba(255,255,255,.85), transparent 58%),
    radial-gradient(90% 70% at 88% 92%, rgba(255,255,255,.6), transparent 60%);
}

/* ── 图标 ── */
.ico {
  width: 18px; height: 18px; display: block; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ico-sm { width: 14px; height: 14px; }

/* ── 玻璃面板 ── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 0 var(--glass-hi),
    inset 0 -1px 0 0 rgba(255,255,255,.12),
    0 8px 32px rgba(20,30,45,.07);
}

/* ══════════════ 顶栏 ══════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  padding-top: var(--safe-t);
}
.topbar-inner {
  max-width: 1140px; margin: 0 auto; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--fg); font-weight: 600; font-size: 15px;
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.brand-icon .ico { width: 13px; height: 13px; stroke-width: 2; fill: currentColor; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.dev-badge {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: rgba(184,134,11,.14); color: var(--warn);
  border: 1px solid rgba(184,134,11,.26); font-weight: 500;
}

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  background: var(--glass); color: var(--fg);
  border: 1px solid var(--glass-border);
  padding: 7px 13px; border-radius: var(--r-sm); cursor: pointer;
  min-height: 34px; font-size: 14px; font-weight: 500;
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-ghost:hover { background: var(--glass-strong); }
.btn-ghost:active { transform: scale(.97); }

/* ══════════════ 通用按钮 ══════════════ */
.btn-primary {
  position: relative; overflow: visible;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  padding: 12px 20px; border-radius: var(--r); cursor: pointer;
  min-height: 46px; min-width: 152px;
  color: var(--fg-inv); background: var(--ink);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 16px rgba(20,30,45,.18);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.btn-primary:hover {
  background: var(--ink-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 22px rgba(20,30,45,.24);
}
.btn-primary:active { transform: scale(.975); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary .ico { width: 17px; height: 17px; stroke-width: 2; }
.btn-block { width: 100%; }

/* 碎片容器：绝对定位在按钮中心，超出不裁 */
.particles {
  position: absolute; left: 50%; top: 50%;
  width: 260px; height: 260px; margin: -130px 0 0 -130px;
  pointer-events: none; z-index: 2;
}

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--glass); color: var(--fg);
  border: 1px solid var(--glass-border);
  padding: 11px 16px; border-radius: var(--r-sm); cursor: pointer;
  min-height: 44px; white-space: nowrap; font-weight: 500; font-size: 14px;
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-secondary:hover { background: var(--glass-strong); }
.btn-secondary:active { transform: scale(.97); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.btn-text {
  background: none; border: none; color: var(--fg2);
  cursor: pointer; padding: 10px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color var(--dur) var(--ease);
}
.btn-text:hover { color: var(--fg); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--fg2); padding: 6px 11px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px; min-height: 32px;
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transition: all var(--dur) var(--ease);
}
.btn-icon:hover { background: var(--glass-strong); color: var(--fg); }
.btn-icon:active { transform: scale(.97); }
.btn-icon.danger:hover { color: var(--danger); border-color: rgba(192,57,43,.35); }
.btn-icon .ico { width: 15px; height: 15px; }

/* ══════════════ 布局 ══════════════ */
#main { max-width: 1140px; margin: 0 auto; padding-bottom: 28px; }
.view { padding: 20px 18px; }

/* ══════════════ 首页 ══════════════ */
.hero {
  /* 去掉功能卡片后首页留白更重要：标题上方的呼吸感决定第一印象 */
  padding: 84px 2px 34px; max-width: 720px; margin: 0 auto;
}
.hero-title {
  font-size: 38px; margin: 0 0 14px; font-weight: 650;
  letter-spacing: -1.2px; line-height: 1.22;
}
.hero-sub { color: var(--fg2); margin: 0; font-size: 16px; line-height: 1.6; }

.input-card {
  max-width: 720px; margin: 0 auto; padding: 6px;
}
#inputBox {
  width: 100%; background: transparent; border: 0;
  color: var(--fg); padding: 14px 14px 12px;
  resize: none; min-height: 60px; max-height: 180px;
  line-height: 1.6; overflow-y: hidden;
}
#inputBox::placeholder { color: var(--fg3); }
#inputBox:focus { outline: none; }
.input-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 8px 8px;
}
.input-row .btn-primary { flex-shrink: 0; }
.hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--fg3); line-height: 1.5;
  /* 手机上提示文字会折成两行、把按钮挤歪，这里让它单行省略 */
  min-width: 0;
}
.hint span, .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint .ico { width: 14px; height: 14px; flex-shrink: 0; }

/* 窄屏：提示换到按钮下面一行，避免和按钮抢宽度 */
@media (max-width: 430px) {
  .input-row { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .input-row .btn-primary { width: 100%; }
  .hint { justify-content: center; }
}

.feature-grid {
  display: grid; gap: 10px; max-width: 720px; margin: 22px auto 0;
}
.feature {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 16px; cursor: default;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.feature:hover { background: var(--glass-strong); transform: translateY(-1px); }
.feature-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.42);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  color: rgba(24,32,42,.72);
}
.feature-icon .ico { width: 17px; height: 17px; }
.feature-body { min-width: 0; flex: 1; }
.feature b { display: block; font-size: 14.5px; font-weight: 600;
             margin-bottom: 3px; letter-spacing: -.1px; }
.feature i { font-style: normal; font-size: 13.5px; color: var(--fg2); line-height: 1.55; }

.history-box { max-width: 720px; margin: 40px auto 0; }
.history-box h3 {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--fg3); margin: 0 0 10px;
  font-weight: 500; padding: 0 4px;
}
.history-box h3 .ico { width: 14px; height: 14px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.history-item:hover { background: var(--glass-strong); transform: translateX(2px); }
.history-item img {
  width: 52px; height: 32px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
  border: 1px solid var(--glass-border);
}
.history-item .hi-body { min-width: 0; flex: 1; }
.history-item .hi-title { font-size: 14px; white-space: nowrap;
                          overflow: hidden; text-overflow: ellipsis; }
.history-item .hi-meta { font-size: 12.5px; color: var(--fg3); margin-top: 2px; }

/* ══════════════ 加载中 ══════════════ */
.loading-card {
  max-width: 620px; margin: 34px auto; padding: 20px;
}
.video-mini { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.video-mini img {
  width: 88px; height: 55px; object-fit: cover;
  border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--glass-border);
}
.video-mini .vm-title { font-size: 14.5px; line-height: 1.45; font-weight: 550; }
.video-mini .vm-owner { font-size: 12.5px; color: var(--fg3); margin-top: 4px; }

.progress-wrap { margin: 16px 0; }
.progress-bar {
  height: 6px; background: rgba(255,255,255,.4);
  border-radius: 4px; overflow: hidden;
  border: 1px solid var(--glass-border);
}
.progress-fill {
  height: 100%; width: 0; border-radius: 4px;
  background: rgba(24,32,42,.7);
  transition: width 300ms var(--ease);
}
.progress-text {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 13.5px; color: var(--fg2);
}
.loading-tip { font-size: 13px; color: var(--fg3); margin: 12px 0 0; }

/* Lottie 容器（全站统一） */
.lottie-loader { width: 38px; height: 18px; display: none; flex-shrink: 0; }
.lottie-loader.on { display: block; }
.lottie-loader svg { width: 100% !important; height: 100% !important; display: block; }
.lottie-check { width: 44px; height: 44px; }
.lottie-check svg { width: 100% !important; height: 100% !important; display: block; }

/* ══════════════ 视频卡 ══════════════ */
.video-card {
  display: flex; gap: 14px; padding: 14px; margin-bottom: 14px;
}
.video-card img {
  width: 116px; height: 73px; object-fit: cover;
  border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--glass-border);
}
.video-card .vc-body { min-width: 0; flex: 1; }
.video-card .vc-title { font-size: 15.5px; font-weight: 600;
                        line-height: 1.45; margin-bottom: 6px; letter-spacing: -.2px; }
.video-card .vc-meta { font-size: 12.5px; color: var(--fg3);
                       display: flex; flex-wrap: wrap; gap: 12px; }
.video-card .vc-link { font-size: 12.5px; font-weight: 500; }

/* 平台标签：只有非 B站 的内容才显示，避免 B站 满屏都是标签 */
.vc-pf {
  display: inline-block; vertical-align: 2px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .3px;
  padding: 1px 7px; margin-right: 7px;
  border-radius: 20px; line-height: 1.6;
  color: var(--fg2);
  border: 1px solid rgba(20,24,29,.14);
  background: rgba(255,255,255,.5);
}

/* ══════════════ Tab ══════════════ */
.mobile-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  position: sticky; top: 54px; z-index: 20;
}
.mtab {
  flex: 1; background: none; border: none; color: var(--fg2);
  padding: 9px 4px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 14px; min-height: 38px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--dur) var(--ease);
}
.mtab .ico { width: 15px; height: 15px; }
.mtab:hover { background: rgba(255,255,255,.35); }
.mtab.active {
  background: var(--ink); color: var(--fg-inv); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 14px rgba(20,30,45,.16);
}

.pane { display: none; }
.pane.active { display: block; }
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.pane-head h2 {
  display: flex; align-items: center; gap: 7px;
  font-size: 15.5px; margin: 0; font-weight: 600; letter-spacing: -.2px;
}
.pane-head h2 .ico { width: 16px; height: 16px; color: var(--fg2); }
.pane-tools { display: flex; align-items: center; gap: 8px; }

.badge {
  font-size: 11.5px; padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,.45); color: var(--fg2);
  border: 1px solid var(--glass-border); white-space: nowrap; font-weight: 500;
}

/* ══════════════ 文案 ══════════════ */
.pane .pane-body { padding: 16px; }
#transcriptBody {
  max-height: 62vh; overflow-y: auto;
  font-size: 15px; line-height: 1.85; white-space: pre-wrap;
  word-break: break-word;
}
#transcriptBody p { margin: 0 0 .85em; }
#transcriptBody .seg-time { display: block; font-size: 11.5px;
  color: var(--fg3); margin-bottom: 2px; font-family: ui-monospace, monospace; }
#transcriptBody mark { background: rgba(24,32,42,.12); padding: 1px 3px; border-radius: 3px; }

.empty { color: var(--fg3); font-size: 14px; text-align: center;
         padding: 30px 12px; line-height: 1.8; }

.pane-disabled { opacity: .5; pointer-events: none; }
.pane-disabled .pane-head h2::after {
  content: " · 无文案"; font-size: 12px; font-weight: 400; color: var(--fg3);
}

/* ══════════════ AI 输出 ══════════════ */
.action-gate { text-align: center; padding: 30px 16px; }
.action-gate p { color: var(--fg2); font-size: 14px; margin: 0 0 16px; line-height: 1.75; }
.action-gate .gate-note { font-size: 12.5px; color: var(--fg3); margin-bottom: 14px; }

.md-body { font-size: 15px; line-height: 1.8; word-break: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body h1, .md-body h2 {
  font-size: 16px; margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(20,24,29,.1); font-weight: 600;
}
.md-body h1:first-child, .md-body h2:first-child { margin-top: 0; }
.md-body h3 { font-size: 15px; margin: 18px 0 9px; font-weight: 600; }
.md-body p { margin: 0 0 13px; }
.md-body ul, .md-body ol { padding-left: 24px; margin: 0 0 13px; }
.md-body li { margin-bottom: 6px; }
.md-body strong { font-weight: 600; }
.md-body code {
  background: rgba(255,255,255,.5); padding: 2px 7px; border-radius: 6px;
  font-size: 13px; font-family: ui-monospace, monospace;
}
.md-body pre { background: rgba(255,255,255,.5); border: 1px solid var(--glass-border);
  padding: 14px; border-radius: var(--r-sm); overflow-x: auto; }
.md-body pre code { background: none; padding: 0; }
.md-body blockquote {
  border-left: 2px solid rgba(24,32,42,.3); margin: 0 0 13px;
  padding: 4px 0 4px 14px; color: var(--fg2);
}
/* ── 表格 ──
   ⚠️ 这里踩过坑：原来写 `width:100%` + `display:block`，
   表格会把每一列**压到最窄**——中文因此变成"两个字一行"，完全没法读
   （AI 核验的输出正好是长表格，症状最明显）。
   现在让列有一个不许突破的最小宽度，装不下时**横向滚动**，而不是压扁列。 */
.md-body table {
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;   /* iOS 上滚起来跟手 */
  max-width: 100%;
}
.md-body th, .md-body td {
  border: 1px solid rgba(20,24,29,.12);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  /* 列宽下限：低于这个宽度中文就开始两字一行了 */
  min-width: 92px;
  /* 单列上限：长文本换行比拉成一条横线更好读 */
  max-width: 340px;
  word-break: break-word;
  line-height: 1.65;
}
.md-body th {
  background: rgba(255,255,255,.55);
  font-weight: 600;
  white-space: nowrap;      /* 表头一行显示，便于对齐识别 */
  position: sticky; top: 0; /* 列名跟着滚动，长表格不迷失 */
  backdrop-filter: blur(8px);
}
/* 斑马纹：行多的时候眼睛不容易串行 */
.md-body tbody tr:nth-child(even) td { background: rgba(255,255,255,.22); }
.md-body tbody tr:hover td { background: rgba(255,255,255,.45); }
.md-body hr { border: none; border-top: 1px solid rgba(20,24,29,.1); margin: 20px 0; }
.md-body a { word-break: break-all; }

.md-body .cite-ref {
  display: inline-block; background: rgba(24,32,42,.1); color: var(--fg);
  font-size: 11px; padding: 0 5px; border-radius: 5px; margin: 0 2px;
  cursor: pointer; vertical-align: super; line-height: 1.5;
  font-family: ui-monospace, monospace; font-weight: 600;
  transition: background var(--dur-fast) var(--ease);
}
.md-body .cite-ref:hover { background: var(--ink); color: var(--fg-inv); }

/* 折叠面板 */
.think-box, .sources-box {
  background: rgba(255,255,255,.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); margin-bottom: 13px; overflow: hidden;
  transition: background var(--dur) var(--ease);
}
.think-box:hover, .sources-box:hover { background: rgba(255,255,255,.5); }
.think-box > summary, .sources-box > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; cursor: pointer; font-size: 13px;
  color: var(--fg2); user-select: none; list-style: none; font-weight: 500;
  transition: color var(--dur) var(--ease);
}
.think-box > summary::-webkit-details-marker,
.sources-box > summary::-webkit-details-marker { display: none; }
.think-box > summary:hover, .sources-box > summary:hover { color: var(--fg); }
.think-box > summary .ico, .sources-box > summary .ico { width: 14px; height: 14px;
  transition: transform var(--dur) var(--ease); }
.think-box[open] > summary .ico,
.sources-box[open] > summary .ico { transform: rotate(90deg); }
.think-body {
  padding: 12px 14px; font-size: 13px; color: var(--fg2);
  white-space: pre-wrap; line-height: 1.75; max-height: 320px; overflow-y: auto;
  border-top: 1px solid rgba(20,24,29,.08);
}

/* 参考资料 */
.sources-list { margin: 0; padding: 12px 14px 12px 34px;
  border-top: 1px solid rgba(20,24,29,.08); }
.sources-list li { margin-bottom: 12px; font-size: 13px; line-height: 1.65;
  transition: background 300ms var(--ease); }
.sources-list li:last-child { margin-bottom: 0; }
.sources-list .src-title { display: block; margin-bottom: 3px; font-weight: 500; }
.sources-list .src-meta { font-size: 11.5px; color: var(--fg3);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sources-list .src-url { font-size: 11.5px; word-break: break-all; color: var(--fg3); }
.sources-list li.highlight { background: rgba(24,32,42,.08);
  border-radius: var(--r-sm); padding: 8px 10px; margin-left: -10px; }
.auth-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--glass-border); color: var(--fg3); }
.auth-tag.high { color: var(--ok); border-color: rgba(52,168,83,.3); }
.auth-tag.low { color: var(--warn); border-color: rgba(184,134,11,.3); }

.verify-stages {
  background: rgba(255,255,255,.35); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 13px;
  font-size: 12.5px; color: var(--fg2);
}
.verify-stages .vs-line { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.verify-stages .vs-line:last-child { margin-bottom: 0; }
.verify-stages .vs-line.done { color: var(--ok); }
.verify-stages .vs-line.active { color: var(--fg); font-weight: 550; }
.vs-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  flex-shrink: 0; }

.offline-note {
  background: rgba(184,134,11,.12); border: 1px solid rgba(184,134,11,.26);
  color: #7a5a08; border-radius: var(--r-sm);
  padding: 11px 14px; font-size: 12.5px; margin-bottom: 13px; line-height: 1.6;
}

/* ══════════════ 对话 ══════════════ */
/* ⚠️ 这里的 display 只能写在 `.pane-chat.active` 上。
   曾经写成裸的 `.pane-chat { display: flex }`，它和 `.pane { display: none }`
   优先级相同、但它定义在后 —— 于是**对话面板在手机端永远显示**，
   和当前标签页的面板叠在一起。手机端本来靠 `.pane.active` 控制一次只显示一个。 */
.pane-chat {
  flex-direction: column;
  padding-bottom: 84px;
}
.pane-chat.active { display: flex; }
.pane-chat .pane-head, .pane-chat .conv-bar { flex-shrink: 0; }

.chat-body {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px !important; touch-action: pan-y;
}
.msg-row { display: flex; flex-direction: column; max-width: 92%; }
.msg-row.user { align-self: flex-end; align-items: flex-end; }
.msg-row.ai { align-self: flex-start; }
.bubble {
  padding: 12px 15px; border-radius: var(--r); font-size: 15px;
  line-height: 1.7; word-break: break-word;
}
.msg-row.user .bubble {
  background: var(--ink); color: var(--fg-inv);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 3px 12px rgba(20,30,45,.14);
}
.msg-row.ai .bubble {
  background: rgba(255,255,255,.42);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.msg-row.ai .bubble .md-body { font-size: 15px; }
.msg-row.ai .bubble .md-body > *:last-child { margin-bottom: 0; }
.msg-time { font-size: 11px; color: var(--fg3); margin-top: 5px; padding: 0 4px; }

/* 对话里的加载指示器 */
.typing-wrap { display: flex; align-items: center; gap: 8px;
  color: var(--fg2); font-size: 13px; }
.typing-wrap .lottie-loader { display: block; }
.typing-wrap .lottie-loader svg path { fill: rgba(20,24,29,.45) !important; }

.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 18px calc(12px + var(--safe-b));
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.composer-inner {
  max-width: 1104px; margin: 0 auto;
  display: flex; gap: 9px; align-items: flex-end;
}
#chatInput {
  flex: 1; background: rgba(255,255,255,.5);
  border: 1px solid var(--glass-border);
  color: var(--fg); border-radius: 22px; padding: 11px 18px;
  resize: none; max-height: 140px; line-height: 1.5; min-height: 44px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
#chatInput::placeholder { color: var(--fg3); }
#chatInput:focus { outline: none; background: rgba(255,255,255,.7);
                   border-color: rgba(255,255,255,.7); }
.btn-send {
  position: relative; overflow: visible;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--fg-inv); border: 0;
  border-radius: 22px; padding: 0 20px; height: 44px;
  font-weight: 600; font-size: 14px; cursor: pointer; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 12px rgba(20,30,45,.16);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn-send:hover { background: var(--ink-hover); }
.btn-send:active { transform: scale(.97); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-send .ico { width: 16px; height: 16px; }
.composer-hint {
  max-width: 1104px; margin: 6px auto 0;
  font-size: 11.5px; color: var(--fg3); min-height: 15px;
}

.conv-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.conv-select {
  flex: 1; background: rgba(255,255,255,.45);
  border: 1px solid var(--glass-border); color: var(--fg);
  border-radius: var(--r-sm); padding: 9px 12px; min-height: 38px;
  cursor: pointer; transition: background var(--dur) var(--ease);
}
.conv-select:focus { outline: none; background: rgba(255,255,255,.65); }

/* ══════════════ 弹层 ══════════════ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(20,30,45,.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative; width: 100%; max-width: 400px;
  max-height: 88vh; overflow-y: auto; padding: 24px;
  background: rgba(255,255,255,.72);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8),
              0 18px 48px rgba(20,30,45,.18);
}
.modal-card.wide { max-width: 900px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--fg3);
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: grid; place-items: center; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.modal-close:hover { background: rgba(255,255,255,.6); color: var(--fg); }
.modal-close .ico { width: 18px; height: 18px; stroke-width: 2; }
.modal-title { font-size: 17px; margin: 0 0 18px; font-weight: 600;
               letter-spacing: -.3px; }

.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: rgba(255,255,255,.4); padding: 4px; border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
}
.atab {
  flex: 1; background: none; border: none; color: var(--fg2);
  padding: 9px; cursor: pointer; font-size: 14.5px; min-height: 40px;
  border-radius: 6px; font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.atab.active { color: var(--fg-inv); background: var(--ink); font-weight: 600; }

.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 13px; color: var(--fg2);
                margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; background: rgba(255,255,255,.6);
  border: 1px solid var(--glass-border); color: var(--fg);
  border-radius: var(--r-sm); padding: 12px 14px; min-height: 44px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field input::placeholder { color: var(--fg3); }
.field input:focus { outline: none; background: rgba(255,255,255,.85);
                     border-color: rgba(255,255,255,.9); }
.code-row { display: flex; gap: 9px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn-secondary { flex-shrink: 0; }

.msg {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; padding: 11px 13px; border-radius: var(--r-sm);
  margin-bottom: 14px; line-height: 1.6;
}
.msg .ico { width: 15px; height: 15px; margin-top: 1px; }
.msg.error { background: rgba(192,57,43,.1); color: var(--danger);
             border: 1px solid rgba(192,57,43,.22); }
.msg.ok { background: rgba(52,168,83,.1); color: var(--ok);
          border: 1px solid rgba(52,168,83,.22); }
.msg.warn { background: rgba(184,134,11,.12); color: #7a5a08;
            border: 1px solid rgba(184,134,11,.24); }

.auth-note { font-size: 11.5px; color: var(--fg3); margin: 14px 0 0;
             line-height: 1.6; text-align: center; }

.conv-modal-list, .hist-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 62vh; overflow-y: auto;
}
.hist-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; cursor: pointer;
  background: rgba(255,255,255,.4);
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}
.hist-item:hover { background: rgba(255,255,255,.62); transform: translateX(2px); }
.hist-item img {
  width: 52px; height: 32px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
  border: 1px solid var(--glass-border);
}
.hist-item .ht { min-width: 0; flex: 1; }
.hist-item .ht b { display: block; font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .ht i { font-style: normal; font-size: 11.5px; color: var(--fg3); }
.hist-item .hicon { color: var(--fg3); flex-shrink: 0; }
.hist-item .hicon .ico { width: 15px; height: 15px; }
.conv-modal-item {
  padding: 12px 14px; cursor: pointer;
  background: rgba(255,255,255,.4);
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}
.conv-modal-item:hover { background: rgba(255,255,255,.62); transform: translateX(2px); }
.conv-modal-item.active { border-color: rgba(24,32,42,.35); background: rgba(255,255,255,.7); }
.conv-modal-item .cm-title { font-size: 13.5px; margin-bottom: 3px; font-weight: 500; }
.conv-modal-item .cm-meta { font-size: 11.5px; color: var(--fg3); }

/* ══════════════ Toast ══════════════ */
.toast {
  position: fixed; left: 50%; bottom: calc(30px + var(--safe-b));
  transform: translate(-50%, 8px); z-index: 200;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--fg-inv);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 13.5px; max-width: 88vw;
  box-shadow: 0 8px 28px rgba(20,30,45,.26);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .ico { width: 16px; height: 16px; stroke-width: 2.2; }

.drawer-mask { position: fixed; inset: 0; z-index: 90;
  background: rgba(20,30,45,.25);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ═══════════════════════════════════════════════════════════
   ≥768px 桌面/平板：两列
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .view { padding: 26px; }
  .hero { padding: 108px 0 42px; text-align: center; }
  .hero-title { font-size: 46px; letter-spacing: -1.8px; }
  .hero-sub { font-size: 16.5px; }

  .mobile-tabs { display: none; }

  .panes {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px; align-items: start;
  }
  .pane { display: block !important; }

  /* ⚠️ 这里必须**同时写 grid-column 和 grid-row**。
     曾经只写了 grid-row，四个面板就被 CSS Grid 的自动布局全塞进第一列——
     右半边整列空着（浪费约 34% 宽度）；而文案面板是 position:sticky，
     滚动时又盖在其它面板上，它是半透明玻璃，两层文字直接糊在一起。
     现在：左列文案、右列依次是总结/核验/对话。
     行间距由 grid 的 gap 提供，所以这里**不要再加 margin-top**（会变双倍间距）。 */
  .pane-transcript {
    grid-column: 1;
    grid-row: 1 / span 3;      /* 跨满右列的三行，sticky 才有可滚动的余量 */
    position: sticky; top: 72px;
  }
  .pane-summary { grid-column: 2; grid-row: 1; }
  .pane-verify { grid-column: 2; grid-row: 2; }
  .pane-chat { grid-column: 2; grid-row: 3; }

  #transcriptBody { max-height: calc(100vh - 280px); }
  .pane-chat { padding-bottom: 0; }
  .chat-body { max-height: 480px; overflow-y: auto; }
  .composer {
    position: sticky; left: auto; right: auto;
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(20,24,29,.1); box-shadow: none;
    padding: 12px 0;
  }
  .composer-inner, .composer-hint { max-width: none; }
  .video-card img { width: 132px; height: 83px; }
  .video-card .vc-title { font-size: 16.5px; }
  .modal-card { max-width: 420px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(20,24,29,.16); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(20,24,29,.26); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════
   公告弹层
   三档：normal 可关闭 / important 必须确认 / force 无法关闭
   ═══════════════════════════════════════════ */
.ann-modal { z-index: 300; }        /* 盖住认证/历史等其他弹层 */

.ann-card {
  position: relative;
  width: 100%; max-width: 440px;
  max-height: 84vh; overflow-y: auto;
  padding: 22px 22px 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85),
              0 22px 60px rgba(20,30,45,.22);
}
/* important / force 档在视觉上更"硬"一些，提示用户这条不能随手忽略 */
.ann-card[data-mode="important"] { border-color: rgba(184,134,11,.38); }
.ann-card[data-mode="force"] {
  border-color: rgba(192,57,43,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85),
              0 0 0 3px rgba(192,57,43,.10),
              0 22px 60px rgba(20,30,45,.24);
}

.ann-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.ann-head .modal-close { position: static; margin-left: auto; }

.ann-badge {
  font-size: 11.5px; font-weight: 650; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 20px;
  border: 1px solid rgba(20,24,29,.14); color: var(--fg2);
  background: rgba(255,255,255,.5);
}
.ann-badge.lv-info   { color: var(--fg); border-color: rgba(43,108,245,.28); background: rgba(24,32,42,.08); }
.ann-badge.lv-warn   { color: #96620a; border-color: rgba(224,147,10,.32); background: rgba(184,134,11,.12); }
.ann-badge.lv-danger { color: var(--danger); border-color: rgba(229,72,77,.32); background: rgba(192,57,43,.1); }

.ann-title { font-size: 17.5px; font-weight: 680; margin: 0 0 12px; line-height: 1.45; }
.ann-body {
  font-size: 14.5px; line-height: 1.75; color: var(--fg2);
  white-space: pre-wrap;            /* 保留正文里的换行 */
  word-break: break-word;
}
.ann-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px;
}
.ann-count { font-size: 12px; color: var(--fg3); }
.ann-foot .btn-primary { min-width: 116px; }

@media (max-width: 767px) {
  .ann-card { max-width: none; }
  .ann-foot { flex-direction: column-reverse; align-items: stretch; }
  .ann-foot .btn-primary { width: 100%; }
  .ann-count { text-align: center; }
}

/* 深度核验按钮：次要按钮，但要有存在感 */
.btn-deep {
  margin-left: 10px;
  gap: 6px;
}
.btn-deep .ico-sm { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .btn-deep { margin-left: 0; margin-top: 10px; width: 100%; }
}

/* ═══ 提建议 ═══ */
.fb-title { margin: 0 0 6px; font-size: 17px; }
.fb-sub { color: var(--fg2); font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.fb-req { color: var(--danger); font-weight: 600; font-size: 11px; }
#feedbackModal select,
#feedbackModal input,
#feedbackModal textarea {
  width: 100%; box-sizing: border-box;
}
#feedbackModal textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
.msg.ok { color: var(--ok); }
.fb-mine { margin-top: 18px; border-top: 1px solid var(--glass-border); padding-top: 14px; }
.fb-mine h4 { margin: 0 0 10px; font-size: 13px; color: var(--fg2); }
.fb-item {
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 9px; background: rgba(255,255,255,.28);
}
.fb-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fb-item-body { font-size: 13px; line-height: 1.65; word-break: break-word; }
.fb-reply {
  margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm);
  background: rgba(23,166,115,.09); border-left: 2px solid var(--ok);
  font-size: 13px; line-height: 1.65; word-break: break-word;
}
.fb-reply b { display: block; margin-bottom: 3px; color: var(--ok); font-size: 12px; }

/* ═══ 顶栏在窄屏的收缩 ═══
   ⚠️ 加了「建议」按钮之后，390px 宽度放不下「品牌 + 建议 + 历史 + 昵称」，
   flex 会把每一项压到很窄 —— 结果是每个字各占一行（"建 议"、"历 史"）。
   所以窄屏下：品牌不换行、次要按钮只留图标。 */
@media (max-width: 767px) {
  .brand { white-space: nowrap; flex-shrink: 0; }
  .topbar-actions { flex-shrink: 0; gap: 2px; }
  /* 建议 / 历史 / 登录 只留图标，标题里已有 title 提示 */
  #feedbackBtn .bt-label,
  #historyBtn .bt-label,
  #userBtn .bt-label { display: none; }
  .topbar-actions .btn-ghost { padding: 8px 9px; }
  .topbar-actions .btn-ghost .ico { margin: 0; }
}
