/* ============================================================
   影析档案 · JINSHCH ARCHIVE
   布局：左侧导航 + 顶部搜索条 + 横幅 + 筛选 + 竖版卡片流
   ============================================================ */

:root {
  --bg: #08080b;
  --bg-2: #0d0d12;
  --panel: #121218;
  --panel-2: #17171f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --fg: #f3f2f7;
  --fg-2: #a5a3b0;
  --fg-3: #6e6c7b;
  --accent: #8b6cf6;
  --accent-2: #a78bfa;
  --accent-soft: rgba(139, 108, 246, 0.15);
  --accent-line: rgba(139, 108, 246, 0.45);
  --ok: #4fd1c5;
  --danger: #f87171;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --sidebar: 208px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
::selection { background: rgba(139, 108, 246, 0.35); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------- shell ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: #0a0a0e;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 20px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #8b6cf6, #5b3fd6);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(139, 108, 246, 0.35);
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; }
.brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  margin-top: 2px;
}

.nav-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 14px 10px 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--fg-2);
  font-size: 13px;
  transition: background 0.16s, color 0.16s;
  position: relative;
}
.nav-item svg { opacity: 0.8; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--fg); }
.nav-item.is-active { background: var(--accent-soft); color: #fff; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--fg-3);
}

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.16s;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.045); }
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(150deg, #3a3a48, #23232c);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--fg-2);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { min-width: 0; }
.user-name { font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 10px; color: var(--fg-3); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
}

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: rgba(8, 8, 11, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.searchbar {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color 0.18s, background 0.18s;
}
.searchbar:focus-within { border-color: var(--accent-line); background: var(--panel-2); }
.searchbar svg { color: var(--fg-3); flex-shrink: 0; }
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.searchbar input::placeholder { color: var(--fg-3); }
.searchbar kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, opacity 0.16s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.22); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(139, 108, 246, 0.28);
}
.btn-primary:hover { background: #9c81f8; border-color: #9c81f8; }
.btn-sm { height: 28px; padding: 0 11px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- content ---------------- */

.content { padding: 22px 28px 70px; }

.banner-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(139, 108, 246, 0.28), transparent 55%),
    linear-gradient(120deg, #16121f 0%, #101018 60%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 104px;
}
.banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.28), transparent 62%);
  pointer-events: none;
}
.banner-text { position: relative; z-index: 1; min-width: 0; }
.banner-text h3 { font-size: 15.5px; margin: 0 0 6px; font-weight: 600; letter-spacing: 0.01em; }
.banner-text p { margin: 0; font-size: 12px; color: var(--fg-2); line-height: 1.7; }
.banner .btn { position: relative; z-index: 1; margin-left: auto; flex-shrink: 0; }

.banner-alt {
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(79, 209, 197, 0.2), transparent 55%),
    linear-gradient(120deg, #101a1a 0%, #101018 60%);
  min-height: 104px;
}
.banner-alt::after { background: radial-gradient(circle, rgba(79, 209, 197, 0.2), transparent 62%); }

/* ---------------- tabs ---------------- */

.filterbar {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 22px; }
.tab {
  border: 0;
  background: transparent;
  padding: 9px 0 11px;
  color: var(--fg-3);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  transition: color 0.16s;
}
.tab:hover { color: var(--fg-2); }
.tab.is-active { color: var(--fg); font-weight: 500; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--fg); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: #d9ccff; }

.result-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--fg-3);
  margin-bottom: 14px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ---------------- card grid ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 16px 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  min-width: 0;
}

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r);
  overflow: hidden;
  background: #0f0f14;
  border: 1px solid var(--line);
  isolation: isolate;
  transition: border-color 0.2s, transform 0.35s var(--ease);
}
.card:hover .cover { border-color: rgba(139, 108, 246, 0.5); transform: translateY(-2px); }

