/* ============================================================
   天汪无水印解析 · 设计系统 v2
   方向：暗房工作台。
   墨蓝中性阶 + 一个朱红强调 + 等宽读数；层级只靠表面阶与发丝线。
   版式：作品信息整行 → 视频播放器 → 媒体印相表整行铺满。
   ============================================================ */

:root {
  /* 中性阶 */
  --deep:     #06070b;
  --page:     #0a0b10;
  --card:     #101219;
  --raised:   #171a23;
  --raised-2: #20242f;

  /* 文本三档 */
  --t-primary:   #eef0f5;
  --t-secondary: #a8aebd;
  --t-muted:     #787f93;

  /* 强调：品牌亮黄（取自 logo），暗底上唯一的高饱和色 */
  --accent:      #e8ec12;
  --accent-ink:  #f2f552;
  --accent-soft: rgba(232, 236, 18, 0.11);
  --accent-line: rgba(232, 236, 18, 0.38);

  /* 语义 */
  --ok:      #4cc38a;
  --ok-soft: rgba(76, 195, 138, 0.1);

  /* 发丝线 */
  --line:   rgba(238, 240, 245, 0.075);
  --line-2: rgba(238, 240, 245, 0.14);
  --line-3: rgba(238, 240, 245, 0.22);

  /* 圆角 */
  --r-key:   5px;
  --r-ctl:   8px;
  --r-card:  12px;
  --r-panel: 16px;

  /* 字体 */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

  /* 节奏 */
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 140ms;
  --slow: 280ms;
}

/* ── 重置 ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(130% 60% at 50% -18%, rgba(38, 48, 74, 0.34), transparent 62%),
    var(--page);
  color: var(--t-primary);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.lb-open { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, dl, dd, dt, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

::selection { background: var(--accent); color: #0a0b10; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ── 顶栏 ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 var(--gutter);
  background: rgba(10, 11, 16, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  object-fit: contain;
  border-radius: 6px;
}
.brand-name { font-size: 15.5px; font-weight: 500; letter-spacing: 0.01em; }

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--t-muted);
}
.topbar-status .ico { width: 14px; height: 14px; color: var(--ok); }

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-ctl);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.btn-primary {
  background: var(--t-primary);
  color: var(--page);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { background: #fff; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.55; cursor: progress; transform: none; }

.btn-quiet {
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--t-secondary);
}
.btn-quiet:hover { color: var(--t-primary); border-color: var(--line-3); background: var(--raised-2); }
.btn-quiet .ico { width: 14px; height: 14px; }

.btn-parse { min-width: 104px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-key);
  color: var(--t-muted);
  flex: none;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.icon-btn:hover { color: var(--t-primary); background: var(--raised-2); }
.icon-btn .ico { width: 15px; height: 15px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--t-secondary);
  font-size: 12.5px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.chip-btn:hover {
  color: var(--t-primary);
  border-color: var(--line-3);
  background: var(--raised);
}

.link-btn {
  justify-self: start;
  font-size: 12.5px;
  color: var(--t-muted);
  border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.link-btn:hover { color: var(--accent-ink); border-color: currentColor; }

.spin-when-busy { display: none; }
.btn-primary:disabled .spin-when-busy { display: block; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 68px) var(--gutter) 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  grid-template-areas:
    "copy aside"
    "recent recent";
  gap: 20px clamp(28px, 5vw, 64px);
  align-items: start;
}

/* 左栏用 grid 撑满，末尾一条说明压在底线上，
   这样无论右栏（清单 + 最近解析）多高，两栏底边都对齐 */
.hero-copy {
  grid-area: copy;
  min-width: 0;
}

.hero-aside { grid-area: aside; }
.aside-recent { grid-area: recent; }

.hero-tail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 24px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t-muted);
}
.hero-tail b { font-weight: 500; color: var(--t-secondary); }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--t-muted);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin-bottom: 16px;
  text-wrap: balance;
}
.hero-copy h1 { max-width: 15em; }

.lede {
  font-size: 14.5px;
  line-height: 1.78;
  color: var(--t-secondary);
  max-width: 52ch;
}

/* 输入 */
.parse-form {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  max-width: 680px;
}

.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 46px;
  padding: 0 6px 0 12px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-2);
  background: var(--card);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.field:focus-within { border-color: var(--line-3); background: var(--raised); }
