/* =========================================================
   通用组件：按钮、表单、分段、标签、徽章、书封（电影海报式素封）、
   海报卡、毛玻璃面板、数据表、抽屉、弹窗、提示、分页、骨架屏
   ========================================================= */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.985); }
.btn:disabled { opacity: 0.45; }
.btn .i { width: 15px; height: 15px; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; gap: 6px; }
.btn.xs { height: 27px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn.lg { height: 46px; padding: 0 26px; font-size: 14.5px; }
.btn.block { width: 100%; }

/* 主按钮：金色渐变 + 深色字 */
.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 26px -12px var(--glow);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 14px 32px -12px var(--glow); }

.btn-outline { border-color: var(--line-2); color: var(--text); background: var(--glass); }
.btn-outline:hover:not(:disabled) { border-color: var(--line-3); background: var(--glass-2); }

.btn-gold-line { border-color: var(--accent-line); color: var(--accent); background: transparent; }
.btn-gold-line:hover:not(:disabled) { background: var(--accent-soft); }

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

/* 影院白底黑字 / 半透明按钮 */
.btn-light { background: #f5f3ee; color: #121214; box-shadow: 0 12px 30px -12px rgba(255, 255, 255, 0.35); }
.btn-light:hover:not(:disabled) { background: #fff; }
.btn-glass { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: rgba(255, 255, 255, 0.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-glass:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.26); }
html[data-theme="light"]:not([data-stage="cinema"]) .btn-glass { background: var(--glass-2); border-color: var(--line-2); }

.btn-danger { color: var(--neg); }
.btn-danger:hover:not(:disabled) { background: var(--neg-soft); }

.btn.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); box-shadow: none; filter: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--glass-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.is-on { color: var(--accent); }

.link-btn {
  font-size: 12.5px;
  color: var(--text-3);
  padding: 2px 4px;
  border-radius: var(--r-xs);
  transition: color var(--t-fast) var(--ease);
}
.link-btn:hover { color: var(--accent); }

/* ---------- 表单 ---------- */
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r);
  background: var(--glass);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--glass-2); }
.input.sm { height: 32px; font-size: 12.5px; padding: 0 10px; border-radius: var(--r-sm); }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  cursor: pointer;
}
select.input option { background: var(--surface); color: var(--text); }
input[type="number"].input { font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button { opacity: 0.4; }

.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon .i { position: absolute; left: 11px; color: var(--text-3); width: 14px; height: 14px; pointer-events: none; }
.input-icon .input { padding-left: 32px; width: 220px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border-radius: 5px; border: 1px solid var(--line-3); background: var(--glass); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.check input:checked { background: var(--accent-grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 8px; height: 4px; border-left: 1.8px solid var(--on-accent); border-bottom: 1.8px solid var(--on-accent); transform: rotate(-45deg) translate(0.5px, -1px); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; }
.field-label small { font-weight: 400; letter-spacing: 0; color: var(--text-4); }
.field-label.mt { margin-top: 22px; }

.mini-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mini-field > span { font-size: 11px; color: var(--text-3); }
.mini-field.grow { flex: 1; }

.range-pair { display: flex; align-items: flex-end; gap: 8px; }
.range-pair > * { flex: 1; }
.range-sep { flex: none; color: var(--text-4); padding-bottom: 7px; }

.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form-row .mini-field { width: 110px; }
.form-row .mini-field.grow { width: auto; min-width: 140px; }

/* ---------- 分段控制 ---------- */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--glass-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--line-2) inset; }
html[data-theme="light"]:not([data-stage="cinema"]) .seg button[aria-pressed="true"] { background: var(--surface); }
.seg.sm button { height: 25px; padding: 0 10px; font-size: 12px; }
.seg--full { display: flex; }
.seg--full button { flex: 1; padding: 0 4px; }
.seg .count { font-variant-numeric: tabular-nums; font-size: 10.5px; color: var(--text-4); }
.seg button[aria-pressed="true"] .count { color: var(--accent); }

/* 影院胶囊分段：选中为金色实心 */
.seg.pill { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.08); }
.seg.pill button { height: 32px; padding: 0 16px; font-size: 13px; }
.seg.pill button[aria-pressed="true"] { background: var(--accent-grad); color: var(--on-accent); box-shadow: 0 8px 22px -10px var(--glow); font-weight: 600; }