.cover-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(135% 105% at 6% -12%, color-mix(in srgb, var(--c1, #8b6cf6) 96%, transparent), transparent 64%),
    radial-gradient(120% 95% at 102% 88%, color-mix(in srgb, var(--c2, #3b1d63) 100%, transparent), transparent 66%),
    linear-gradient(170deg, #1d1b25 0%, #07070b 90%);
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 42% at 28% 6%, rgba(255, 255, 255, 0.1), transparent 66%);
}
.card:hover .cover-art { transform: scale(1.05); filter: brightness(1.12); }

.cover-frame {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

.cover-no {
  position: absolute;
  right: 15px;
  top: 40px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.4);
}

.cover-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.cover-grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}

.cover-scrim {
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  background: linear-gradient(to top, rgba(4, 4, 7, 0.86) 8%, rgba(4, 4, 7, 0.3) 55%, transparent);
  pointer-events: none;
}

.cover-top {
  position: absolute;
  inset: 9px 9px auto;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  z-index: 2;
}

.badge {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(8, 8, 12, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  line-height: 1.5;
}
.badge-go { color: var(--accent-2); border-color: rgba(139, 108, 246, 0.5); }

.cover-bottom {
  position: absolute;
  inset: auto 0 0;
  padding: 10px 11px;
  z-index: 2;
}
.cover-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.cover-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.03em;
}
.cover-info .views { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }

.cover-hover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6, 6, 10, 0.42);
  backdrop-filter: blur(1px);
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover .cover-hover { opacity: 1; }
.cover-hover .btn { height: 31px; font-size: 12px; padding: 0 13px; }
.play-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(10, 10, 14, 0.5);
  display: grid;
  place-items: center;
  color: #fff;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--fg-3);
  padding: 0 2px;
  min-width: 0;
}
.card-meta .tag {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  color: var(--fg-2);
  white-space: nowrap;
}
.card-meta .files {
  margin-left: auto;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-3);
  padding: 0 2px;
}
.card-author .avatar { width: 16px; height: 16px; font-size: 8px; }

/* ---------------- page head ---------------- */

.page-head { margin-bottom: 24px; }
.page-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.page-head h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 10px 0 0;
}
.page-head p { margin: 10px 0 0; color: var(--fg-2); font-size: 13px; max-width: 46em; }

/* ---------------- watch ---------------- */

.watch-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 20px; align-items: start; }

.player-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
}
.player-shell { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player-shell video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.player-float {
  position: absolute;
  top: 12px;
  right: 50px;
  display: flex;
  gap: 7px;
  opacity: 0;
  transition: opacity 0.2s;
}
.player-shell:hover .player-float, .player-shell:focus-within .player-float { opacity: 1; }

/* 右上角关闭：视频的「关掉」入口，常驻显示，悬停变红 */
.player-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 14, 0.66);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0.75;
  transition: opacity 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
}
.player-close svg { display: block; }
.player-shell:hover .player-close { opacity: 1; }
.player-close:hover,
.player-close:focus-visible {
  background: rgba(224, 82, 82, 0.92);
  border-color: transparent;
  transform: scale(1.06);
  outline: none;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(10, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.glass-btn:hover { border-color: var(--accent); color: var(--accent-2); }

.player-info { padding: 16px 18px 18px; background: var(--bg-2); }
.watch-title { font-size: 19px; font-weight: 600; line-height: 1.4; margin: 0; letter-spacing: -0.005em; }
.watch-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--fg-3);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}
.watch-meta .tag {
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0;
}
.watch-summary { margin: 14px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--fg-2); }

.chapter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 0 2px;
  margin-top: 14px;
  scrollbar-width: thin;
}
.chapter-strip::-webkit-scrollbar { height: 3px; }
.chapter-strip::-webkit-scrollbar-thumb { background: var(--line-2); }
.chapter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s;
}
.chapter-chip .t { font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.chapter-chip:hover { border-color: var(--line-2); color: var(--fg); }
.chapter-chip.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: #ddd2ff; }
.chapter-chip.is-active .t { color: var(--accent-2); }

/* breakdown panel */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}
.panel-head h2 { font-size: 12.5px; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
.panel-head .count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-2);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 0 6px;
}

.file-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.16s;
}
.file-row:hover { background: rgba(255, 255, 255, 0.035); }
.file-row .top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.file-row .name { font-size: 12.5px; font-weight: 500; }
.file-row .desc {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.file-row .foot {
  display: flex;
  gap: 9px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kind {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  white-space: nowrap;
}

.reader { display: block; }
.reader-head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 9px;
  align-items: flex-start;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}
.reader-head .name { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.reader-head .sub {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--fg-3);
  margin-top: 4px;
  letter-spacing: 0.05em;
}
.reader-body {
  padding: 16px 16px 40px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--fg-2);
}
.reader-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  background: var(--panel);
}
.reader-foot .btn { flex: 1; }

.icon-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line-2); }

/* ---------------- markdown ---------------- */

.md h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin: 22px 0 9px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  line-height: 1.5;
}
.md h2:first-child { margin-top: 0; }
.md h3 { font-size: 12.5px; font-weight: 600; color: var(--fg); margin: 18px 0 7px; }
.md p { margin: 0 0 11px; }
.md strong { color: var(--fg); font-weight: 600; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 17px; }
.md li { margin-bottom: 5px; }
.md li::marker { color: var(--fg-3); }
.md blockquote {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-left: 2px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12px;
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md a { color: var(--accent-2); border-bottom: 1px solid var(--accent-line); }
.md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--mono);
  margin: 2px 0 16px;
  display: block;
  overflow-x: auto;
}
.md th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.md td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:last-child td { border-bottom: 0; }