.field-lead { color: var(--t-muted); }

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--t-primary);
}
.field input::placeholder {
  color: var(--t-muted);
  font-family: var(--sans);
  font-size: 13.5px;
}

.parse-form .btn-parse { height: 46px; }

/* Hero 右栏：交付清单 + 最近解析，填满原来的空白 */
.hero-aside {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.aside-block {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  padding: 14px 16px 16px;
}

.aside-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.aside-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.aside-note { font-size: 10.5px; color: var(--ok); }
.aside-head .link-btn { font-size: 11.5px; }

.deliverables { display: grid; gap: 2px; }
.deliverables li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(238, 240, 245, 0.04);
}
.deliverables li:last-child { border-bottom: 0; padding-bottom: 0; }
.deliverables .ico { width: 15px; height: 15px; color: var(--t-secondary); }
.deliverables div { display: grid; gap: 1px; min-width: 0; }
.deliverables b { font-size: 12.5px; font-weight: 500; color: var(--t-primary); }
.deliverables span {
  font-size: 11.5px;
  color: var(--t-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deliverables em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--t-muted);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--page);
}

/* 最近解析：横跨整行的一排卡片 */
.aside-recent {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  padding: 12px 14px 14px;
}
.aside-recent .aside-head { margin-bottom: 10px; }
.aside-recent.is-empty { padding-bottom: 12px; }
.aside-recent.is-empty .aside-head {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.recent {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.recent li { flex: 1 1 0; min-width: 190px; }
.recent button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px 7px 7px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  background: var(--page);
  text-align: left;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.recent button:hover { background: var(--raised); border-color: var(--line-2); }
.recent-thumb {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--raised);
  border: 1px solid var(--line);
}
.recent-text { display: grid; gap: 1px; min-width: 0; }
.recent-text b {
  font-size: 12px;
  font-weight: 400;
  color: var(--t-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-text span { font-size: 10.5px; color: var(--t-muted); }
.recent-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t-muted);
  white-space: nowrap;
}
.recent-empty {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--t-muted);
}
.recent-empty[hidden] { display: none; }

/* ── 舞台 ───────────────────────────────────────────── */
.stage {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  padding: 28px;
}

/* 空态 */
.panel-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 28px;
  text-align: center;
}
.empty-sheet { display: flex; gap: 8px; margin-bottom: 12px; }
.empty-sheet span {
  width: 38px;
  height: 50px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--raised);
}
.empty-sheet span:nth-child(2) { opacity: 0.8; }
.empty-sheet span:nth-child(3) { opacity: 0.6; }
.empty-sheet span:nth-child(4) { opacity: 0.4; }
.empty-sheet span:nth-child(5) { opacity: 0.24; }
.empty-title { font-size: 15px; font-weight: 500; }
.empty-hint { font-size: 13px; color: var(--t-muted); max-width: 40ch; }

/* 骨架 */
.panel-skeleton { display: grid; gap: 20px; }
.sk {
  border-radius: 4px;
  background: var(--raised);
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.sk-work { display: flex; gap: 12px; align-items: center; }
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.sk-lines { display: grid; gap: 8px; flex: 1; }
.sk-line { height: 10px; }
.sk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk-stat { height: 40px; border-radius: var(--r-ctl); }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sk-tile { aspect-ratio: 3 / 4; border-radius: var(--r-card); }

/* 错误 */
.panel-error { display: grid; justify-items: start; gap: 8px; }
.error-title { font-size: 15px; font-weight: 500; }
.error-msg { font-size: 13px; color: var(--t-secondary); max-width: 56ch; }
.panel-error .btn { margin-top: 8px; }

/* ── 结果 ───────────────────────────────────────────── */
.result { display: grid; gap: 14px; }

/* ── 作品信息条 ─────────────────────────────────────── */
.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  overflow: hidden;
}

.work-main {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  align-content: start;
  min-width: 0;
}

.work-idrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-key);
  border: 1px solid var(--line-2);
  background: var(--raised);
  font-size: 12px;
  color: var(--t-primary);
}
.tag .ico { width: 13px; height: 13px; color: var(--t-secondary); }

