/* ============================================================================
   短剧推荐站 · 共享设计系统
   ----------------------------------------------------------------------------
   这个文件替代了原先散在 index.html / trending.html / admin.html 里的三份内联
   <style>。改版前实测：三页各自内联约 13KB CSS，页面间**完全无法复用缓存** ——
   访客从首页点到榜单页，同样的按钮、卡片、模态样式要重新下载一遍，gzip 前共 90KB。
   抽成单文件后三页共用一个 304/缓存命中地址。

   CSP 侧无需改动：服务端 script-src / style-src 都是 'self'，同源静态文件放行。

   组织顺序：令牌 → 基础 → 组件 → 页面骨架 → 响应式。
   颜色一律走令牌，不在组件里写死色值 —— 否则改主题要满文件找 #。
   ============================================================================ */

/* ============================================================ 1. 设计令牌 */
:root {
  /* --- 表面层级：从最底到最浮 --- */
  --bg:          #08080b;
  --bg-elev:     #0e0e13;
  --surface:     #14141b;
  --surface-2:   #1a1a23;
  --surface-3:   #23232e;
  --line:        #262630;
  --line-strong: #363642;

  /* --- 文本层级 --- */
  --ink:   #f4f4f7;
  --ink-2: #a6a6b2;
  --ink-3: #71717f;

  /* --- 品牌红 --- */
  --brand:      #e50914;
  --brand-hi:   #ff2b38;
  --brand-ink:  #ffffff;
  --brand-soft: rgba(229, 9, 20, .12);
  --brand-line: rgba(229, 9, 20, .34);

  /* --- 语义色 --- */
  --gold:   #f5c518;
  --ok:     #3ddc84;
  --warn:   #ffb020;
  --danger: #ff4d4f;

  /* --- 专区色（前台专区 tab 与标签用） --- */
  --zone-lgbt:      #a855f7;
  --zone-lgbt-soft: rgba(168, 85, 247, .14);
  --zone-lgbt-line: rgba(168, 85, 247, .34);
  --zone-les:       #ec4899;
  --zone-les-soft:  rgba(236, 72, 153, .14);
  --zone-les-line:  rgba(236, 72, 153, .34);

  /* --- 圆角 --- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;

  /* --- 间距（4 的倍数，统一节奏） --- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* --- 字阶 --- */
  --t-xs: 11.5px;
  --t-sm: 12.5px;
  --t-md: 14px;
  --t-lg: 16px;
  --t-xl: 20px;
  --t-2xl: 26px;
  --t-3xl: 34px;

  /* --- 阴影 --- */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .40);
  --sh-2: 0 8px 24px rgba(0, 0, 0, .45);
  --sh-3: 0 20px 56px rgba(0, 0, 0, .62);
  --sh-brand: 0 8px 26px rgba(229, 9, 20, .30);

  /* --- 层级 --- */
  --z-sticky: 100;
  --z-drawer: 200;
  --z-modal:  300;
  --z-toast:  400;

  /* --- 版心 --- */
  --page: 1280px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================================ 2. 基础 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 锚点跳转时给吸顶头留出空间，否则标题会被压在头下面 */
  scroll-padding-top: 92px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
/* height:auto 是必需的，不是保险起见：
   海报 <img> 都写了 width/height 属性来消 CLS，而属性高度会被当成
   「表现提示」锁死元素高度 —— 此时 CSS 里写的 aspect-ratio 完全不起作用。
   显式声明 height:auto 后，aspect-ratio 才接管高度，属性仍能保留
   （浏览器用它算占位，CLS 照样不抖）。
   下面 .card-poster img / .modal-poster img 等更具体的选择器里有明确高度，
   优先级高于这一条，不受影响。 */
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }

/* ⚠️ 必须放在组件规则之前把 [hidden] 钉死。
   UA 样式表里 [hidden]{display:none} 的优先级最低，任何写了 display 的
   组件类（.grid/.panel-grid/.bars …）都会把它压掉 —— 结果是 JS 里设了
   el.hidden = true 却依然可见。用 !important 一次性解决，比给每个
   组件都补一条 &[hidden] 可靠。 */