.ts {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-2);
  border: 1px solid var(--accent-line);
  background: rgba(139, 108, 246, 0.12);
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 1px;
  cursor: pointer;
  line-height: 1.7;
  transition: background 0.15s, color 0.15s;
  vertical-align: 1px;
}
.ts:hover { background: var(--accent); color: #fff; }

/* ---------------- files table ---------------- */

.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ftable { width: 100%; border-collapse: collapse; }
.ftable thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ftable td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ftable tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.ftable tbody tr:last-child td { border-bottom: 0; }
.ftable .fname { font-weight: 500; }
.ftable .vt { color: var(--fg-3); }
.ftable .vt:hover { color: var(--accent-2); }
.ftable .num { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); white-space: nowrap; }
.ftable .ops { text-align: right; white-space: nowrap; }

/* ---------------- upload ---------------- */

.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.dropzone {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent-line); background: rgba(139, 108, 246, 0.06); }
.dropzone .dz-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  display: grid;
  place-items: center;
}
.dropzone h3 { margin: 0; font-size: 14px; font-weight: 600; }
.dropzone p { margin: 0; font-size: 11.5px; color: var(--fg-3); }
.dz-file {
  display: none;
  width: 100%;
  text-align: left;
  gap: 12px;
  align-items: center;
}
.dz-file.is-on { display: flex; }
.dz-file .thumb {
  width: 118px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  background: #000;
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.dz-file video, .dz-file img { width: 100%; height: 100%; object-fit: cover; }
.dz-file .meta { min-width: 0; }
.dz-file .n { font-size: 12.5px; font-weight: 500; word-break: break-all; }
.dz-file .s { font-size: 11px; color: var(--fg-3); font-family: var(--mono); margin-top: 3px; }

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  padding: 18px;
}
.form-card h2 { font-size: 13px; margin: 0 0 14px; font-weight: 600; }

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 11.5px;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.field .hint { font-size: 10.5px; color: var(--fg-3); margin-top: 5px; line-height: 1.6; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.16s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-line); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.select { appearance: none; background-image: none; }

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

.file-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--fg-3);
}
.file-pick:hover { border-color: var(--accent-line); color: var(--fg-2); }

.picked-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.picked {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 9px;
}
.picked .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .x { color: var(--fg-3); cursor: pointer; }
.picked .x:hover { color: var(--danger); }

.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 11px; }
.step .n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.step p { margin: 0; font-size: 11.5px; color: var(--fg-3); line-height: 1.7; }

.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid rgba(139, 108, 246, 0.28);
  background: rgba(139, 108, 246, 0.08);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 11.5px;
  color: #cfc4ff;
  line-height: 1.7;
  margin-bottom: 16px;
}
.notice.warn { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); color: #fca5a5; }

/* ---------------- modal / toast ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 7, 0.74);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  translate: 0 10px;
  transition: translate 0.24s var(--ease);
}
.overlay.is-open .modal { translate: 0 0; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 13.5px; margin: 0; font-weight: 600; }
.modal-body { padding: 18px 16px 6px; }
.modal-foot { padding: 12px 16px 16px; display: flex; gap: 8px; }
.modal-foot .btn { flex: 1; }

.link-box { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.link-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 10px 11px;
  outline: none;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-2);
  margin-bottom: 10px;
  cursor: pointer;
  line-height: 1.5;
}
.opt input { accent-color: var(--accent); margin-top: 2px; }
.opt .hint { color: var(--fg-3); font-family: var(--mono); font-size: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  translate: -50% 16px;
  background: #f6f5f9;
  color: #0a0a0e;
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, translate 0.26s var(--ease);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  max-width: 80vw;
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------------- misc ---------------- */

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--fg-3);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}

.skeleton { background: linear-gradient(100deg, #14141b 30%, #1b1b24 50%, #14141b 70%); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: var(--r); }
@keyframes sh { to { background-position: -200% 0; } }

.footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg-3);
}
.footer a:hover { color: var(--fg-2); }