.work-id {
  font-size: 11.5px;
  color: var(--t-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-author { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--raised);
  border: 1px solid var(--line-2);
  flex: none;
}
.author-text { display: grid; gap: 1px; min-width: 0; }
.author-text strong { font-size: 14px; font-weight: 500; }
.author-text span { font-family: var(--mono); font-size: 11.5px; color: var(--t-muted); }

.work-desc {
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--t-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 78ch;
}
.work-desc.is-open {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}
.work-desc:empty { display: none; }

/* 互动：横排指标 */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.stat {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "ico label"
    "ico value";
  align-items: center;
  column-gap: 7px;
}
.stat-ico {
  grid-area: ico;
  width: 14px;
  height: 14px;
  color: var(--t-muted);
}
.stat dt {
  grid-area: label;
  font-size: 11.5px;
  color: var(--t-muted);
  line-height: 1.2;
}
.stat dd {
  grid-area: value;
  font-size: 13px;
  color: var(--t-secondary);
  line-height: 1.35;
}
.stat dd.strong { color: var(--t-primary); font-weight: 500; }

/* 右栏属性 */
.work-side {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: rgba(6, 7, 11, 0.35);
}
.side-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--t-muted);
  text-transform: uppercase;
}
.side-list { display: grid; gap: 7px; }
.side-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.side-list dt { font-size: 12px; color: var(--t-muted); flex: none; }
.side-list dd {
  font-size: 12px;
  color: var(--t-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-actions { margin-top: 4px; }
.side-actions .btn { width: 100%; height: 34px; font-size: 12.5px; }

/* ── 视频播放器 ─────────────────────────────────────── */
.player-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  overflow: hidden;
}

.player-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% 40%, rgba(34, 40, 58, 0.4), transparent 72%),
    var(--deep);
  padding: 22px;
}

/* 封面做环境底：模糊放大后铺满舞台，两侧不再是一块死黑 */
.player-ambient {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(38px) saturate(1.35) brightness(0.5);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 420ms var(--ease);
  pointer-events: none;
}
.player-ambient[data-on="1"] { opacity: 0.62; }
/* 四周压暗，让画面从背景里浮出来 */
.player-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(72% 62% at 50% 45%, transparent, rgba(6, 7, 11, 0.82) 100%);
  pointer-events: none;
}

/* 画幅容器：海报与 video 共用一个 9:16 框，避免两层元素互相压叠 */
.player-frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, clamp(268px, 34vh, 372px));
  aspect-ratio: 9 / 16;
  border-radius: var(--r-card);
  overflow: hidden;
  background: #000;
  box-shadow: 0 26px 60px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.player-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--slow) var(--ease);
}
.player-poster[src] { opacity: 0.62; }

.player-cta {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 11, 16, 0.62);
  backdrop-filter: blur(10px) saturate(1.2);
  color: var(--t-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.9);
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.player-cta:hover {
  background: rgba(24, 28, 39, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}
.player-cta:active { transform: scale(0.97); }
.player-cta .ico { width: 20px; height: 20px; color: var(--accent-ink); flex: none; }

/* ── 自绘播放器 ─────────────────────────────────────── */
.vplayer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* 中央播放/暂停：点一下画面就出，暂停时保持常亮 */
.vp-center {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 9, 14, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.vp-center .ico { width: 26px; height: 26px; }
.vp-center:hover { background: rgba(20, 24, 34, 0.8); }
/* 中央按钮：悬停、暂停、或控件可见时出现 */
.player-frame:hover .vp-center,
.vplayer.is-paused .vp-center,
.vplayer:not(.is-playing) .vp-center { opacity: 1; transform: scale(1); }
.vplayer.is-playing.is-idle .vp-center { opacity: 0; transform: scale(0.9); }

/* 底部控制条 */
.vp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(4, 5, 8, 0.92) 12%, rgba(4, 5, 8, 0.55) 58%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
/* 播放中且鼠标静止 → 收起；其余情况都显示 */
.vplayer.is-playing.is-idle .vp-bar { opacity: 0; transform: translateY(6px); }
.player-frame:hover .vplayer .vp-bar,
.vplayer.is-paused .vp-bar,
.vplayer:not(.is-playing) .vp-bar,
.vp-bar:focus-within { opacity: 1; transform: none; }

/* 进度条 */
.vp-seek {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
  cursor: pointer;
  touch-action: none;
}
.vp-rail {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.19);
  overflow: hidden;
  transition: height var(--fast) var(--ease);
}
.vp-seek:hover .vp-rail,
.vp-seek.is-scrubbing .vp-rail { height: 5px; }
.vp-buffer,
.vp-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
}
.vp-buffer { background: rgba(255, 255, 255, 0.24); }
.vp-played { background: var(--accent); }
.vp-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 236, 18, 0.26);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
  pointer-events: none;
}
.vp-seek:hover .vp-thumb,
.vp-seek.is-scrubbing .vp-thumb { opacity: 1; transform: scale(1); }