/* ---------- 选择标签 ---------- */
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chip,
.chipset button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--glass);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover,
.chipset button:hover { border-color: var(--line-3); color: var(--text); }
.chipset button[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chip small, .chipset button small { font-variant-numeric: tabular-nums; font-size: 10px; color: var(--text-4); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--glass-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
button.tag:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--glass-2);
  border: 1px solid var(--line);
}
.badge .i { width: 12px; height: 12px; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.badge.pos { color: var(--pos); background: var(--pos-soft); border-color: transparent; }
.badge.neg { color: var(--neg); background: var(--neg-soft); border-color: transparent; }
.badge.plain { background: none; border-color: transparent; padding: 0; color: var(--text-3); }

/* 频道徽章「男频·玄幻」 */
.chb { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 7px; font-size: 11.5px; font-weight: 550; white-space: nowrap; color: var(--text-2); background: var(--glass-2); border: 1px solid var(--line); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chb.ch-m { color: var(--male); background: var(--male-soft); border-color: transparent; }
.chb.ch-f { color: var(--female); background: var(--female-soft); border-color: transparent; }

.ch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ch::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--general); }
.ch-m::before { background: var(--male); }
.ch-f::before { background: var(--female); }

.tier { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tier.t1 { color: var(--accent); }
.tier.t2 { color: var(--text); }

.grade {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 12.5px;
  color: var(--grade-c);
  border: 1px solid currentColor;
}
.grade.g-s { color: #2a1a04; background: linear-gradient(160deg, #f8d58a, #d99a2f); border-color: transparent; box-shadow: 0 6px 16px -6px var(--glow); }
.grade.g-a { color: #1d1e24; background: linear-gradient(160deg, #f1f2f6, #a9abb6); border-color: transparent; }
.grade.g-b { color: var(--grade-b); }

/* AI 等级圆形徽章（片库表格） */
.gcirc {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 13px;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  background: var(--glass);
}
.gcirc.g-s { color: #2a1a04; background: radial-gradient(circle at 35% 30%, #ffe3a3, #dc9c31 70%); border-color: transparent; box-shadow: 0 0 0 3px rgba(232, 176, 75, 0.14), 0 8px 18px -8px var(--glow); }
.gcirc.g-a { color: #1d1e24; background: radial-gradient(circle at 35% 30%, #ffffff, #a6a8b3 75%); border-color: transparent; box-shadow: 0 0 0 3px rgba(220, 222, 230, 0.08); }
.gcirc.g-b { color: var(--grade-b); border-color: currentColor; }
.gcirc.none { font-size: 10.5px; font-weight: 500; color: var(--text-4); border-style: dashed; }

.ai-score { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ai-score .ai-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; color: var(--text); }
.ai-score .ai-val small { color: var(--text-3); font-size: 10.5px; font-weight: 400; }
.ai-score .ai-kind { font-size: 10.5px; color: var(--text-3); }
.ai-none { font-size: 12px; color: var(--text-4); }

/* ---------- 书封 ---------- */
/* 真封面能加载就盖在上层；加载失败或链接已过期时露出下面的「电影海报式素封」 */
.cover {
  position: relative;
  flex: none;
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  container-type: inline-size;
  background: var(--c2, #141416);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset, 0 8px 20px -8px rgba(0, 0, 0, 0.55);
  isolation: isolate;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, rgba(255, 255, 255, 0.07) 3%, transparent 8%), linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
.cover img.is-loaded { opacity: 1; }

.cover-fb {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9cqw 9cqw 8cqw;
  color: rgba(255, 250, 240, 0.95);
  background:
    radial-gradient(90% 55% at 50% -6%, color-mix(in srgb, var(--c3) 42%, transparent), transparent 70%),
    radial-gradient(120% 70% at 50% 120%, rgba(0, 0, 0, 0.75), transparent 60%),
    linear-gradient(176deg, var(--c1) 0%, var(--c2) 82%);
  overflow: hidden;
}
/* 顶部聚光束 + 颗粒噪点 */
.cover-fb::before {
  content: "";
  position: absolute;
  inset: -10% -30% 30%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 160deg, rgba(255, 244, 220, 0.13) 175deg, rgba(255, 244, 220, 0.2) 180deg, rgba(255, 244, 220, 0.13) 185deg, transparent 200deg);
  filter: blur(4cqw);
  pointer-events: none;
}
.cover-fb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.cover-frame { position: absolute; inset: 5cqw; border: 1px solid rgba(255, 255, 255, 0.14); pointer-events: none; }
.cover-ghost {
  position: absolute;
  right: -14cqw;
  bottom: -18cqw;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 105cqw;
  line-height: 1;
  color: var(--c3);
  opacity: 0.08;
  pointer-events: none;
}
.cover-kicker {
  position: relative;
  font-size: max(7px, 5cqw);
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  color: var(--c3);
  margin-top: 3cqw;
  white-space: nowrap;
}
.cover-title {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5cqw;
  margin: 7cqw 0 4cqw;
  min-height: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.cover-title .ct-main { display: block; white-space: nowrap; font-size: min(17cqw, calc(54cqw / var(--tl, 4))); color: #fffaf0; }
.cover-title .ct-sub { display: block; white-space: nowrap; font-size: max(6px, min(6cqw, calc(44cqw / var(--sl, 8)))); font-weight: 500; letter-spacing: 0.22em; color: rgba(255, 245, 225, 0.72); }
.cover-rule { position: relative; width: 26cqw; height: 1px; background: linear-gradient(90deg, transparent, var(--c3), transparent); }
.cover-author { position: relative; margin-top: 4cqw; font-size: max(7px, 5.4cqw); letter-spacing: 0.12em; opacity: 0.7; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.cover-seal {
  position: absolute;
  left: 8cqw;
  bottom: 9cqw;
  display: grid;
  place-items: center;
  width: 12cqw;
  height: 12cqw;
  border-radius: 1.5cqw;
  background: color-mix(in srgb, #b8322a 78%, var(--c2));
  color: rgba(255, 236, 220, 0.92);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 7cqw;
  box-shadow: inset 0 0 0 0.6cqw rgba(255, 220, 200, 0.25);
  opacity: 0.85;
}
.cover-glyph { display: none; }

.cover--xs { width: 30px; border-radius: 4px; }
.cover--sm { width: 42px; border-radius: 6px; }
.cover--xs .cover-fb, .cover--sm .cover-fb { justify-content: center; padding: 0; }
.cover--xs .cover-fb > :not(.cover-glyph), .cover--sm .cover-fb > :not(.cover-glyph) { display: none; }
.cover--xs .cover-glyph, .cover--sm .cover-glyph { display: block; position: relative; font-family: var(--font-serif); font-weight: 800; font-size: 46cqw; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }

.cover--md { width: 64px; border-radius: 7px; }
.cover--md .cover-kicker, .cover--md .cover-author, .cover--md .ct-sub, .cover--md .cover-seal, .cover--md .cover-rule { display: none; }
.cover--md .cover-title { margin: 6cqw 0; }

.cover--lg { width: 136px; border-radius: var(--r); }
.cover--xl { width: 188px; border-radius: var(--r); }
.cover--fill { width: 100%; border-radius: var(--r); }

/* ---------- 海报卡（首页片单 / 精选海报墙 / 片库海报墙共用） ---------- */
.pcard { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pcard-art {
  position: relative;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 420ms var(--ease), box-shadow 420ms var(--ease);
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.8);
}
.pcard-art .cover { border-radius: 12px; }
.pcard-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  z-index: 4;
}
.pcard-flag { position: absolute; z-index: 5; top: 9px; left: 9px; display: flex; gap: 5px; pointer-events: none; }
.pcard-flag .grade { min-width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.pcard-rank { position: absolute; z-index: 5; top: 8px; right: 10px; font-family: var(--font-display); font-weight: 700; font-size: 12px; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); pointer-events: none; }
.pcard-tools {
  position: absolute;
  z-index: 5;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.pcard-tools .btn { height: 30px; padding: 0 12px; font-size: 12px; background: rgba(12, 12, 15, 0.72); color: #f3f1ec; border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: none; }
.pcard-tools .btn:hover { background: var(--accent-grad); color: #1a1206; border-color: transparent; filter: none; }
.pcard-tools .btn.is-on { background: rgba(232, 176, 75, 0.2); color: #f3c672; border-color: rgba(232, 176, 75, 0.5); }
.pcard-tools .icon-btn { width: 30px; height: 30px; background: rgba(12, 12, 15, 0.72); color: #f3f1ec; border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pcard-tools .icon-btn.is-on { color: #f3c672; }
.pcard-tools .i { width: 14px; height: 14px; }
@media (hover: hover) {
  .pcard:hover .pcard-art, .pcard:focus-within .pcard-art {
    transform: scale(1.04);
    box-shadow: 0 0 0 1px var(--accent-line), 0 24px 56px -18px var(--glow), 0 26px 40px -24px rgba(0, 0, 0, 0.9);
  }
  .pcard:hover .pcard-art::after, .pcard:focus-within .pcard-art::after { opacity: 1; }
  .pcard:hover .pcard-tools, .pcard:focus-within .pcard-tools { opacity: 1; transform: none; }
}
@media (hover: none) { .pcard-tools { opacity: 1; transform: none; } .pcard-art::after { opacity: 1; } }
.pcard h4 { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; transition: color var(--t-fast); }
.pcard h4:hover { color: var(--accent); }
.pcard-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; margin-top: -5px; }
.pcard-meta b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pcard-meta .sep { width: 1px; height: 9px; background: var(--line-2); }
.pcard-meta .zero { color: var(--pos); }

/* ---------- 毛玻璃面板 ---------- */
.glass,
.panel {
  position: relative;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-hi), var(--shadow-card);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; }
.panel-head h3 .i { color: var(--accent); }
.panel-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin: 22px 0 10px;
}

/* ---------- 数据表 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--glass); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 550;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--glass-2); }
.table .r { text-align: right; }
.table code { font-family: var(--font-mono); font-size: 12px; color: var(--text); }

/* ---------- 空状态 / 加载 ---------- */
.empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-3);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  background: radial-gradient(420px 220px at 50% 0%, var(--accent-soft), transparent 70%), var(--glass);
  overflow: hidden;
}
.empty > .i {
  width: 54px;
  height: 54px;
  padding: 14px;
  border-radius: 18px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  stroke-width: 1.4;
  box-shadow: 0 14px 34px -14px var(--glow);
  margin-bottom: 4px;
}
.empty-title { color: var(--text); font-weight: 650; font-size: 15px; }
.empty p { font-size: 12.5px; max-width: 380px; line-height: 1.7; }
.empty .btn { margin-top: 8px; }
.empty-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }

.sk {
  display: block;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 40%, var(--skeleton) 80%);
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-line { height: 10px; }

/* ---------- 已生效条件胶囊 ---------- */
.chips-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.chips-label { font-size: 11.5px; color: var(--text-3); margin-right: 4px; }
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 5px 0 12px;
  border-radius: var(--r-pill);
  background: var(--glass-2);
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--text);
  animation: chipIn 220ms var(--ease) both;
}
.fchip.inc { border-color: color-mix(in srgb, var(--pos) 45%, transparent); color: var(--pos); background: var(--pos-soft); }
.fchip.exc { border-color: color-mix(in srgb, var(--neg) 45%, transparent); color: var(--neg); background: var(--neg-soft); }
.fchip.parsed { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.fchip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; opacity: 0.6; }
.fchip button:hover { opacity: 1; background: var(--glass-2); }
.fchip .i { width: 11px; height: 11px; stroke-width: 2; }
@keyframes chipIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.pager-num:hover:not(:disabled) { background: var(--glass-2); color: var(--text); }
.pager-num.is-current { background: var(--accent-grad); color: var(--on-accent); box-shadow: 0 8px 20px -10px var(--glow); }
.pager-gap { color: var(--text-4); padding: 0 4px; }
.pager-side { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-3); }
.pager-jump { display: flex; align-items: center; gap: 6px; }
.pager-jump .input { width: 60px; text-align: center; }

/* ---------- 抽屉 ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 260ms var(--ease) both;
}
html[data-theme="light"]:not([data-stage="cinema"]) .scrim { background: rgba(40, 30, 12, 0.22); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(720px, 100vw);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 460ms var(--ease-sheet), visibility 0s linear 460ms;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform 460ms var(--ease-sheet), visibility 0s; }

.drawer-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 14px 0 16px;
  flex: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent), color-mix(in srgb, var(--bg) 35%, transparent));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.drawer-bar .icon-btn { background: rgba(0, 0, 0, 0.28); color: #f1efe9; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html[data-theme="light"]:not([data-stage="cinema"]) .drawer-bar .icon-btn { background: rgba(255, 255, 255, 0.7); color: var(--text); }
.drawer-nav { display: flex; align-items: center; gap: 6px; }
.drawer-pos { font-size: 11.5px; color: var(--text-2); min-width: 56px; text-align: center; }
.drawer-hint { margin-left: auto; font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 30px 56px; }
.drawer-body.is-swapping > * { animation: swapIn 300ms var(--ease) both; }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 220ms var(--ease) both;
}
html[data-theme="light"]:not([data-stage="cinema"]) .modal { background: rgba(40, 30, 12, 0.25); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  border-radius: var(--r-xl);
  background: var(--pop);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid var(--line-2);
  box-shadow: var(--glass-hi), var(--shadow-pop);
  animation: modalIn 340ms var(--ease-sheet) both;
}
.modal-card.sm { width: min(410px, 100%); }
.modal-card h3 { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.confirm-body { margin-top: 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.75; }
.confirm-body b { color: var(--text); font-variant-numeric: tabular-nums; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field > span { font-size: 12px; color: var(--text-2); font-weight: 550; }
.form-field .input { height: 42px; font-size: 14px; border-radius: 12px; }
.form-error { padding: 9px 12px; border-radius: var(--r-sm); background: var(--neg-soft); color: var(--neg); font-size: 12.5px; }
.form-msg { min-height: 18px; font-size: 12.5px; margin-top: 8px; }
.form-msg.ok { color: var(--pos); }
.form-msg.err { color: var(--neg); }

/* ---------- 提示 ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 18px 11px 14px;
  border-radius: var(--r-pill);
  background: var(--pop);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  color: var(--text);
  animation: toastIn 340ms var(--ease-sheet) both;
}
.toast .i { width: 15px; height: 15px; color: var(--text-3); }
.toast.ok .i { color: var(--pos); }
.toast.err .i { color: var(--neg); }
.toast.is-leaving { animation: toastOut 220ms var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- 浮标 ---------- */
.basket-dock {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 7px 0 18px;
  border-radius: var(--r-pill);
  background: var(--pop);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-pop), 0 0 40px -14px var(--glow);
  font-size: 13px;
  animation: toastIn 340ms var(--ease-sheet) both;
}
.basket-dock > .i { color: var(--accent); }
.basket-dock b { color: var(--accent); }
.dock-go { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 14px; border-radius: var(--r-pill); background: var(--accent-grad); color: var(--on-accent); font-weight: 650; font-size: 12.5px; }
.dock-go .i { width: 14px; height: 14px; }

.to-top {
  position: fixed;
  right: 26px;
  bottom: 88px;
  z-index: 39;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  box-shadow: var(--shadow-pop);
}
.to-top:hover { color: var(--accent); }

/* ---------- 雷达图与维度 ---------- */
.radar { display: block; overflow: visible; }
.radar .ring { fill: none; stroke: var(--line-2); }
.radar .ring.outer { stroke: var(--line-3); }
.radar .axis { stroke: var(--line); }
.radar .lbl { fill: var(--text-2); font-size: 11px; font-family: var(--font-sans); }
.radar .shape {
  fill: color-mix(in srgb, var(--accent) 24%, transparent);
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transform-box: view-box;
  filter: drop-shadow(0 0 10px var(--glow));
  animation: radarIn 760ms var(--ease-sheet) both;
}
.radar .pt { fill: var(--accent-2); stroke: var(--bg); stroke-width: 1.5; animation: fadeIn 500ms 300ms both; }
@keyframes radarIn { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

.dims { display: flex; flex-direction: column; gap: 10px; }
.dim { display: grid; grid-template-columns: 92px 1fr 36px; align-items: center; gap: 12px; font-size: 12.5px; }
.dim-name { color: var(--text-2); white-space: nowrap; }
.dim-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.dim-bar i { height: 6px; border-radius: 3px; background: var(--glass-2); }
.dim-bar i.on { background: var(--accent-grad); box-shadow: 0 0 8px -2px var(--glow); }
.dim-bar.is-low i.on { background: var(--text-3); box-shadow: none; }
.dim-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; color: var(--text); }
.dim-val.na { color: var(--text-4); font-weight: 400; font-size: 11px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.spark i { flex: 1; min-width: 4px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: 0.85; }
.spark i.low { background: var(--text-4); opacity: 1; }

/* ---------- 指标格 ---------- */
.metrics-bento { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 10px; }
.metrics-bento .m-lead { grid-row: span 2; padding: 18px 20px; }
.m-aud { margin-top: auto; padding-top: 14px; }
.m-aud .aud-legend { gap: 4px 12px; flex-wrap: wrap; white-space: nowrap; }
.metric { position: relative; margin: 0; padding: 14px 16px; border: 1px solid var(--glass-line); border-radius: var(--r); background: var(--glass); box-shadow: var(--glass-hi); }
.metric-val { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; white-space: nowrap; }
.metric-val small { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.metric-val.pos { color: var(--pos); }
.metric-lbl { margin-top: 3px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* 受众条 */
.aud-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--glass-2); gap: 2px; }
.aud-bar i { display: block; height: 100%; }
.aud-y { background: var(--male); }
.aud-m { background: var(--text-3); }
.aud-o { background: var(--accent); }
.aud-legend { display: flex; gap: 16px; margin-top: 9px; font-size: 11.5px; color: var(--text-3); }
.aud-legend span { display: inline-flex; align-items: center; gap: 6px; }
.aud-legend span::before { content: ""; width: 8px; height: 3px; border-radius: 2px; background: currentColor; }
.aud-legend .y::before { background: var(--male); }
.aud-legend .m::before { background: var(--text-3); }
.aud-legend .o::before { background: var(--accent); }
.aud-legend b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

/* 进度条 */
.progress { height: 5px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent-grad); border-radius: 3px; transition: width 600ms var(--ease); }

/* 状态点 */
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex: none; }
.sdot.run { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.sdot.ok { background: var(--pos); }
.sdot.err { background: var(--neg); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }

/* 便当格通用 */
.bento-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 18px 15px;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-line);
  background: var(--glass);
  box-shadow: var(--glass-hi);
  overflow: hidden;
}
.bento-lbl { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.bento-val { margin-top: auto; padding-top: 10px; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--text); white-space: nowrap; }
.bento-val small { font-size: 13px; color: var(--text-3); letter-spacing: 0; margin-left: 3px; font-weight: 400; }
.bento-big { padding-top: 8px; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; color: var(--text); white-space: nowrap; }
.bento-note { margin-top: 7px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 少量动效 ---------- */
/* 新一批检索结果错落进场（只在检索后播放，前 15 行逐行延迟） */
.rows.is-enter .row:not(.row-head), .wall.is-enter .pcard, .rcards.is-enter .rcard { animation: rowIn 420ms var(--ease) both; animation-delay: calc(var(--i, 0) * 24ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 鼠标所在位置的一圈柔光（位置由 motion.js 写入 --mx / --my） */
@media (hover: hover) {
  .bento-cell::after, .tile::after, .stat-card::after, .rcard::after, .ov-card::after, .panel::after, .preview-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 65%);
    opacity: 0;
    transition: opacity 320ms var(--ease);
  }
  .bento-cell:hover::after, .tile:hover::after, .stat-card:hover::after, .rcard:hover::after, .ov-card:hover::after, .panel:hover::after, .preview-card:hover::after { opacity: 1; }
}

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