/* ==========================================================================
   QOSVideos Archive — 静态资源库样式
   纯手写 CSS，无外部依赖、无网络字体，保证离线可用。
   ========================================================================== */

:root {
  --bg: #090a0f;
  --bg-elev: #0e1017;
  --panel: #12141d;
  --panel-2: #171a26;
  --panel-3: #1d2130;
  --line: #242838;
  --line-soft: #1b1f2c;
  --text: #edeff6;
  --text-2: #b3bad0;
  --muted: #7f879e;
  --dim: #5c6379;
  --accent: #ff3d63;
  --accent-2: #ff8a4c;
  --accent-soft: rgba(255, 61, 99, 0.12);
  --accent-line: rgba(255, 61, 99, 0.35);
  --blue: #6ea8fe;
  --green: #3fd39a;
  --gold: #f0c04a;
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.8);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --max: 1480px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(255, 61, 99, 0.10), transparent 60%),
    radial-gradient(900px 520px at 92% 0%, rgba(110, 168, 254, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* 细滚动条 ----------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262b3c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #333a50; }

/* 布局 --------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 10, 15, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2) 78%);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.5px;
  color: #180409;
  box-shadow: 0 8px 22px -8px rgba(255, 61, 99, 0.75);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: 0.2px; }
.brand-sub { font-size: 10.5px; color: var(--dim); letter-spacing: 1.4px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #ffa9b9; box-shadow: inset 0 0 0 1px var(--accent-line); }

.nav-cta {
  margin-left: 8px;
  padding: 7px 14px !important;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--text) !important;
  box-shadow: inset 0 0 0 1px var(--line);
  font-variant-numeric: tabular-nums;
}
.nav-cta:hover { background: var(--accent-soft) !important; }

/* 页面标题区 --------------------------------------------------------------- */
.page-head { padding: 34px 0 20px; display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -0.6px; font-weight: 700; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* 英雄区 ------------------------------------------------------------------- */
.hero { padding: 44px 0 26px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.hero h1 {
  margin: 14px 0 0;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -1.6px;
  font-weight: 750;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { margin: 16px 0 0; color: var(--text-2); max-width: 560px; font-size: 14.5px; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s ease;
}
.btn:hover { background: var(--panel-3); border-color: #2f3548; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(140deg, var(--accent), #ff5f7d);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 14px 30px -14px rgba(255, 61, 99, 0.9);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(140deg, var(--accent), #ff5f7d); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

.stat-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-card {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute; inset: auto -30% -60% auto;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 99, 0.18), transparent 70%);
}
.stat-label { font-size: 11.5px; letter-spacing: 0.6px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 720; letter-spacing: -0.8px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.storage-bar { grid-column: span 2; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); }
.storage-track { height: 8px; border-radius: 999px; background: #1b1f2c; overflow: hidden; margin-top: 10px; }
.storage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.storage-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* 工具栏 ------------------------------------------------------------------- */
.toolbar {
  position: sticky;
  top: 62px;
  z-index: 40;
  margin: 6px 0 18px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 12px;
  background: rgba(18, 20, 29, 0.86);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.search {
  position: relative;
  flex: 1 1 300px;
  min-width: 200px;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.search input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(255, 61, 99, 0.12); }
.search kbd {
  position: absolute; right: 10px;
  padding: 1px 6px; border-radius: 5px;
  background: var(--panel-3); border: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-family: var(--mono);
}

.select {
  padding: 9px 30px 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-elev) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f879e' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 10px center;
  color: var(--text-2);
  appearance: none;
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--accent-line); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg-elev); border: 1px solid var(--line); }
.seg button {
  display: grid; place-items: center;
  width: 32px; height: 30px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--dim);
  cursor: pointer;
}
.seg button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 2px 8px -4px #000; }
.seg svg { width: 15px; height: 15px; }

.result-count { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-count b { color: var(--text); }

/* 主布局：侧栏 + 内容 ------------------------------------------------------ */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 26px; align-items: start; padding-bottom: 60px; }

.sidebar { position: sticky; top: 128px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 4px; }
.facet { border-radius: 12px; background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; }
.facet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.facet-head span.count { color: var(--dim); letter-spacing: 0; font-size: 11px; }
.facet-body { padding: 8px; display: flex; flex-direction: column; gap: 1px; max-height: 236px; overflow-y: auto; }
.facet-body.tall { max-height: 320px; }

.chip {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip:hover { background: var(--panel-3); color: var(--text); }
.chip .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .n { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--accent-soft); color: #ffb3c1; box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip.on .n { color: #ff8ba0; }
.chip .dotc { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; opacity: 0.85; }

.toggle-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; border-radius: 7px; }
.toggle-row:hover { background: var(--panel-3); }
.toggle-row input { width: 15px; height: 15px; accent-color: var(--accent); }

.facet-more { width: 100%; padding: 8px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.facet-more:hover { color: var(--text); background: var(--panel-2); }
.facet-empty { padding: 10px; color: var(--dim); font-size: 12px; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
}
.pill button { display: grid; place-items: center; width: 16px; height: 16px; border: 0; border-radius: 50%; background: #262b3c; color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1; }
.pill button:hover { background: var(--accent); color: #fff; }
.pill.clear { background: transparent; border-style: dashed; cursor: pointer; color: var(--muted); }
.pill.clear:hover { color: var(--text); border-color: var(--line); }

/* 资源卡片 ----------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; }

.card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #2c3247; box-shadow: var(--shadow-sm); }
.card-thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1a1e2b, #12141d); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease, opacity 0.3s ease; opacity: 0; }
.card-thumb img.loaded { opacity: 1; }
.card:hover .card-thumb img { transform: scale(1.045); }

.thumb-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, #171b27, #101219);
  color: #394054;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
}
.dur {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(5, 6, 10, 0.82);
  color: #f4f6fb;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.flag {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  background: rgba(5, 6, 10, 0.78);
  color: var(--gold);
  border: 1px solid rgba(240, 192, 74, 0.3);
}
.flag.local { color: var(--green); border-color: rgba(63, 211, 154, 0.3); }

.card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-title {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.card:hover .card-title { color: #fff; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #33394d; }
.card-meta .cat { color: #8b93a9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: #4c5367; }

/* 列表视图 ----------------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 78px 92px 92px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 8px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid transparent;
  transition: 0.15s ease;
}
.row:hover { border-color: #2b3145; background: var(--panel-2); }
.row .row-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: #151824; }
.row .row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .row-thumb .dur { right: 4px; bottom: 4px; font-size: 9.5px; padding: 1px 4px; }
.row-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-cell { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.row-head { display: grid; grid-template-columns: 104px minmax(0, 1fr) 78px 92px 92px; gap: 14px; padding: 0 12px 6px 8px; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.row-head span:nth-child(n + 3) { text-align: right; }

/* 分页 --------------------------------------------------------------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 30px 0 10px; flex-wrap: wrap; }
.pager button, .pager a {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pager button:hover, .pager a:hover { background: var(--panel-3); color: var(--text); }
.pager button.on { background: var(--accent-soft); border-color: var(--accent-line); color: #ffb3c1; }
.pager button:disabled { opacity: 0.35; cursor: default; }
.pager .ellipsis { color: var(--dim); padding: 0 4px; }
.pager .jump { margin-left: 8px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.pager .jump input { width: 56px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-elev); text-align: center; outline: none; }

/* 空状态 ------------------------------------------------------------------- */
.empty { padding: 70px 20px; text-align: center; border-radius: 14px; border: 1px dashed var(--line); background: rgba(18, 20, 29, 0.5); }
.empty h3 { margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

/* 详情页 ------------------------------------------------------------------- */
.detail { padding: 24px 0 60px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span.dot { width: 3px; height: 3px; border-radius: 50%; background: #33394d; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 26px; align-items: start; }

.player-shell { border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.player-shell video { width: 100%; aspect-ratio: 16 / 9; background: #000; outline: none; }
.player-placeholder { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: #05060a; }
.player-placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.42; filter: blur(2px); }
.player-placeholder .lock-note { position: relative; text-align: center; padding: 22px 26px; border-radius: 12px; background: rgba(9, 10, 15, 0.82); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.player-placeholder .lock-note strong { display: block; font-size: 15px; margin-bottom: 4px; }
.player-placeholder .lock-note span { font-size: 12px; color: var(--muted); }

.detail-title { margin: 18px 0 8px; font-size: clamp(20px, 2.4vw, 27px); line-height: 1.28; letter-spacing: -0.4px; font-weight: 700; }
.detail-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }
.tag-line { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: 11.5px;
}
a.tag:hover { border-color: var(--accent-line); color: #ffb3c1; background: var(--accent-soft); }
.tag.cat { color: #ffc2cd; background: rgba(255, 61, 99, 0.09); border-color: rgba(255, 61, 99, 0.22); }

.panel { border-radius: 13px; background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; }
.panel-head { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel-body { padding: 14px 16px; }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.kv dd .mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.kv dd a { color: var(--blue); }
.kv dd a:hover { text-decoration: underline; }

.side-stack { display: flex; flex-direction: column; gap: 14px; }
.copy-field { display: flex; gap: 6px; align-items: center; }
.copy-field input {
  flex: 1; min-width: 0;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  outline: none;
}
.copy-field button { padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 11px; }
.copy-field button:hover { color: var(--text); background: var(--panel-3); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.prevnext a { padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); transition: 0.15s ease; }
.prevnext a:hover { border-color: #2c3247; background: var(--panel-2); }
.prevnext .lbl { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.prevnext .t { display: block; margin-top: 3px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prevnext a.next { text-align: right; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 46px 0 16px; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.2px; }
.section-head p { margin: 0; color: var(--dim); font-size: 12.5px; }

/* 分类 / 演员 卡片 --------------------------------------------------------- */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.term-card {
  display: flex; align-items: center; gap: 13px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  transition: 0.18s ease;
}
.term-card:hover { border-color: #2c3247; background: var(--panel-2); transform: translateY(-2px); }
.term-avatar { position: relative; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; background: var(--panel-3); }
.term-avatar img { width: 100%; height: 100%; object-fit: cover; }
.term-avatar.round { border-radius: 50%; }
.term-info { min-width: 0; }
.term-name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-meta { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.term-samples { display: flex; gap: 4px; margin-top: 7px; }
.term-samples img { width: 42px; height: 24px; border-radius: 4px; object-fit: cover; opacity: 0.75; }

/* 标签云 ------------------------------------------------------------------- */
.cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.cloud a {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: 12.5px;
  transition: 0.15s ease;
}
.cloud a:hover { border-color: var(--accent-line); color: #ffb3c1; background: var(--accent-soft); }
.cloud a .n { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.cloud a.big { font-size: 15px; padding: 8px 14px; }
.cloud a.mid { font-size: 13.5px; }

/* 统计看板 ----------------------------------------------------------------- */
.stats-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; padding: 6px 0 26px; }
.metric { padding: 18px 20px; border-radius: 13px; background: linear-gradient(165deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent), transparent); opacity: 0.75; }
.metric .k { font-size: 11.5px; color: var(--muted); letter-spacing: 0.4px; }
.metric .v { font-size: 30px; font-weight: 720; letter-spacing: -1px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.metric .u { font-size: 12px; color: var(--dim); margin-left: 4px; font-weight: 400; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; padding-bottom: 40px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 12px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row .track { height: 7px; border-radius: 999px; background: #1a1e2b; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 61, 99, 0.85), rgba(255, 138, 76, 0.85)); }
.bar-row .fill.alt { background: linear-gradient(90deg, rgba(110, 168, 254, 0.85), rgba(167, 139, 250, 0.85)); }
.bar-row .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.timeline { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.tl-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.tl-bar { width: 100%; max-width: 46px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, rgba(255, 61, 99, 0.9), rgba(255, 61, 99, 0.25)); min-height: 3px; transition: filter 0.15s ease; }
.tl-col:hover .tl-bar { filter: brightness(1.25); }
.tl-label { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tl-value { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: 0 0 auto; }
.donut circle { fill: none; stroke-width: 15; transform: rotate(-90deg); transform-origin: 50% 50%; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.legend-i { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.legend-i i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend-i .pct { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }

/* 关于页 ------------------------------------------------------------------- */
.prose { max-width: 860px; }
.prose h2 { margin: 34px 0 10px; font-size: 17px; letter-spacing: -0.2px; }
.prose h3 { margin: 22px 0 8px; font-size: 14px; color: var(--text); }
.prose p, .prose li { color: var(--text-2); font-size: 13.5px; }
.prose code { padding: 1px 6px; border-radius: 5px; background: var(--panel-3); font-family: var(--mono); font-size: 12px; color: #ffc2cd; }
.prose pre { padding: 16px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line-soft); overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: var(--text-2); }
.prose ul { padding-left: 20px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 12px 0; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); }
.prose th { color: var(--muted); font-weight: 550; font-size: 11.5px; letter-spacing: 0.4px; text-transform: uppercase; }
.notice { padding: 14px 16px; border-radius: 11px; background: rgba(240, 192, 74, 0.07); border: 1px solid rgba(240, 192, 74, 0.22); color: #e8d9a8; font-size: 12.5px; }

/* 页脚 --------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line-soft); padding: 30px 0 44px; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--dim); font-size: 12px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
.footer .meta { font-family: var(--mono); font-size: 11px; }

/* 加载动画 / 骨架 ---------------------------------------------------------- */
.skeleton { border-radius: 12px; background: linear-gradient(100deg, #14171f 30%, #1b1f2c 50%, #14171f 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #2b3145; border-top-color: var(--accent); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }

/* 响应式 ------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: none; }
  .sidebar.open { display: flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .row, .row-head { grid-template-columns: 92px minmax(0, 1fr) 64px; }
  .row-cell.opt, .row-head span.opt { display: none; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 10px; }
  .brand-sub { display: none; }
  .hero { padding: 28px 0 18px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card-body { padding: 9px 10px 10px; }
  .card-title { font-size: 12px; }
  .toolbar { position: static; }
  .result-count { width: 100%; margin-left: 0; }
  .stat-value { font-size: 21px; }
  .metric .v { font-size: 24px; }
  .kv { grid-template-columns: 84px minmax(0, 1fr); }
  .prevnext { grid-template-columns: 1fr; }
  .nav a { padding: 6px 10px; font-size: 12px; }
}

/* 保存到本地 --------------------------------------------------------------- */
.saved-badge {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--green);
  background: rgba(63, 211, 154, 0.1);
  border: 1px solid rgba(63, 211, 154, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.save-body { display: flex; flex-direction: column; gap: 10px; }
.save-state { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.save-progress { height: 7px; border-radius: 999px; background: #1a1e2b; overflow: hidden; }
.save-progress i {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s linear;
}
.save-meta { font-family: var(--mono); font-size: 11px; color: var(--dim); min-height: 15px; }
.save-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.save-hint { margin: 0; font-size: 11.5px; color: var(--dim); line-height: 1.55; }

.flag.saved {
  left: auto;
  right: 8px;
  color: var(--green);
  border-color: rgba(63, 211, 154, 0.35);
  background: rgba(6, 12, 9, 0.82);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border-radius: 10px;
  background: #1b2030;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 61, 99, 0.4); color: #ffb3c1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 打印 --------------------------------------------------------------------- */
@media print {
  .topbar, .toolbar, .sidebar, .pager, .footer, .hero-actions { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (min-width: 981px) { #facetToggle { display: none; } }