/* 控件行 */
.vp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.86);
}
.vp-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: inherit;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.vp-btn:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }
.vp-btn .ico { width: 17px; height: 17px; }

.vp-clock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}
.vp-clock b { font-weight: 500; color: #fff; }
.vp-sep { opacity: 0.45; }

.vp-spacer { flex: 1; }

.vp-chip {
  height: 24px;
  min-width: 34px;
  padding: 0 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.vp-chip:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }

.vp-vol { display: flex; align-items: center; }
.vp-range {
  width: 0;
  height: 3px;
  margin-left: 0;
  border-radius: 2px;
  appearance: none;
  background: rgba(255, 255, 255, 0.24);
  opacity: 0;
  cursor: pointer;
  transition: width var(--slow) var(--ease), opacity var(--fast) var(--ease),
              margin-left var(--fast) var(--ease);
}
.vp-vol:hover .vp-range,
.vp-range:focus-visible { width: 62px; margin-left: 6px; opacity: 1; }
.vp-range::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}
.vp-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

/* 全屏时容器铺满，控制条贴底 */
.player-frame:fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  aspect-ratio: auto;
}
.player-frame:fullscreen .player-video { object-fit: contain; }

.player-side {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: rgba(6, 7, 11, 0.35);
}

.player-title {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--t-primary);
  word-break: break-word;
}

.gear-list { display: grid; gap: 5px; }
.gear {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.gear:hover { border-color: var(--line-2); background: var(--raised); }
.gear[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.gear[aria-checked="true"] .gear-res { color: var(--t-primary); }
.gear.is-static { cursor: default; }
.gear-res { font-size: 12px; color: var(--t-secondary); }
.gear-meta { font-size: 10.5px; color: var(--t-muted); }

.player-actions { display: grid; gap: 6px; }
.player-actions .btn { width: 100%; height: 38px; }

.player-meta { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── 媒体区 ─────────────────────────────────────────── */
.media-shell {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--card);
  overflow: hidden;
}

.media-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.media-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.media-heading h2 { font-size: 13.5px; font-weight: 500; }
.media-count { font-size: 12px; color: var(--t-muted); }
.media-sub {
  font-size: 11.5px;
  color: var(--t-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  background: var(--page);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--t-muted);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.seg-btn .ico { width: 13px; height: 13px; }
.seg-btn:hover { color: var(--t-secondary); }
.seg-btn[aria-pressed="true"] { background: var(--raised-2); color: var(--t-primary); }

.media-tools .btn { height: 30px; padding: 0 11px; font-size: 12.5px; }

/* ── 接触印相表 ─────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 10px;
  padding: 14px;
  align-content: start;
}

/* 少量条目时不把卡片撑满整行 */
.media-grid[data-count="1"] { grid-template-columns: minmax(0, 300px); }
.media-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 300px)); }
.media-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 280px)); }

.frame {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  overflow: hidden;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.frame:hover { border-color: var(--line-2); }

/* 缩略图与实况轨共用的画幅框：视频放在按钮外面，
   避免按钮内的媒体元素被当作交互内容处理 */
.frame-visual {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--raised);
}

.frame-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
}
.frame-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.frame-img img.loaded { opacity: 1; }
.frame:hover .frame-img img { transform: scale(1.02); }

.frame-no {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(6, 7, 11, 0.82);
  color: var(--t-secondary);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.live-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(6, 7, 11, 0.82);
  border: 1px solid rgba(76, 195, 138, 0.35);
  color: var(--ok);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
}
.live-mark .ico { width: 10px; height: 10px; }