[hidden] { display: none !important; }

/* 页面底噪：一层极淡的径向渐变，避免大面积纯黑显得像没渲染完 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -8%,  rgba(229, 9, 20, .07), transparent 62%),
    radial-gradient(760px 460px at 92% 4%,   rgba(168, 85, 247, .05), transparent 60%);
}
body > * { position: relative; z-index: 1; }

/* 焦点环：只在键盘导航时出现，鼠标点击不闪 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 滚动条（桌面） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-full); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

::selection { background: var(--brand); color: #fff; }

/* ============================================================ 3. 无障碍工具 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* 键盘用户的跳转到主内容链接 */
.skip-link {
  position: absolute; left: var(--s-4); top: -60px;
  z-index: var(--z-toast);
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-weight: 600; font-size: var(--t-sm);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: var(--s-4); }

.page { max-width: var(--page); margin: 0 auto; padding: 0 var(--s-5); }

/* ============================================================ 4. 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: var(--t-md);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--sh-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hi); }

.btn-outline { border-color: var(--line-strong); color: var(--ink-2); background: transparent; }
.btn-outline:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }

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

.btn-danger { background: rgba(255, 77, 79, .14); color: var(--danger); border-color: rgba(255, 77, 79, .34); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 77, 79, .22); }

.btn-sm { padding: 6px 11px; font-size: var(--t-sm); border-radius: var(--r-xs); }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-block { width: 100%; }

/* 图标按钮的语义化版本：可见文字 + 图标 */
.btn .ico { font-size: 1.05em; line-height: 1; }

/* ============================================================ 5. 表单控件 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--t-sm); color: var(--ink-2); font-weight: 600; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--t-md);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { cursor: pointer; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5l4-4' fill='none' stroke='%23a6a6b2' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
.select-sm { padding: 6px 30px 6px 11px; font-size: var(--t-sm); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--t-md); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--line);
  position: relative; transition: background .2s var(--ease), border-color .2s var(--ease);
  flex: 0 0 auto;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.switch input:checked + .track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--brand-hi); outline-offset: 2px; }

/* --- 分段控件：替代原生 select 的现代做法 --- */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg button {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: var(--sh-1); }

/* ============================================================ 6. 品牌头与导航 */
.app-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(8, 8, 11, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header-inner {
  max-width: var(--page); margin: 0 auto;
  padding: 0 var(--s-5);
  display: flex; align-items: center; gap: var(--s-5);
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: .2px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--brand), #ff5a63 70%);
  display: grid; place-items: center;
  font-size: 17px; box-shadow: var(--sh-brand);
}
.brand-name b { color: var(--brand); }

.nav { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.nav a {
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: var(--t-md); font-weight: 600; color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-3); }

/* 搜索：头里占满剩余宽度，但不超过一个舒适上限 */
.search { position: relative; margin-left: auto; flex: 1 1 260px; max-width: 380px; }
.search .ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 15px; pointer-events: none;
}
.search input {
  width: 100%; padding: 10px 12px 10px 38px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink); font-size: var(--t-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.search .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center;
  color: var(--ink-3); font-size: 15px;
}
.search .clear:hover { background: var(--surface-3); color: var(--ink); }
.search.has-value .clear { display: grid; }

/* 吸顶筛选条：紧跟头部之下，滚动时保持可见 */
.filterbar {
  position: sticky; top: 64px; z-index: calc(var(--z-sticky) - 1);
  background: rgba(8, 8, 11, .90);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.filterbar-inner {
  max-width: var(--page); margin: 0 auto; padding: 10px var(--s-5);
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.filterbar .spacer { flex: 1 1 auto; }

/* --- 专区 tab --- */
.zone-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.zone-tabs::-webkit-scrollbar { display: none; }
.zone-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-sm); font-weight: 600; letter-spacing: .2px;
  white-space: nowrap; cursor: pointer;
  transition: all .2s var(--ease);
}
.zone-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.zone-tab .n {
  font-size: var(--t-xs); font-weight: 700;
  padding: 1px 6px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .07); color: var(--ink-2);
}
/* 选中态用 aria-pressed 而不是 aria-selected：
   这排是「筛选按钮组」不是「标签页」（没有对应的 tabpanel），
   用 tab 语义会要求实现方向键切换，反而把无障碍做成了形式主义。 */