@media (max-width: 1180px) {
  .watch-wrap { grid-template-columns: minmax(0, 1fr) 330px; }
  .upload-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 980px) {
  .watch-wrap, .upload-grid { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .reader-body { max-height: 60vh; }
  .banner-row { grid-template-columns: 1fr; }
}

/* 侧栏只在手机宽度才变成抽屉；其余窗口保持常驻，默认就是打开的 */
@media (max-width: 560px) {
  :root { --sidebar: 0px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    width: 208px;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid !important; }
}

@media (max-width: 640px) {
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .searchbar kbd { display: none; }
  .topbar { gap: 10px; }
  .banner .btn { display: none; }
  .footer { flex-direction: column; }
  .ftable .hide-sm { display: none; }
}

.menu-btn { display: none; }

/* ---- 上传：抽帧封面 / 自动填写状态 ---- */
.dz-file .thumb { position: relative; }
.thumb-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.thumb-poster.is-on { opacity: 1; }
.auto-line {
  font-size: 10.5px;
  color: var(--fg-3);
  margin-top: 5px;
  line-height: 1.5;
}
.auto-line:empty { display: none; }

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--fg-3);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 400;
  flex-shrink: 0;
}
.ai-chip[hidden] { display: none; }
.ai-chip.is-busy {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.ai-chip.is-busy::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: chipPulse 1.1s ease-in-out infinite;
}
.ai-chip.is-ai {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ai-chip.is-local { color: var(--fg-2); }
.ai-chip.is-warn {
  color: #e0a355;
  border-color: rgba(224, 163, 85, 0.4);
}
@keyframes chipPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---- 观看页：源标记与播放失败说明 ---- */
.src-tag {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 10px;
}
.src-link {
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  font-family: var(--sans);
}
.src-link:hover { color: var(--accent); }

#gate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 26px;
  text-align: center;
  background: radial-gradient(circle at 50% 38%, #17151f, #08080b 72%);
  z-index: 3;
}
#gate .gate-title { font-size: 14px; font-weight: 600; color: var(--fg); }
#gate .gate-body {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.8;
  max-width: 24em;
}
#gate .btn { min-height: 32px; }

/* ---- 本地预览提示（仅 127.0.0.1 / localhost 出现） ---- */
.local-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 28px);
  padding: 9px 10px 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(224, 163, 85, 0.34);
  background: rgba(26, 21, 13, 0.95);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  color: #f0e2c9;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
}
.local-notice span { overflow: hidden; text-overflow: ellipsis; }
.local-notice a {
  color: var(--accent-2);
  text-decoration: none;
  flex-shrink: 0;
}
.local-notice a:hover { text-decoration: underline; }
.local-notice .ln-x {
  border: 0;
  background: transparent;
  color: var(--fg-3);
  font-size: 15px;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
  flex-shrink: 0;
}
.local-notice .ln-x:hover { color: var(--fg); }
@media (max-width: 620px) {
  .local-notice { font-size: 10.5px; padding: 8px 8px 8px 12px; gap: 8px; }
}

/* ---- 观看页右侧：复刻方案（面板下半） ---- */
.panel-files { flex: 1 1 auto; min-height: 118px; }

.recipe {
  flex: 0 0 auto;
  max-height: 54%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 143, 138, 0.06), transparent 42%), var(--bg-2);
}
.recipe[hidden] { display: none; }

.recipe-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px 8px;
  flex-shrink: 0;
}
.recipe-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #46d39a;
  box-shadow: 0 0 0 3px rgba(70, 211, 154, 0.14);
  flex-shrink: 0;
}
.recipe-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #63dfa9;
}

.recipe-intro {
  padding: 0 14px 9px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-3);
  flex-shrink: 0;
}
.recipe-intro[hidden] { display: none; }

.recipe-steps {
  list-style: none;
  margin: 0;
  padding: 0 8px 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.recipe-steps li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 6px;
  border-radius: 7px;
  transition: background 0.15s;
}
.recipe-steps li:hover { background: rgba(255, 255, 255, 0.035); }
.recipe-steps .rn {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  color: #63dfa9;
  border: 1px solid rgba(70, 211, 154, 0.28);
  background: rgba(70, 211, 154, 0.08);
}
.recipe-steps .rt {
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.62;
  color: var(--fg-2);
}
.recipe-steps .rt b {
  color: var(--fg);
  font-weight: 600;
  margin-right: 3px;
}
.recipe-steps .rt span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-more {
  flex-shrink: 0;
  margin: 0 12px 11px;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--fg-3);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.recipe-more:hover {
  color: #63dfa9;
  border-color: rgba(70, 211, 154, 0.34);
  background: rgba(70, 211, 154, 0.07);
}

@media (max-width: 980px) {
  /* 窄屏下面板不再固定高度，复刻方案直接跟在文件列表后面展开 */
  .recipe { max-height: none; }
  .recipe-steps { overflow: visible; }
  .panel-files { min-height: 0; }
}