/* 实况轨：与缩略图同层，悬停淡入替换静帧 */
.frame-live {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms var(--ease);
  background: #000;
  pointer-events: none;
  transition: opacity var(--slow) var(--ease);
}
.frame.is-previewing .frame-live { opacity: 1; }
.frame.is-previewing .frame-img img { opacity: 0; }

.frame-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(6, 7, 11, 0.78);
  color: var(--t-primary);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.frame-zoom .ico { width: 13px; height: 13px; }
.frame:hover .frame-zoom,
.frame-img:focus-visible .frame-zoom { opacity: 1; transform: none; }

.frame-meta {
  display: grid;
  gap: 7px;
  padding: 8px 9px 9px;
  border-top: 1px solid var(--line);
}

.frame-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.frame-name {
  display: none;
  min-width: 0;
  font-size: 11.5px;
  color: var(--t-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame-dim { font-size: 11px; color: var(--t-secondary); }
.frame-fmt { font-size: 10.5px; color: var(--t-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.frame-fmt.live { color: var(--ok); }

.frame-acts { display: flex; gap: 4px; }

.act {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 27px;
  padding: 0 5px;
  border-radius: var(--r-key);
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--t-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.act:hover { color: var(--t-primary); border-color: var(--line-3); background: var(--raised-2); }
.act .ico { width: 12px; height: 12px; }
.act.primary {
  background: var(--t-primary);
  border-color: transparent;
  color: var(--page);
  font-weight: 500;
}
.act.primary:hover { background: #fff; color: var(--page); }
.act.icon-only { flex: 0 0 27px; width: 27px; padding: 0; }

/* 清单态 */
.media-grid[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 6px;
}
.media-grid[data-view="list"] .frame {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}
.media-grid[data-view="list"] .frame-visual {
  width: 84px;
  aspect-ratio: 1;
  border-radius: var(--r-ctl);
}
.media-grid[data-view="list"] .frame-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-top: 0;
  padding: 0;
  min-width: 0;
}
.media-grid[data-view="list"] .frame-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
}
.media-grid[data-view="list"] .frame-name { display: block; }
.media-grid[data-view="list"] .frame-acts { flex: none; width: auto; }
.media-grid[data-view="list"] .act { height: 30px; }
.media-grid[data-view="list"] .frame-zoom { display: none; }
.media-grid[data-view="list"] .frame-live { display: none; }

/* ── 音频 ───────────────────────────────────────────── */
.audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--page);
}
.audio-art {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--raised);
  flex: none;
}
.audio-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.audio-text strong {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-text span { font-family: var(--mono); font-size: 11px; color: var(--t-muted); }
.audio-row audio { height: 28px; max-width: 220px; filter: invert(1) hue-rotate(180deg) opacity(0.7); }

/* ── 灯箱 ───────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 14px clamp(12px, 4vw, 40px) 18px;
}
.lb-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.94);
  backdrop-filter: blur(10px);
}

.lb-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
}
.lb-counter { font-size: 12px; color: var(--t-secondary); }
.lb-title { font-size: 12.5px; color: var(--t-muted); }
.lb-close { margin-left: auto; width: 34px; height: 34px; }
.lb-close .ico { width: 17px; height: 17px; }

/* 舞台：绝对定位的媒体框让 max-height:100% 有确定的参照高度，
   否则 grid 行会被内容撑开、图片直接按原尺寸溢出窗口 */
.lb-stage {
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow: hidden;
  padding: 8px 0;
}

/* flex 容器的百分比 max-height 才有确定参照；grid 的隐式行会被内容撑开，
   max-height:100% 退化成 none —— 这正是图片按原尺寸溢出的原因 */
.lb-media {
  position: absolute;
  inset: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}
.lb-media.is-zoomed { cursor: grab; }
.lb-media.is-dragging { cursor: grabbing; transition: none; }

.lb-media img,
.lb-media video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: var(--r-card);
  background: #000;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(var(--zoom, 1));
  transform-origin: center center;
  transition: transform 140ms var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-media video { aspect-ratio: 9 / 16; cursor: default; }
.lb-media.is-dragging img,
.lb-media.is-dragging video { transition: none; }

.lb-hint {
  margin-left: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raised);
  font-size: 10.5px;
  color: var(--t-muted);
  white-space: nowrap;
  pointer-events: none;
}
.lb-hint[hidden] { display: none; }
@media (max-width: 720px) { .lb-hint { display: none; } }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(16, 18, 25, 0.86);
  color: var(--t-secondary);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.lb-nav:hover { color: var(--t-primary); background: var(--raised-2); }
.lb-nav:disabled { opacity: 0.3; cursor: default; }
.lb-nav.prev { left: clamp(4px, 1.5vw, 16px); }
.lb-nav.next { right: clamp(4px, 1.5vw, 16px); }
.lb-nav.prev .ico { transform: rotate(90deg); }
.lb-nav.next .ico { transform: rotate(-90deg); }

.lb-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.lb-meta { font-size: 11.5px; color: var(--t-muted); }
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-actions .btn { height: 36px; font-size: 12.5px; }

.lb-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  background: var(--raised);
}
.zoom-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-radius: 5px;
  color: var(--t-secondary);
  font-size: 15px;
  line-height: 1;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.zoom-btn:hover { color: var(--t-primary); background: var(--raised-2); }