.zone-tab[aria-pressed="true"] { color: #fff; border-color: transparent; }
.zone-tab[data-accent="all"][aria-pressed="true"]     { background: var(--brand); box-shadow: var(--sh-brand); }
.zone-tab[data-accent="lgbt"][aria-pressed="true"]    { background: var(--zone-lgbt); box-shadow: 0 6px 20px rgba(168, 85, 247, .34); }
.zone-tab[data-accent="lesbian"][aria-pressed="true"] { background: var(--zone-les);  box-shadow: 0 6px 20px rgba(236, 72, 153, .34); }
.zone-tab[aria-pressed="true"] .n { background: rgba(255, 255, 255, .22); color: #fff; }

/* 结果计数 */
.result-count { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.result-count b { color: var(--ink); font-weight: 700; }

/* ============================================================ 7. 专区说明条 */
.zone-banner {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  margin-bottom: var(--s-5);
}
.zone-banner .em { font-size: 26px; flex: 0 0 auto; }
.zone-banner h2 { font-size: var(--t-lg); margin-bottom: 2px; }
.zone-banner p { font-size: var(--t-sm); color: var(--ink-2); }
.zone-banner[data-accent="lgbt"] {
  background: linear-gradient(135deg, var(--zone-lgbt-soft), transparent 70%);
  border-color: var(--zone-lgbt-line);
}
.zone-banner[data-accent="lgbt"] h2 { color: var(--zone-lgbt); }
.zone-banner[data-accent="lesbian"] {
  background: linear-gradient(135deg, var(--zone-les-soft), transparent 70%);
  border-color: var(--zone-les-line);
}
.zone-banner[data-accent="lesbian"] h2 { color: var(--zone-les); }

/* ============================================================ 8. 横滑轨道（热播） */
.rail-sec { margin-bottom: var(--s-6); }
.rail-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.rail-head h2 { font-size: var(--t-lg); }
.rail-head .sub { font-size: var(--t-sm); color: var(--ink-3); }
.rail-head a { margin-left: auto; font-size: var(--t-sm); color: var(--ink-2); font-weight: 600; }
.rail-head a:hover { color: var(--brand-hi); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px;
  gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-2);
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* 榜单里的小卡 */
.mini {
  display: block; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  position: relative; cursor: pointer;
  transition: border-color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.mini:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--sh-2); }
.mini-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--surface-2); }
.mini-body { padding: 10px 11px 12px; }
.mini-title { font-size: var(--t-sm); font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-sub { font-size: var(--t-xs); color: var(--ink-3); margin-top: 3px; }
.mini-rank {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-xs);
  display: grid; place-items: center;
  font-size: var(--t-xs); font-weight: 800;
  background: rgba(0, 0, 0, .72); color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(4px);
}
.mini-rank.top { background: var(--brand); color: #fff; border-color: transparent; }

/* ============================================================ 9. 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: var(--s-5) var(--s-4);
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: var(--sh-2); }

/* 海报位：显式 aspect-ratio + HTML 上写死 width/height，
   两者一起把 CLS 压到 0（图片没到之前盒子已经占好位） */
.card-poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface-2); }
.card-poster img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform .5s var(--ease);
}
.card:hover .card-poster img { transform: scale(1.055); }
.card-poster::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, transparent 34%, transparent 62%, rgba(0, 0, 0, .55) 100%);
}
.card-play {
  position: absolute; inset: 0; margin: auto;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(229, 9, 20, .93);
  display: grid; place-items: center;
  color: #fff; font-size: 17px;
  opacity: 0; transform: scale(.86); z-index: 3;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; transform: scale(1); }