/* ---------------- 其他工具 / 本地视频提取 ---------------- */

.tool-grid {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  gap: 14px;
  align-items: start;
}

.tool-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(139, 108, 246, 0.16), transparent 58%),
    var(--panel);
  padding: 18px;
}
.tool-card-note {
  background: var(--panel);
}
.tool-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -60px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.18), transparent 64%);
  pointer-events: none;
}

.tool-head { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(150deg, #9a7bf8, #6c4fd6);
  box-shadow: 0 8px 22px rgba(139, 108, 246, 0.28);
}
.tool-icon-quiet {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--fg-2);
  box-shadow: none;
}
.tool-title h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.tool-meta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
}

.tool-desc {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--fg-2);
}

.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.tool-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg-2);
}

.tool-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tool-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--fg-3);
  white-space: nowrap;
}
.tool-stat i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-3);
  transition: background 0.2s, box-shadow 0.2s;
}
.tool-stat.is-on { color: #63d9a6; }
.tool-stat.is-on i { background: #3ddc9b; box-shadow: 0 0 0 3px rgba(61, 220, 155, 0.16); }
.tool-stat.is-off { color: #ff9d7a; }
.tool-stat.is-off i { background: #ff8a5c; }

.tool-list {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.95;
  color: var(--fg-2);
}
.tool-list li { margin-bottom: 2px; }

.tool-more {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.tool-more .mono { font-size: 10.5px; color: var(--fg-3); letter-spacing: 0.08em; }
.tool-more p { margin: 0; font-size: 12px; color: var(--fg-3); }

/* ---------- 提取页：满屏 iframe ---------- */

.content-flush { padding: 14px 20px 26px; }

.tool-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 12px;
  flex-wrap: wrap;
}
.tool-bar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-3);
}
.tool-back:hover { color: var(--fg); }
.tool-bar-actions { margin-left: auto; display: flex; gap: 8px; }

.frame-wrap {
  position: relative;
  height: calc(100vh - 178px);
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0a0c11;
}
.frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0a0c11;
}
.frame-gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(139, 108, 246, 0.14), transparent 60%),
    #0a0c11;
}
.frame-wrap.is-on .frame-gate { display: none; }

.gate-card {
  width: min(520px, 100%);
  text-align: center;
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.gate-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--fg-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.gate-card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.gate-card > p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--fg-2); }
.gate-steps {
  margin: 14px 0 0;
  padding-left: 18px;
  text-align: left;
  font-size: 12px;
  line-height: 1.95;
  color: var(--fg-2);
}
.gate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.gate-hint { margin-top: 12px; font-size: 11px; color: var(--fg-3); }

@media (max-width: 980px) {
  .tool-grid { grid-template-columns: 1fr; }
  .frame-wrap { height: calc(100vh - 206px); }
}

/* 本地预览提示条占住底部时，工具框跟着收一点 */
body.has-local-notice .frame-wrap { height: calc(100vh - 218px); }

/* ============================================================
   登录弹窗（账号 / 注册 / 微信扫码）
   ============================================================ */
.hide { display: none !important; }

.auth-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 7, 0.72);
  backdrop-filter: blur(6px);
  animation: auth-fade 0.18s var(--ease);
}
@keyframes auth-fade { from { opacity: 0 } to { opacity: 1 } }

.auth-card {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px 24px 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.auth-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.auth-x:hover { background: var(--panel-2); color: var(--fg); }

.auth-head h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--fg); }
.auth-head p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--fg-3); }

.auth-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 14px;
  padding: 4px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.04);
}
.auth-tabs button {
  flex: 1;
  padding: 8px 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.auth-tabs button.on {
  background: var(--accent-soft);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; }
.auth-form label > span { font-size: 11px; color: var(--fg-3); }
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s var(--ease);
}
.auth-form input:focus { border-color: var(--accent-line); }
.auth-err {
  margin: 0;
  min-height: 15px;
  font-size: 12px;
  color: var(--danger);
}

.btn.auth-submit { width: 100%; padding: 11px 0; }
.btn.wx-btn {
  width: 100%;
  padding: 11px 0;
  border: 1px solid rgba(7, 193, 96, 0.5);
  background: rgba(7, 193, 96, 0.12);
  color: #6fe0a3;
}
.btn.wx-btn:hover { background: rgba(7, 193, 96, 0.2); }
.btn.wx-btn.is-off { border-color: var(--line-2); background: transparent; color: var(--fg-3); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--fg-3);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-3);
}