.zoom-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.zoom-level {
  min-width: 46px;
  height: 26px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--t-secondary);
  font-variant-numeric: tabular-nums;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.zoom-level:hover { color: var(--t-primary); background: var(--raised-2); }
.zoom-fit {
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--t-muted);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.zoom-fit:hover { color: var(--t-primary); background: var(--raised-2); }

/* ── 页脚 ───────────────────────────────────────────── */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter) 44px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--t-muted);
}
.footer .sep { opacity: 0.4; }
.footer-note { margin-left: auto; opacity: 0.8; }

/* ── Toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translate(-50%, 8px);
  padding: 8px 14px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--t-primary);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="err"] { border-color: rgba(224, 69, 44, 0.5); }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "aside"
      "recent";
    gap: 22px;
  }
  .hero-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .hero-aside .aside-block { height: 100%; }

  .work-card { grid-template-columns: minmax(0, 1fr); }
  .work-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px 24px;
  }
  .work-side .side-label { grid-column: 1 / -1; }
  .work-side .side-actions { grid-column: 1 / -1; }

  .player-card { grid-template-columns: minmax(0, 1fr); }
  .player-side { border-left: 0; border-top: 1px solid var(--line); }

  .media-grid[data-view="list"] .frame-acts { width: 240px; }
}

@media (max-width: 720px) {
  .hero { padding-top: 28px; }
  /* 手机上把右栏整块收起：解析结果才是主体，别让它把首屏推长 */
  .hero-aside { display: none; }
  .hero h1 { font-size: 28px; max-width: none; }
  .lede { font-size: 13.5px; }

  .parse-form { flex-wrap: wrap; }
  .field { flex: 1 1 100%; }
  .btn-parse { flex: 1 1 100%; }

  .panel { padding: 18px; }

  .work-main { padding: 16px; gap: 13px; }
  .work-side { padding: 16px; }
  .stat-strip { gap: 9px 20px; }

  .player-stage { min-height: 240px; }
  .player-side { padding: 16px; }

  .media-bar { padding: 10px 12px; }
  .media-grid { padding: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .media-grid[data-count="1"] { grid-template-columns: minmax(0, 240px); }
  .media-grid[data-count="2"],
  .media-grid[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .media-grid[data-view="list"] .frame {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }
  .media-grid[data-view="list"] .frame-visual { width: 64px; }
  .media-grid[data-view="list"] .frame-meta {
    display: grid;
    gap: 6px;
    justify-content: stretch;
  }
  .media-grid[data-view="list"] .frame-acts { width: auto; }
  .media-grid[data-view="list"] .frame-name { display: none; }

  .audio-row { flex-wrap: wrap; }
  .audio-row audio { width: 100%; max-width: none; }

  .lb-nav { display: none; }
  .lb-foot { gap: 8px; }
  .lb-meta { display: none; }
  .lb-zoom { flex: 1; justify-content: center; gap: 6px; }
  .lb-zoom .zoom-fit { margin-left: 2px; }
  .lb-actions { width: 100%; }
  .lb-actions .btn { flex: 1; height: 40px; }
  .lb-stage { padding: 4px 0; }

  .footer-note { margin-left: 0; width: 100%; }
}

@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;
  }
  .frame:hover .frame-img img { transform: none; }
}