.card-body { padding: var(--s-3) var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
  font-size: var(--t-md); font-weight: 600; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .18s var(--ease);
}
.card:hover .card-title { color: #fff; }
.card-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); margin-top: auto; }
.card-desc {
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 徽标与标签 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-xs);
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
}
.badge-gold { background: linear-gradient(135deg, var(--gold), #e0ae00); color: #191200; }
.badge-float { position: absolute; top: 9px; left: 9px; z-index: 4; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }

/* 「New」：新增剧在 12 小时窗口内自动挂上，到点由前端定时器摘掉。
   用品牌红实底（不是软底）—— 它会出现在深浅不定的海报、纯色行、弹窗标题里，
   软底在浅色背景上会糊。文字用纯白保证在实底上对比度足够。 */
.badge-new {
  background: var(--brand); color: #fff;
  text-transform: uppercase; letter-spacing: .6px;
  box-shadow: 0 2px 8px rgba(229, 9, 20, .35);
}
/* 左上角徽标容器：New 与 Featured 可能同时存在，
   各自 absolute 到同一个 top/left 会互相盖住，所以要并排在一个 flex 里。 */
.badge-stack {
  position: absolute; top: 9px; left: 9px; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 18px);
}
.badge-stack .badge { box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }

/* 行内 / 标题里的 New：比封面上的徽标收一号。
   这些位置旁边是正文字号的信息（category、名次），用封面尺寸会喧宾夺主。 */
.mini-sub .badge-new, .rank-sub .badge-new, .podium-meta .badge-new {
  font-size: 9.5px; padding: 1px 6px; letter-spacing: .4px;
  margin-right: 5px; vertical-align: 1px;
}
.modal-title .badge-new {
  font-size: 11px; padding: 2px 7px; vertical-align: 3px; margin-left: 2px;
}
.cell-title .badge-new {
  font-size: 9px; padding: 1px 5px; letter-spacing: .4px;
  margin-left: 6px; vertical-align: 1px;
}

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-xs);
  font-size: var(--t-xs); font-weight: 600;
  background: rgba(255, 255, 255, .06); color: var(--ink-2);
  border: 1px solid transparent;
}
.tag-brand { background: var(--brand-soft); color: #ff7b82; }
.tag-lgbt  { background: var(--zone-lgbt-soft); color: var(--zone-lgbt); border-color: var(--zone-lgbt-line); }
.tag-lesbian { background: var(--zone-les-soft); color: var(--zone-les); border-color: var(--zone-les-line); }
/* 浮在封面上的徽标：海报明暗不可控，软底半透明会糊在浅色封面上，
   所以这里自带深色底 + 只留一圈微亮描边，保证压在任何一张海报上都读得清。 */
.tag-float {
  position: absolute; top: 9px; right: 9px; z-index: 4;
  background: rgba(9, 9, 14, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.tag-lgbt.tag-float     { color: #d8b4fe; border-color: rgba(216, 180, 254, .45); }
.tag-lesbian.tag-float  { color: #f9a8d4; border-color: rgba(249, 168, 212, .45); }

/* ============================================================ 10. 详情弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(0, 0, 0, .84);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; pointer-events: none;
  transition: opacity .24s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
/* ⚠️ 这个 overlay 必须是 <body> 的直接子节点。任何祖先带 backdrop-filter /
   transform / filter 都会让它退化成相对该祖先定位，弹窗会被推到屏幕外。*/
.modal {
  position: relative; margin: auto;
  width: 100%; max-width: 900px;
  max-height: 88vh;
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-3);
  transform: scale(.965) translateY(10px);
  transition: transform .28s var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal-poster { flex: 0 0 230px; background: var(--bg-elev); overflow: hidden; }
.modal-poster img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.modal-body { flex: 1; min-width: 0; padding: var(--s-5); overflow-y: auto; overscroll-behavior: contain; }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  background: rgba(0, 0, 0, .62); color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(5px);
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.modal-close:hover { background: var(--brand); transform: rotate(90deg); }
.modal-title { font-size: var(--t-xl); color: #fff; margin-bottom: var(--s-2); padding-right: 40px; }
.modal-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: var(--s-4); }
.modal-desc { font-size: var(--t-md); color: var(--ink-2); line-height: 1.68; margin-bottom: var(--s-5); }
.modal-sec-title {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: var(--s-3);
}
.link-list { display: flex; flex-direction: column; gap: var(--s-2); }
.link-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.link-row:hover { border-color: var(--brand-line); background: var(--brand-soft); transform: translateX(4px); }
.link-row .ic {
  width: 32px; height: 32px; border-radius: var(--r-xs); flex: 0 0 auto;
  display: grid; place-items: center; font-size: 15px;
  background: var(--brand-soft);
}
.link-row .tx { flex: 1; min-width: 0; }
/* ⚠️ .nm / .sub 是 <span>，默认 display:inline 会连成一行
   （"EnglishOpens on external site"）。必须显式 block 才各占一行。 */
.link-row .nm { display: block; font-size: var(--t-md); font-weight: 600; }
.link-row .sub { display: block; font-size: var(--t-xs); color: var(--ink-3); }
.link-row .go { color: var(--ink-3); font-size: 15px; }
.link-row:hover .go { color: var(--brand-hi); }

/* ============================================================ 11. 空态 / 骨架屏 / 加载 */
.empty-state { text-align: center; padding: var(--s-8) var(--s-5); color: var(--ink-2); }
.empty-state .em { font-size: 48px; margin-bottom: var(--s-3); opacity: .85; }
.empty-state h3 { font-size: var(--t-lg); color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: var(--s-4); }
.empty-state .acts { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
  margin: 0 auto var(--s-3);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { text-align: center; padding: var(--s-7) var(--s-4); color: var(--ink-3); font-size: var(--t-sm); }

.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-card { border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.sk-poster { width: 100%; aspect-ratio: 2 / 3; border-radius: 0; }
.sk-line { height: 12px; margin: var(--s-3) var(--s-3) 0; }
.sk-line:last-child { margin-bottom: var(--s-4); }

/* ============================================================ 12. 表格 */
.table-wrap {
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); overflow: hidden;
}
.table-wrap.scroll { overflow-x: auto; }
.table-wrap table { min-width: 720px; }
.table-wrap th, .table-wrap td { padding: 12px var(--s-4); text-align: left; vertical-align: middle; }
.table-wrap thead th {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table-wrap tbody tr { border-bottom: 1px solid var(--line); transition: background .15s var(--ease); }
.table-wrap tbody tr:last-child { border-bottom: none; }
.table-wrap tbody tr:hover { background: var(--surface-2); }
.table-wrap td { font-size: var(--t-md); }
/* 海报列：列宽必须锁在缩略图上，否则这一列会被 auto 表格布局压扁。
   总宽超出容器时，浏览器会优先压缩「最小内容宽度」最小的列；带
   max-width:100% 的图片最小内容宽≈0（百分比最大宽度是循环依赖），于是
   列被压到 24px，而 .cell-thumb 的固定 height 不受影响 —— 宽高比被破坏，
   object-fit:cover 又从海报里裁出一条竖条，看起来就是"海报被挤扁"。
   （实测：声明 38px 宽，实际渲染 24px；真图比例 0.755、渲染比例 0.444。）
   width:1% + nowrap 是让列收缩到内容宽的标准写法。 */
.table-wrap td.cell-poster { width: 1%; white-space: nowrap; padding-right: var(--s-3); }

/* 只给宽度、不给固定高度，用 aspect-ratio 推高度 —— 这样任何情况下都不变形。
   max-width:none 用来顶掉全局 img{max-width:100%} 的钳制（那正是变形的元凶），
   min-width 兜底，宁可让表格横向滚动也不允许压扁海报。 */
.cell-thumb {
  width: 40px; height: auto; aspect-ratio: 2 / 3;
  min-width: 40px; max-width: none;
  border-radius: var(--r-xs); object-fit: cover; background: var(--surface-2);
}
.cell-title { font-weight: 600; }
.cell-sub { font-size: var(--t-xs); color: var(--ink-3); }
.cell-actions { display: flex; gap: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* 名次徽标：表格里用的版本。榜单行用的是 .rank-pos（flex 子项），
   表格里 td 不是 flex 容器，flex 属性不生效，所以单独给一个 inline-grid 版本。 */
.rank-badge {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 24px; padding: 0 7px;
  border-radius: var(--r-xs);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--t-sm); font-weight: 800; font-variant-numeric: tabular-nums;
}
.rank-badge.top { background: linear-gradient(135deg, var(--gold), #d4a800); color: #1a1400; border-color: transparent; }

/* ============================================================ 13. 指标卡与图表 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); }
.stat {
  padding: var(--s-4); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.stat .v { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .k { font-size: var(--t-sm); color: var(--ink-2); }
.stat .d { font-size: var(--t-xs); color: var(--ink-3); }
.stat.accent .v { color: var(--brand-hi); }
.stat.gold .v { color: var(--gold); }
.stat.ok .v { color: var(--ok); }

/* 卡片式面板 */
.panel { border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}
.panel-head h3 { font-size: var(--t-md); }
.panel-head .hint { font-size: var(--t-xs); color: var(--ink-3); }
.panel-head .right { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }
.panel-body { padding: var(--s-4); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s-3); }

/* 柱状图 */
.chart { padding: 0 var(--s-4) var(--s-4); }
.chart-legend { display: flex; gap: var(--s-4); font-size: var(--t-sm); color: var(--ink-2); padding: var(--s-4) var(--s-4) var(--s-3); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding: 0 var(--s-4); }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; position: relative; }
.bars .col .bar { border-radius: 3px 3px 0 0; min-height: 2px; transition: filter .18s var(--ease); }
.bars .col .bar.pv { background: linear-gradient(180deg, var(--brand-hi), var(--brand)); }
.bars .col .bar.uv { background: linear-gradient(180deg, var(--gold), #c79c00); }
.bars .col:hover .bar { filter: brightness(1.25); }
.bars .col:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: pre; font-size: var(--t-xs); line-height: 1.5;
  background: var(--surface-3); color: var(--ink);
  padding: 6px 9px; border-radius: var(--r-xs); border: 1px solid var(--line-strong);
  box-shadow: var(--sh-2); z-index: 5; pointer-events: none;
}
.chart-axis { display: flex; gap: 3px; padding: var(--s-2) var(--s-4) var(--s-4); }
.chart-axis span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-3); overflow: hidden; white-space: nowrap; }

/* 占比条 */
.meter { display: flex; flex-direction: column; gap: 5px; }
.meter + .meter { margin-top: var(--s-3); }
.meter-top { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--t-sm); }
.meter-top .nm { font-weight: 600; }
.meter-top .val { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter-track { height: 7px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-hi)); transition: width .5s var(--ease); }
.meter-fill.alt { background: linear-gradient(90deg, #7c7cf0, #a855f7); }

/* 标签云 / 关键词 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-stat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--t-sm);
}
.chip-stat .n { font-size: var(--t-xs); font-weight: 700; color: var(--brand-hi); font-variant-numeric: tabular-nums; }
.chip-stat.zero { opacity: .5; }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); }
.funnel-step { display: flex; align-items: center; gap: var(--s-3); }
.funnel-step .lb { flex: 0 0 118px; font-size: var(--t-sm); color: var(--ink-2); }
.funnel-step .trk { flex: 1; height: 30px; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; position: relative; }
.funnel-step .fil {
  height: 100%; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--brand), #ff5560);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px; min-width: 42px;
  font-size: var(--t-sm); font-weight: 700; color: #fff;
  transition: width .5s var(--ease);
}
.funnel-step .pc { flex: 0 0 58px; text-align: right; font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ============================================================ 14. 后台骨架（侧边栏） */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-head { padding: var(--s-4); border-bottom: 1px solid var(--line); }
.sidebar-head .brand { font-size: 16px; }
.sidebar-head .who { font-size: var(--t-xs); color: var(--ink-3); margin-top: 4px; }
.sidebar-nav { padding: var(--s-3) var(--s-2); display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav .grp {
  padding: var(--s-3) var(--s-3) 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--ink-3);
}
.snav {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: var(--t-md); font-weight: 500; color: var(--ink-2);
  cursor: pointer; text-align: left; width: 100%;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.snav:hover { background: var(--surface-2); color: var(--ink); }
.snav[aria-current="true"] { background: var(--brand-soft); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.snav .ico { font-size: 15px; width: 18px; text-align: center; flex: 0 0 auto; }
.snav .n { margin-left: auto; font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); }
.snav[aria-current="true"] .n { color: var(--brand-hi); }
.sidebar-foot { padding: var(--s-3); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.main-head {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: rgba(8, 8, 11, .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.main-head h1 { font-size: var(--t-xl); }
.main-head .desc { font-size: var(--t-sm); color: var(--ink-3); margin-top: 1px; }
.main-head .right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.main-body { padding: var(--s-5); flex: 1; }

/* 分区：JS 只切换 .on，不改 display，避免和 CSS 打架 */
.view { display: none; }
.view.on { display: block; animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sec + .sec { margin-top: var(--s-6); }
.sec-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.sec-head h2 { font-size: var(--t-lg); }
.sec-head .hint { font-size: var(--t-xs); color: var(--ink-3); }
.sec-head .right { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

/* 移动端抽屉开关（桌面不显示） */
.drawer-btn { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease);
}
.scrim.on { opacity: 1; pointer-events: auto; }

/* ============================================================ 15. 页脚与浮动元素 */
.footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s-7);
  padding: var(--s-6) var(--s-5);
  text-align: center; color: var(--ink-3); font-size: var(--t-sm);
}
.footer a { color: var(--brand-hi); }
.footer a:hover { text-decoration: underline; }
.footer .sep { margin: 0 8px; opacity: .5; }

.to-top {
  position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: var(--z-sticky);
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 17px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line-strong); box-shadow: var(--sh-2);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), background .18s var(--ease);
}
.to-top.on { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--brand); color: #fff; border-color: transparent; }

/* 轻提示 */
.toast-wrap { position: fixed; top: var(--s-5); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--s-2); align-items: center; pointer-events: none; }
.toast {
  padding: 10px 18px; border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--ink); font-size: var(--t-sm); font-weight: 600;
  box-shadow: var(--sh-2);
  animation: toastIn .22s var(--ease);
}
.toast.ok { border-color: rgba(61, 220, 132, .4); }
.toast.err { border-color: rgba(255, 77, 79, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============================================================ 16. 榜单页 */
.hero { padding: var(--s-6) 0 var(--s-5); }
.hero h1 { font-size: var(--t-3xl); letter-spacing: -.8px; margin-bottom: var(--s-2); }
.hero p { color: var(--ink-2); font-size: var(--t-md); max-width: 620px; }

/* 加宽的是**第一列**（冠军位）。写 .06fr 写到中间列会让亚军卡片比冠军还大，
   而 .p1 的金边/金徽章/加高海报都表明冠军才是被放大的那个。 */
.podium { display: grid; grid-template-columns: 1.06fr 1fr 1fr; gap: var(--s-4); align-items: end; margin-bottom: var(--s-6); }
.podium-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.podium-card:hover { border-color: var(--line-strong); transform: translateY(-5px); box-shadow: var(--sh-3); }
.podium-card.p1 { border-color: rgba(245, 197, 24, .45); }
.podium-card.p1:hover { box-shadow: 0 18px 50px rgba(245, 197, 24, .18); }
.podium-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--surface-2); display: block; }
.podium-card.p1 .podium-poster { aspect-ratio: 2 / 3.15; }
.podium-body { padding: var(--s-4); position: relative; }
.podium-rank {
  position: absolute; top: calc(-1 * var(--s-5)); left: var(--s-4);
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: var(--t-lg); font-weight: 800;
  background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: var(--sh-2);
}
.podium-card.p1 .podium-rank { background: linear-gradient(135deg, var(--gold), #d4a800); color: #1a1400; border-color: transparent; }
.podium-title { font-size: var(--t-lg); font-weight: 700; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.podium-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }

.rank-list { display: flex; flex-direction: column; gap: 7px; }
.rank-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-4); border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.rank-row:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateX(4px); }
.rank-pos { flex: 0 0 30px; text-align: center; font-size: var(--t-md); font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank-row.top .rank-pos { color: var(--gold); }
.rank-thumb { width: 40px; height: 56px; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.rank-main { flex: 1; min-width: 0; display: block; }
/* 这三行必须是块级：text-overflow 对 inline 元素不生效，
   用 <span> 承载文字时忘了给 display 就会从"省略号截断"变成"直接溢出" */
.rank-title { display: block; font-size: var(--t-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-sub { display: flex; gap: 8px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.rank-val { flex: 0 0 auto; text-align: right; }
.rank-val .n { font-size: var(--t-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-val .u { font-size: 10.5px; color: var(--ink-3); letter-spacing: .4px; }
.rank-val .n.hot { color: var(--brand-hi); }

/* 登录门 */
.gate {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: var(--s-5);
  background: var(--bg);
}
.gate .box {
  width: 100%; max-width: 360px;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-3); text-align: center;
}
.gate .box .em { font-size: 34px; margin-bottom: var(--s-3); }
.gate .box h1 { font-size: var(--t-xl); margin-bottom: 6px; }
.gate .box .sub { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: var(--s-5); }
.gate .box .input { text-align: center; letter-spacing: 2px; }
.gate .err { color: var(--danger); font-size: var(--t-sm); margin-top: var(--s-3); display: none; }
.gate .err.on { display: block; }
.gate .note { font-size: var(--t-xs); color: var(--ink-3); margin-top: var(--s-4); }

/* ============================================================ 17. 响应式 */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: var(--z-drawer);
    width: 262px; height: 100vh;
    transform: translateX(-100%);
    transition: transform .24s var(--ease);
    box-shadow: var(--sh-3);
  }
  .sidebar.open { transform: none; }
  .drawer-btn { display: inline-flex; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: var(--s-4) var(--s-3); }
  .podium { grid-template-columns: 1fr 1fr; }
  .podium-card.p1 { grid-column: 1 / -1; }
  .podium-card.p1 .podium-poster { aspect-ratio: 2 / 3; }
  .modal { max-width: 100%; }
  .modal-poster { flex: 0 0 172px; }
}

@media (max-width: 768px) {
  :root { --t-3xl: 27px; --t-2xl: 22px; }
  .page, .app-header-inner, .filterbar-inner, .main-head, .main-body { padding-left: var(--s-4); padding-right: var(--s-4); }
  .app-header-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .filterbar { top: 0; }
  .filterbar-inner { gap: var(--s-2); }
  .zone-tabs { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .card-desc { display: none; }
  .rail { grid-auto-columns: 148px; }
  .podium { grid-template-columns: 1fr; }
  .modal-overlay { padding: var(--s-3); align-items: flex-start; }
  .modal { flex-direction: column; max-height: 92vh; }
  .modal-poster { flex: 0 0 auto; width: 100%; max-height: 34vh; }
  .modal-poster img { object-position: center 18%; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); }
  .table-wrap th, .table-wrap td { padding: 10px var(--s-3); }
  .hero { padding: var(--s-5) 0 var(--s-4); }
  .main-head { flex-wrap: wrap; }
  .to-top { right: var(--s-4); bottom: var(--s-4); }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-3) 10px; }
  .card-title { font-size: var(--t-sm); -webkit-line-clamp: 2; }
  .card-body { padding: 9px 9px 11px; gap: 4px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 7px 6px; }
  .zone-tab { padding: 6px 12px; }
  .stat { padding: var(--s-3); }
  .stat .v { font-size: var(--t-xl); }
}

/* ============================================================ 18. 动效与无障碍偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
  .card:hover .card-poster img { transform: none; }
  .modal-overlay.open .modal { transform: none; }
}

/* 打印：只留内容，去掉导航与浮动元素 */
@media print {
  .app-header, .filterbar, .sidebar, .to-top, .footer, .toast-wrap { display: none !important; }
  body::before { display: none; }
  body { background: #fff; color: #000; }
}
