/* ==========================================================================
   清影 QINGYING — 无水印解析
   设计基准：浅色、克制、信息密度中等；三档断点（桌面 ≥1024 / 平板 641–1023 / 手机 ≤640）
   ========================================================================== */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f6fa;
  --ink: #14151c;
  --ink-2: #4d5060;
  --ink-3: #8b8f9e;
  --line: #e9eaf0;
  --line-strong: #dcdee6;
  --brand: #ff2b56;
  --brand-2: #ff7a45;
  --brand-soft: rgba(255, 43, 86, 0.08);
  --cyan: #12d6c8;
  --ok: #12a26b;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 21, 28, 0.04), 0 2px 8px rgba(20, 21, 28, 0.04);
  --shadow: 0 1px 3px rgba(20, 21, 28, 0.05), 0 12px 32px -12px rgba(20, 21, 28, 0.14);
  --shadow-lg: 0 2px 6px rgba(20, 21, 28, 0.05), 0 28px 60px -24px rgba(20, 21, 28, 0.22);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------- scrollbar */
/* 全站统一滚动条：细、圆角、去箭头按钮；Firefox 走 scrollbar-width/color。
   「隐藏的隐藏」：不需要视觉指示的横滚区加 .no-scrollbar。 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 21, 28, 0.22) transparent;
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(20, 21, 28, 0.2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(20, 21, 28, 0.32); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* 横向滑动区（chips 行、标签行等）：滚动条完全隐藏，内容仍可滑动 */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 顶部两团极淡的色晕，给白底一点空气感 */
.bg-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 620px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(52% 46% at 18% 8%, rgba(255, 43, 86, 0.13), transparent 62%),
    radial-gradient(46% 42% at 82% 0%, rgba(18, 214, 200, 0.14), transparent 64%);
  filter: blur(18px);
  opacity: 0.9;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 251, 253, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  /* 与 /clean /docs /me 一致：常驻淡分隔线（四页顶栏完全同款） */
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  /* 与 /clean /docs /me 的顶栏同一宽度（1080px），四页共用 partial 后视觉一致 */
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.brand-text {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brand-text em {
  display: none;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  margin-left: 7px;
  font-weight: 600;
}

.topnav {
  /* 桌面端绝对居中：无论两侧 brand / 用户区宽度如何，导航永远在顶栏正中
     （与 /clean /docs 内联样式同款）；窄屏回退为 flex 布局 */
  display: flex;
  gap: 26px;
}

@media (min-width: 861px) {
  .topnav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

.topnav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.16s ease;
  padding: 4px 0;
}

.topnav a:hover { color: var(--ink); }

/* 当前页导航项：与 /clean、/docs 各页同一套激活态（品牌色下划线）。
   用 background 渐变画下划线而非 box-shadow：导航绝对居中后右边缘常落在
   半像素上，box-shadow 在部分机器上会沿右边缘渗出一条 1px 竖线毛边。 */
.topnav a.on {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(var(--brand), var(--brand)) no-repeat left bottom / 100% 2px;
}

/* ------------------------------------------------------------------ hero */
/* -------------------------------------------------- 出结果后收起首屏（hero） */
/* 解析完用户要看的是结果，标题、副标题、chips、免责声明全都让位，
   页面只剩「导航 + 结果卡」。
   ⚠️ 不要改成「压扁成一行输入框」：页面一屏放不下时浏览器只能滚到半路，
   输入框会卡在固定导航底下露出一截被拦腰截断的卡片，比直接收起更难看。
   想换链接点结果卡右上角的「换一条」，会把首屏放回来。 */
body.has-result .hero { display: none; }

.hero {
  /* 全站统一：内容区距顶栏 32px（与 /clean /docs /me 的 wrap padding-top 一致） */
  padding: 32px 24px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 20px 0 14px;
  font-size: clamp(29px, 4.6vw, 52px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero h1 .hl {
  background: linear-gradient(100deg, var(--brand), var(--brand-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.hero-sub {
  margin: 0 auto;
  max-width: 560px;
  color: var(--ink-2);
  font-size: clamp(14px, 1.6vw, 16px);
}

/* ---------------------------------------------------------------- parser */
.parser {
  margin: 28px auto 0;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.parser:focus-within {
  border-color: rgba(255, 43, 86, 0.35);
  box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow);
}

.parser textarea {
  width: 100%;
  /* 四行示例（提示行 + 抖音 / 微博 / B 站）要整段露出来：
     行高 1.7×15px≈25.5，四行 102px，加上下内边距 12px 是 114 —— 给 116 留一点余量。
     给小了最后一行会被容器裁掉，用户就看不到 B 站的 b23.tv 形态。 */
  min-height: 116px;
  max-height: 220px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  padding: 8px 8px 4px;
}

.parser textarea::placeholder { color: #b3b6c2; }

.parser-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.parser-tools { display: flex; gap: 6px; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: translateY(1px) scale(0.995); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn.primary {
  /* 全站统一主按钮：品牌渐变（与后台 btn-ink、/clean /me 的 btn-pri 同款） */
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 10px 22px;
  box-shadow: 0 6px 18px -8px rgba(255, 43, 86, 0.55);
}

.btn.primary:hover { filter: brightness(1.06); }

.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
  padding: 9px 12px;
}

.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn.outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn.outline:hover { border-color: var(--ink-3); }

.btn.soft {
  background: var(--brand-soft);
  color: var(--brand);
}

.btn.soft:hover { background: rgba(255, 43, 86, 0.14); }

.btn .spinner {
  display: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.85; }

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

/* ----------------------------------------------------------------- chips */
.chips {
  margin: 20px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(18, 162, 107, 0.12);
}

.chip:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }

.chip.is-soon {
  cursor: default;
  color: var(--ink-3);
  background: rgba(245, 246, 250, 0.7);
}

.chip.is-soon .dot {
  background: #c9ccd6;
  box-shadow: none;
}

.chip .soon {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eceef4;
  color: #8b8f9e;
}

/* 「需登录」角标（视频号这类已上线但必须登录的平台）：橙色系警示，
   与灰色的「即将上线」区分开；chip 本体保持可点（进关联/登录流程）。 */
.chip .soon.need-login {
  background: rgba(232, 146, 44, 0.14);
  color: #c47a17;
}

/* 「已关闭」角标（后台渠道管理关闭的平台）：红色系，与灰色「暂不可用」
   区分；chip 不可点，解析请求在服务端也会被拒绝。 */
.chip.is-closed {
  cursor: default;
  color: var(--ink-3);
  background: rgba(180, 35, 24, 0.05);
}

.chip.is-closed .dot {
  background: #d38a84;
  box-shadow: none;
}

.chip .soon.closed {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
}

.hero-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- result */
#result-mount {
  padding-top: 12px;
  padding-bottom: 8px;
}

.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fcfcfe);
}

/* 首屏收起后，这是回到输入框的唯一入口，光一个图标认不出来，带个文字 */
#btn-reparse {
  flex: none;
  gap: 6px;
  padding-left: 10px;
  padding-right: 12px;
}

#btn-reparse .reparse-text {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

#btn-reparse:hover .reparse-text { color: var(--ink); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex: 0 0 auto;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.result-who { min-width: 0; flex: 1; }

.result-author {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.result-meta .src { color: #a7aab8; }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  letter-spacing: 0.02em;
}

.badge.neutral { background: var(--surface-2); color: var(--ink-2); }

.result-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 26px;
  padding: 22px 20px 24px;
}

/* 视频预览 */
.preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0c0d12;
  display: grid;
  place-items: center;
  /* 不设 min-height：横屏视频只有 169px 高，留 200px 会凭空多出两条黑边。
     加载前的占位高度由 <video> 自身的默认尺寸给出，跳动很小。 */
  /* 必须按内容高度，不能被右栏拉高：
     .result-body 是两列 grid，grid 项默认 stretch，右栏（标题+正文+按钮）通常更高，
     于是播放器被撑到 300×374，横屏视频在中间留出上下两条黑边。
     这一条之前一直存在，只是抖音/小红书都是竖屏，黑边刚好被 9:16 覆盖住没暴露。 */
  align-self: start;
}

.preview video {
  display: block;
  width: 100%;
  /* 高度交给视频自己的比例，不写死 9:16：
     微博大量是横屏（1280×720），套竖屏框会把画面压成中间一条、上下大片黑边。
     height:auto 让横屏视频按 16:9 铺满宽度；竖屏视频再由 max-height 收住。 */
  height: auto;
  max-height: 532px;
  object-fit: contain;
  background: #0c0d12;
}

.preview-cover {
  width: 100%;
  height: auto;
  max-height: 532px;
  object-fit: contain;
}

/* 播放失败提示：绝对定位压在播放器上。
   写成普通 grid item 的话，它会把 video 挤上去（.preview 是 grid 容器）。 */
.play-fail {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(12, 13, 18, 0.84);
  backdrop-filter: blur(2px);
}

.play-fail[hidden] {
  display: none;
}

.play-fail p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.btn.sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* 图文：把图片区放宽，信息收到右侧窄列（图文主体是图，视频主体是播放器） */
.result-body.is-images {
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
}

/* 图文九宫格。
   用 auto-fit 而不是 auto-fill：auto-fill 会把空轨道也占住，
   4 张图排在 5 列里，右边永远空一条（宽屏下特别明显）。 */
.gallery {
  display: grid;
  /* 列数由 JS 按图片数量给（--gcols）：auto-fit 在桌面会把 6 张排成 5+1，
     第二行孤零零一张、左边一大块空白，不如 3×2 稳。 */
  grid-template-columns: repeat(var(--gcols, 3), minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

/* 只有一张图时给它一块大预览，而不是塞进 120px 的小格 */
.gallery.single {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.gallery.single .shot {
  aspect-ratio: auto;
  background: #0c0d12;
  border-radius: 12px;
  max-width: 100%;
}

.gallery.single .shot img {
  /* .shot img 基础样式是 width/height 100% + cover，这里必须把 height 也改回 auto，
     否则 .shot 的 aspect-ratio 被置成 auto 后高度无处可算，图片会塌成一个小方块。 */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.shot {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.shot:hover img { transform: scale(1.03); }

.shot.is-picked { border-color: var(--brand); }

.shot .pick {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(20, 21, 28, 0.18);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* 可点热区扩到 34px：勾选与看大图分属两个入口，热区太小会误触灯箱。
   视觉保持 20px 不变，透明伪元素负责接点击。 */
.shot .pick::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
}

.shot.is-picked .pick {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.shot .idx {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: #fff;
  background: rgba(12, 13, 18, 0.55);
  border-radius: 999px;
  padding: 1px 7px;
  backdrop-filter: blur(4px);
}

/* ------------------------------------------------------ 灯箱（图片预览） */
/* 遮罩恒为暗色：预览场景下四周压暗才能突出图片本身，与主题色无关 */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 11, 15, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-in 0.16s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-stage {
  margin: 0;
  max-width: min(86vw, 1100px);
  max-height: 78vh;
  display: flex;
}
.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
}

.lb-top {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.lb-count {
  font-size: 13px;
  font-family: var(--mono);
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 12px;
}
.lb-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.22); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-nav[hidden] { display: none; }

.lb-bar {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* 灯箱里按钮在暗底上，浅色主题的 ghost 按钮会看不清——统一反白 */
#lightbox .btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
#lightbox .btn.ghost:hover { background: rgba(255, 255, 255, 0.22); }
.lb-live { display: flex; gap: 8px; }
.lb-live a {
  color: #fff;
  font-size: 12.5px;
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
}
.lb-live a:hover { background: rgba(255, 255, 255, 0.22); }

/* 灯箱开着时锁背景滚动 */
body.lb-open { overflow: hidden; }

/* 失败卡里的智能提示行：给「下一步做什么」的一句建议（showError 按错误
   特征生成），弱化颜色与主报错区分开。 */
.errorcard-hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2, #666);
}

/* 手机端：切换按钮贴边、操作栏允许换行 */
@media (max-width: 640px) {
  .lb-stage { max-width: 94vw; }
  .lb-img { max-height: 70vh; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-bar { flex-wrap: wrap; padding: 0 14px; }
}

/* 实况图角标：点它下载与这张图配对的短视频（下载链接，不参与勾选） */
.shot .live {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  font-size: 11px;
  font-family: var(--mono);
  color: #fff;
  background: rgba(255, 43, 86, 0.82);
  border-radius: 999px;
  padding: 1px 7px;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease;
}

.shot .live:hover { background: var(--brand); }

/* 动态图入口：合成 Motion Photo 的下载链接，放左下角与右下角的「实况」错开，
   蓝底与红底区分「合成文件」和「原始 mp4」两种产物。 */
.shot .live.motion {
  right: auto;
  left: 6px;
  background: rgba(47, 111, 208, 0.82);
}
.shot .live.motion:hover { background: #2f6fd0; }

/* 实况说明条：结果正文里的一条浅色提示，解释「动态图/实况」两种产物
   与手机相册的兼容性（只在实际含实况图时渲染）。 */
.live-note {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--soft, rgba(47, 111, 208, 0.08));
  border-radius: 10px;
}

/* 下载进度条：右下角浮层（流式大文件下载时显示，可取消）。 */
#dl-progress {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(20, 30, 50, 0.16);
  padding: 10px 12px;
}
.dlp-body { display: flex; align-items: center; gap: 10px; }
.dlp-text { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.dlp-track { width: 64px; height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden; flex: none; }
.dlp-fill { height: 100%; width: 0; background: var(--brand, #e5485c); border-radius: 999px; transition: width 0.2s ease; }
.dlp-cancel { font-size: 12px; color: var(--ink-2); background: none; border: none; cursor: pointer; padding: 2px 4px; }
.dlp-cancel:hover { color: var(--brand, #e5485c); }

/* 「我的」弹窗工具区：卡密兑换 / API token / 文件名风格。 */
.me-tools { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line, #e8eaf0); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.me-tool-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-tool-row input { flex: 1; min-width: 180px; padding: 7px 10px; border: 1px solid var(--line, #e8eaf0); border-radius: 8px; font-size: 13px; }
.me-tool-row select { padding: 6px 8px; border: 1px solid var(--line, #e8eaf0); border-radius: 8px; font-size: 13px; }
.me-tool-label { font-size: 12px; color: var(--ink-2, #5b6472); }
.me-tool-note { font-size: 12px; line-height: 1.6; margin: 0; }

/* 右侧信息 */
.info { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.title {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
  margin: 0;
  word-break: break-word;
}

.desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.tag {
  font-size: 12.5px;
  color: #2f6fd0;
  background: rgba(47, 111, 208, 0.07);
  border-radius: 6px;
  padding: 2px 8px;
}

.stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat { display: flex; flex-direction: column; gap: 1px; }

.stat b {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stat span { font-size: 11.5px; color: var(--ink-3); }

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

.actions .btn { flex: 0 1 auto; }
.actions .btn.primary { flex: 1 1 150px; }
.actions .btn.outline { flex: 0 1 auto; min-width: 104px; }

.quality {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quality .grow { flex: 1; }
.quality > .hintline { flex: none; }

/* 只有一档时它不是「可选项」，就别做成下拉的样子 */
.quality-fixed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.quality-fixed em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ok);
  background: rgba(18, 162, 107, 0.1);
  padding: 1px 5px;
  border-radius: 5px;
}

/* ------------------------------------------------------ 自定义下拉（清晰度） */
/* 原生 <select> 的展开层由系统绘制：灰底、系统蓝高亮、圆角压不住，
   和这套界面完全不搭，所以用 button + ul 自己画。 */
.select { position: relative; display: inline-flex; }

.select-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px 0 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.select-btn:hover { border-color: var(--line-strong); background: var(--surface); }

.select.is-open .select-btn {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.select-arrow { color: var(--ink-2); transition: transform 0.18s ease; }
.select.is-open .select-arrow { transform: rotate(180deg); }

.select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 168px;
  width: max-content;
  max-width: 240px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.select.is-open .select-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* 贴着视口底部时向上弹 */
.select.drop-up .select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom left;
}

.select-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.select-opt:hover { background: var(--surface-2); color: var(--ink); }
.select-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.select-opt.is-active {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
}

.select-opt .opt-dim {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.select-opt.is-active .opt-dim { color: var(--brand); opacity: 0.72; }

.select-opt .opt-tick {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.12s;
}

.select-opt.is-active .opt-tick { opacity: 1; }

.quality .mini {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
}

.quality .mini:hover { color: var(--ink); border-color: var(--ink-3); }

.hintline {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  /* flex-start 而不是 center：文案换行时要贴着第一行走，
     否则 <code>（1080P）</code> 会被当成独立 flex 项甩到下一行中间 */
  align-items: flex-start;
  gap: 6px;
}

.hintline > svg {
  flex: none;
  margin-top: 3px;
}

.hintline .hint-text { min-width: 0; }

.hintline code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 加载骨架 */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.sk-row { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.sk-block { border-radius: 10px; background: linear-gradient(90deg, #f1f2f7 25%, #e9eaf1 37%, #f1f2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.sk-circle { width: 38px; height: 38px; border-radius: 50%; }
.sk-line { height: 12px; }
.sk-body { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 26px; }
.sk-media { aspect-ratio: 9/16; max-height: 380px; }
.sk-col { display: flex; flex-direction: column; gap: 12px; }

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

/* 错误态 */
.errorcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap; /* 操作按钮行（flex-basis:100%）要能换到文字下方独占一行 */
  gap: 12px;
  align-items: flex-start;
  animation: rise 0.28s ease;
}

.errorcard .ico {
  color: var(--brand);
  flex: 0 0 auto;
  margin-top: 2px;
}

.errorcard h4 { margin: 0 0 4px; font-size: 14.5px; }
.errorcard p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* --------------------------------------------------------------- 常见问题 */
/* 结果出来之后 FAQ 先收起：此刻用户要的是文件，不是再读一遍说明。
   点顶部「常见问题」会把它放出来再滚过去（app.js 的 reveal 逻辑）。 */
body.has-result:not(.show-info) .faq { display: none; }

/* 卡片风格与个人中心（me 页）统一：白底、细边框、柔和投影 */
.faq {
  margin-top: 28px;
  margin-bottom: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 24px 28px 14px;
  scroll-margin-top: 84px;
}

.faq h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq h2 svg { color: var(--brand); }

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq details:last-child { border-bottom: none; }

.faq summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--ink-3);
  font-weight: 400;
  font-size: 17px;
  line-height: 1;
}

.faq details[open] summary::after { content: "–"; }

.faq details[open] summary { color: var(--ink); }

.faq p { margin: 10px 0 4px; color: var(--ink-2); font-size: 13.5px; }

/* ---------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px;
  flex-wrap: wrap;
}

.footer-brand { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.footer-brand .brand-mark { width: 22px; height: 22px; border-radius: 7px; }
.footer-note { font-size: 12.5px; color: var(--ink-3); }
.footer-note a { color: var(--ink-3); }
.footer-note a:hover { color: var(--ink-2); }
.footer-links { font-size: 12.5px; }
.footer-links a { color: var(--brand); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: rgba(20, 21, 28, 0.94);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  /* 必须高于所有弹窗（paste-mask 95 / channel 120）：曾实测 toast 90 被
     手贴弹窗盖住，失败原因完全不可见，用户感知就是「点保存没反应」。 */
  z-index: 200;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================== 平板：≤1023px ============================= */
@media (max-width: 1023px) {
  .hero { padding-top: 32px; }
  .result-body { grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 20px; }
  .result-body.is-images { grid-template-columns: minmax(0, 1fr) minmax(0, 270px); }
  .gallery { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
}

/* =============================== 手机：≤640px ============================= */
@media (max-width: 640px) {
  body { font-size: 14.5px; }

  .wrap { padding: 0 16px; }
  .topbar-inner { height: 56px; }
  /* 导航保持可见（与 /me、/clean 一致），收间距防挤压 */
  .topnav { gap: 13px; }
  .topnav a { font-size: 13px; }
  .brand-text em { display: none; }

  .hero { padding: 28px 16px 22px; }
  .hero h1 { margin: 14px 0 10px; }
  .hero-sub { font-size: 14px; }

  .parser { margin-top: 20px; border-radius: 16px; padding: 10px; }
  .parser textarea { min-height: 72px; font-size: 14.5px; padding: 6px 4px; }
  .parser-foot { gap: 8px; }
  .parser-tools .btn { padding: 9px 10px; font-size: 13px; }
  .btn.primary { flex: 1; }

  .chips { gap: 6px; margin-top: 14px; }
  .chip { font-size: 12px; padding: 5px 11px; }

  #result-mount { padding-top: 8px; }
  /* 手机端标题和作者名要占位，换一条只留图标 */
  #btn-reparse .reparse-text { display: none; }
  #btn-reparse { padding: 9px 10px; }
  .result { border-radius: 16px; }
  .result-head { padding: 13px 15px; }
  .result-body { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 15px 20px; }
  /* 必须单独覆盖：.result-body.is-images（两列）比 .result-body 更具体，
     不写这一条手机端会残留「1fr + 270px」两列，图片被压成一条窄缝。 */
  .result-body.is-images { grid-template-columns: minmax(0, 1fr); }

  .preview video, .preview-cover { max-height: 460px; }

  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

  .title { font-size: 15.5px; }
  .stats { gap: 14px; padding: 10px 0; }

  /* 手机上把主操作固定在底部，拇指可达 */
  .actions {
    position: sticky;
    bottom: 0;
    padding: 10px 0 max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 32%);
    margin: 4px -15px -20px;
    padding-left: 15px;
    padding-right: 15px;
    z-index: 5;
  }

  .actions .btn { flex: 1 1 44%; }

  .faq { margin: 20px 16px 40px; padding: 18px 18px 10px; }
  .footer-inner { padding: 18px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .toast { bottom: 76px; }
}

/* 窄屏（≤380px）再收一档，避免按钮挤压换行错位 */
@media (max-width: 380px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 26px; }
  .parser-tools .btn span { display: none; }
}

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   视频号 · 元宝登录弹窗
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 21, 28, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-mask[hidden] { display: none; }

.modal {
  width: min(400px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 16px;
  position: relative;
  animation: modal-pop 0.18s ease-out;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal-sub {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 12.8px;
  line-height: 1.6;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--surface-2);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
}
.modal-close:hover { background: var(--line); color: var(--ink); }

.mtabs {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.mtab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 7px 0;
  font-size: 13.5px;
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
}
.mtab.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ------------------------------------------------ 会员登录/注册弹窗（2026-11-26 改版） */
/* 头部：品牌徽标 + 大标题，与旧版「光秃秃一个『会员』标题」区分 */
.auth-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auth-hero h3 { margin: 0; font-size: 18px; letter-spacing: 0.2px; }
.auth-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px var(--brand-soft);
}
/* tab：激活态直接用品牌色实底，比灰底白卡更明确 */
.auth-tabs .mtab.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px var(--brand-soft);
}
/* 输入域：左侧图标 + 圆角输入框，替代裸 <input> 直排 */
.fld {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.fld svg {
  position: absolute;
  left: 13px;
  color: var(--ink-3);
  pointer-events: none;
}
.fld input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 12px 11px 38px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fld input::placeholder { color: var(--ink-3); }
.fld input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
/* 全宽主按钮 */
.btn-block {
  width: 100%;
  margin-top: 4px;
  padding: 11px 0;
  font-size: 14.5px;
  border-radius: 12px;
}
/* 顶栏用户菜单里的邮箱行 */
.user-mail { display: block; color: var(--ink-3); font-size: 12px; }

.mpane { text-align: center; }
.qr-box {
  position: relative;
  width: 200px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}
.qr-box img { display: block; width: 100%; height: auto; min-height: 200px; }
.qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: #fff;
}

.mhint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }

.prow { display: flex; gap: 8px; margin-bottom: 10px; }
.prow input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}
.prow input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.prow .btn { white-space: nowrap; }

.mstatus {
  margin: 14px 0 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}
.mstatus.is-err { color: var(--brand); }

.mfoot {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  min-height: 24px;
}
.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.linklike:hover { text-decoration: underline; }

/* 错误卡里的动作行（视频号登录入口） */
.errorcard-action { margin-top: 10px; display: flex; flex: 0 0 100%; }
.errorcard-action .btn { font-size: 13.5px; padding: 8px 16px; }

/* hidden 属性会被 .prow 的 display:flex 盖掉，显式兜住 */
.prow[hidden] { display: none; }

/* ==========================================================================
   会员体系 · 顶栏登录态 / 渠道账号 / 统计历史 / 登录提示
   ========================================================================== */

/* 通用小件 */
.modal-lg { width: min(640px, 100%); }
.muted { color: var(--ink-3); }
.ok { color: var(--ok); }
.err { color: var(--brand); }

.pill {
  display: inline-block;
  padding: 1.5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}

/* ---------- 顶栏登录态 ---------- */
.top-auth { display: flex; align-items: center; margin-left: 6px; }
.top-auth .btn-auth { padding: 7px 14px; font-size: 13px; border-radius: 999px; }

.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.user-btn:hover { background: var(--surface-2); }
.user-btn:hover .user-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-soft); }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.user-name {
  font-size: 13.5px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 224px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(20, 21, 28, .14), 0 3px 10px rgba(20, 21, 28, .07);
  padding: 6px;
  z-index: 120;
  transform-origin: top right;
  animation: dropIn .16s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: scale(.96) translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .user-drop { animation: none; }
}
.user-drop-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin: 2px 2px 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}
.user-drop-head .ud-name { display: flex; align-items: center; gap: 7px; }
.user-drop-head small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }

/* 配额展示（顶栏下拉 + 统计弹窗共用）：已用/上限文案 + 细进度条 */
.quota-line { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.quota-bar {
  display: block;
  height: 4px;
  margin-top: 5px;
  border-radius: 999px;
  background: #eceef2;
  overflow: hidden;
}
.quota-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3c4152, var(--ink)); }
.quota-bar.warn i { background: linear-gradient(90deg, #ffb02e, #ff8a3d); }
.quota-bar.full i { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.stat-quota { margin: 0 0 10px; }
.stat-quota .quota-line { font-size: 12.5px; }
.stat-quota .quota-bar { height: 6px; }
.user-drop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8.5px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease;
}
.user-drop button svg { flex: none; color: var(--ink-3); transition: color .12s ease; }
.user-drop button:hover { background: var(--surface-2); }
.user-drop button:hover svg { color: var(--ink); }
.user-drop button.danger { color: var(--brand); }
.user-drop button.danger svg { color: var(--brand); }
.user-drop button.danger:hover { background: var(--brand-soft); }

/* ---------- 结果卡上的登录提示条 ---------- */
.login-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 176, 32, 0.12);
  color: #9a6a00;
  font-size: 13px;
  line-height: 1.55;
}
.login-hint svg { flex: none; margin-top: 1px; }
.login-hint span { flex: 1; min-width: 0; }
.login-hint .linklike { color: #9a6a00; font-weight: 600; white-space: nowrap; }
.login-hint .linklike:hover { text-decoration: underline; }

/* ---------- 渠道账号弹窗 ---------- */
.mode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.mode-label { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.mode-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 5.5px 14px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.mode-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.mode-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
#mode-note { font-size: 12px; line-height: 1.5; min-width: 100%; }

.chan-list { display: flex; flex-direction: column; gap: 10px; }
.chan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
}
.chan-card:has(.chan-live:not(:empty)) { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.chan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chan-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chan-info b { font-size: 14px; }
/* 渠道登录档位角标（2026-11-27 用户要求）：需登录=橙色警示、无需登录=绿色，
   与首页平台标签的角标同色系，一眼分清哪些渠道匿名可用。 */
.chan-title { display: flex; align-items: center; min-width: 0; }
.chan-badge {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.chan-badge.need { background: rgba(232, 146, 44, 0.14); color: #c47a17; }
.chan-badge.free { background: rgba(48, 150, 96, 0.12); color: var(--ok, #2f9660); }
.chan-status { font-size: 12.5px; color: var(--ink-3); }
.chan-status.ok { color: var(--ok); }
/* 凭证健康检查结果：✗ 明确失效 / ？无法判断（不代表失效）。 */
.chan-status.bad { color: #d64541; }
.chan-status.warn { color: #c9860a; }
.chan-hint { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.chan-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.chan-actions .btn { font-size: 12.5px; padding: 6.5px 13px; }
/* 渠道卡片图标按钮（2026-11-25 用户反馈：文字按钮太占地，全改图标，
   功能名靠 title 悬停提示）。与 chan-actions .btn 同高，视觉更整齐。 */
.chan-actions .icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chan-actions .icon-btn:hover {
  background: rgba(255, 43, 86, .07);
  color: var(--brand);
  border-color: rgba(255, 43, 86, .35);
}
.chan-actions .icon-btn.danger { color: #d4494f; }
.chan-actions .icon-btn.danger:hover {
  background: rgba(212, 73, 79, .08);
  border-color: rgba(212, 73, 79, .4);
  color: #b93540;
}
.chan-actions .icon-btn svg { display: block; }
.danger-link { color: var(--brand); font-size: 12.5px; }
.mtab.chan-cancel { flex: none; background: transparent; color: var(--ink-3); }

.chan-live { margin-top: 4px; }
.chan-live:not(:empty) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.chan-pane { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chan-pane[hidden] { display: none; }
.chan-pane .mhint { flex: 1 1 180px; min-width: 0; }

.qr-box-sm { width: 168px; height: 168px; flex: none; }
/* 关键：覆盖 .qr-box img 的 min-height:200px（CSS 里 min 赢过 max，会把
   168px 容器里的二维码拉高到 200px 造成溢出裁剪——B 站二维码显示不全的根因）。 */
.qr-box-sm img {
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
}

/* ---------- 统计与历史弹窗 ---------- */
.me-stats { margin: 4px 0 6px; }
.stat-cards { display: flex; gap: 10px; margin-bottom: 10px; }
.stat-card {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}
.stat-card b { font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 12px; color: var(--ink-2); }
.stat-plats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }

.me-sub { margin: 16px 0 8px; font-size: 13.5px; }

/* 历史筛选栏：标题行右侧排布，窄屏时折行到标题下方。 */
.me-hist-head { margin: 16px 0 8px; }
.me-hist-head .me-sub { margin: 0 0 8px; }
.me-hist-filter { display: flex; flex-wrap: wrap; gap: 8px; }
/* display:flex 的 specificity 会压过 hidden 属性的 UA 样式（display:none），
   不补这条「没有历史时隐藏筛选栏」就不生效。 */
.me-hist-filter[hidden] { display: none; }
.me-hist-filter input,
.me-hist-filter select {
  font: inherit;
  font-size: 12.8px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.me-hist-filter input { flex: 1 1 150px; min-width: 0; }
.me-hist-filter input:focus,
.me-hist-filter select:focus { outline: 2px solid rgba(255, 43, 86, 0.25); outline-offset: -1px; }
.hist-count { margin: 0 0 6px; font-size: 12px; display: flex; align-items: center; gap: 10px; }

/* 导出当前筛选结果为 CSV */
.hist-csv {
  font: inherit;
  font-size: 11.5px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.hist-csv:hover { color: var(--brand); border-color: var(--brand); }

/* 历史行可点击重新解析：hover 高亮 + 手型，让"能点"看得出来 */
.hist-row { cursor: pointer; }
.hist-row:hover td { background: var(--brand-soft); }
.hist-row .hist-title { color: var(--ink); }
.me-history { max-height: 320px; overflow: auto; }

/* 收藏星标与合并重复（个人历史增强） */
.hist-dup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.8px;
  color: var(--ink-3);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.hist-favcell { width: 26px; padding-right: 0 !important; }
.hist-fav {
  font: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 2px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.hist-fav:hover { color: var(--brand); }
.hist-fav.on { color: #f5a623; }
.hist-row.is-fav .hist-title { font-weight: 600; }
.hist-dup-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 18px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.hist-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.hist-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--ink-3);
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}
.hist-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hist-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .user-name { display: none; }
  .user-drop { right: -40px; }
  .chan-row { flex-direction: column; align-items: stretch; }
  .chan-actions { justify-content: flex-end; }
  .chan-pane { align-items: flex-start; }
  .hist-title { max-width: 150px; }
  .stat-card b { font-size: 18px; }
}

/* 会员登录弹窗（窄版） */
.modal-sm { width: min(360px, 100%); }

/* ---------- 手贴 Cookie 引导弹窗 ---------- */
/* 叠在渠道账号弹窗之上（手贴流程从那里点进来，关闭后回到列表）。 */
.paste-mask { z-index: 95; }
.modal-md { width: min(520px, 100%); }
.paste-guide {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.paste-guide li { margin-bottom: 4px; }
.paste-guide b { color: var(--ink); }
.paste-guide code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}
.paste-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.paste-actions .btn { flex: 1; font-size: 12.5px; padding: 7px 10px; }
.paste-actions a.btn { text-align: center; text-decoration: none; }
.paste-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
}
.paste-input:focus { outline: none; border-color: var(--brand); }
.paste-msg {
  margin: 8px 0 0;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--ink-2);
}
.paste-msg.err {
  background: #fdecec;
  color: #b42318;
}

.paste-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.paste-foot .muted { font-size: 11.5px; }
.paste-foot .btn { font-size: 12.5px; padding: 6.5px 14px; }
.paste-ext {
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.paste-ext code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  padding: 0 3px;
  background: #eceef4;
  border-radius: 3px;
}
.paste-ext p { margin: 0; }
.paste-ext-actions { display: flex; align-items: center; gap: 8px; margin: 9px 0 0; }
.paste-ext-actions .btn { font-size: 12px; padding: 6px 12px; }
.paste-ext-note { margin: 8px 0 0; font-size: 11px; color: var(--ink-2); }
.paste-manual {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}
.paste-manual b { color: var(--ink-2); }

/* ------------------------------------------------------------ 批量解析 */
/* 列表卡：一次粘多条链接的结果总览。顶部汇总条 + 逐条行卡。 */
.batch {
  max-width: 860px;
  margin: 0 auto;
}

.batch-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.batch-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
  font-size: 13.5px;
}

.batch-sum b { font-size: 14.5px; color: var(--ink); }

.batch-ok { color: #12a26b; font-weight: 600; }
.batch-fail { color: #d4494f; font-weight: 600; }
.batch-trunc { color: #c47a17; font-size: 12px; }
.batch-note { font-size: 12px; color: var(--ink-3); }

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.batch-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.batch-item .dot.ok { background: #12a26b; }
.batch-item .dot.err { background: #d4494f; }

.batch-item.is-fail { background: rgba(212, 73, 79, 0.03); }

.batch-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-item-main b {
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-main small {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-url { color: var(--ink-2) !important; }

.batch-item-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

@media (max-width: 640px) {
  .batch-item { flex-wrap: wrap; }
  .batch-item-acts { width: 100%; justify-content: flex-end; }
}

/* 手机端弹窗：限高可滚（统计与历史这类长内容在 640px 下不该被裁掉），
   底部留 safe-area，贴 home 条的机型不顶边。 */
@media (max-width: 640px) {
  .modal,
  .modal-lg {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .modal-close { top: 8px; right: 8px; }
}
