/* ============================================================
 * VizCore 核心样式：放映窗、播放器、筛选按钮基础、方案切换条
 * 每套方案通过覆盖下列变量换肤，不需要改这里的结构
 * ============================================================ */
:root {
  --stage-bg: #11141c;
  --stage-fg: #f1f3f8;
  --stage-muted: #9aa3b5;
  --stage-line: rgba(255, 255, 255, .12);
  --stage-radius: 16px;
  --stage-shadow: 0 40px 100px -30px rgba(0, 0, 0, .65);
  --stage-font: inherit;
  --stage-btn-fg: #0b0d12;
  --backdrop: rgba(5, 7, 12, .66);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); }
html.viz-locked, html.viz-locked body { overflow: hidden; }
body { margin: 0; min-height: 100%; }
img, video, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus, #7cc4ff); outline-offset: 3px; }
.viz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 缩略图 */
.viz-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

/* ---------- 播放器 ---------- */
.viz-player { position: relative; overflow: hidden; background: #0a1220; }
.viz-video, .viz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.viz-caption {
  position: absolute; left: 14px; bottom: 16px; z-index: 3; margin: 0; max-width: calc(100% - 28px);
  padding: 6px 12px; border-radius: 8px; font-size: .88rem; line-height: 1.5;
  color: #fff; background: rgba(8, 12, 22, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .25s, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.viz-caption:empty, .viz-caption.swap { opacity: 0; transform: translateY(6px); }
.viz-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 3; background: rgba(255, 255, 255, .15); }
.viz-progress i { display: block; height: 100%; width: 0; background: var(--accent, #fff); }

/* ---------- 放映窗 ---------- */
.viz-backdrop { position: fixed; inset: 0; z-index: 900; background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.viz-backdrop.is-on { opacity: 1; }
.viz-stage {
  position: fixed; left: 0; top: 0; z-index: 901; width: var(--sw, 720px);
  background: var(--stage-bg); color: var(--stage-fg); font-family: var(--stage-font);
  border: 1px solid color-mix(in srgb, var(--accent, #fff) 45%, var(--stage-line));
  border-radius: var(--stage-radius); box-shadow: var(--stage-shadow);
  overflow: hidden; transform-origin: 0 0; will-change: transform, opacity;
}
.viz-stage[hidden], .viz-backdrop[hidden] { display: none; }
.viz-stage-media { aspect-ratio: 16 / 10; }
.viz-stage-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 18px; }
.viz-stage-cat { margin: 0 0 4px; font-size: .78rem; letter-spacing: .08em; color: var(--accent, var(--stage-muted)); }
.viz-stage-title { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.25; font-family: var(--stage-title-font, inherit); font-weight: var(--stage-title-weight, 700); }
.viz-stage-summary { margin: 0; color: var(--stage-muted); font-size: .9rem; line-height: 1.7; max-width: 46em; }
.viz-stage-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.viz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--stage-line); background: transparent;
  color: var(--stage-fg); font: inherit; font-size: .9rem; text-decoration: none; transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), filter .2s;
}
.viz-btn:hover { transform: translateY(-1px); }
.viz-btn-primary { background: var(--accent, #fff); border-color: transparent; color: var(--stage-btn-fg); font-weight: 700; }
.viz-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.viz-stage-close { display: none; }
.viz-nav {
  position: absolute; top: calc(var(--sw, 720px) * .3125); z-index: 4; width: 40px; height: 40px; margin-top: -20px;
  display: none; place-items: center; cursor: pointer; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(8, 12, 22, .66); color: #fff;
}
.viz-prev { left: 10px; } .viz-next { right: 10px; }
.viz-stage.is-modal .viz-nav { display: grid; }
.viz-stage.is-modal .viz-stage-close { display: inline-flex; }
/* 跟随模式：只显示画面与标题，不拦截鼠标 */
.viz-stage.is-follow { pointer-events: none; border-radius: var(--stage-follow-radius, 6px); }
.viz-stage.is-follow .viz-stage-info { padding: 10px 14px 12px; }
.viz-stage.is-follow .viz-stage-summary, .viz-stage.is-follow .viz-stage-actions { display: none; }
.viz-stage.is-follow .viz-stage-title { font-size: 1rem; margin: 0; }
.viz-stage.is-follow .viz-caption { font-size: .78rem; bottom: 10px; left: 10px; }
@media (max-width: 640px) {
  .viz-stage-info { flex-direction: column; }
  .viz-stage-actions { width: 100%; }
  .viz-stage-actions .viz-btn { flex: 1; }
}

/* ---------- 筛选按钮（结构） ---------- */
.viz-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.viz-chip { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; }
.viz-chip-n { font-variant-numeric: tabular-nums; opacity: .6; font-size: .85em; }

/* ---------- 更新记录（结构） ---------- */
.viz-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.viz-log-head { display: flex; align-items: baseline; gap: 12px; }
.viz-log ul { margin: 6px 0 0; padding-left: 1.1em; }

/* ---------- 方案切换条 ---------- */
.viz-switcher {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 800; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px;
  background: rgba(14, 16, 22, .82); color: #e9ecf3; backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .1);
  font: 500 13px/1 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; white-space: nowrap;
}
.viz-switcher-label { padding: 0 10px 0 12px; opacity: .6; }
.viz-switcher a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: inherit; text-decoration: none; transition: background-color .2s; }
.viz-switcher a b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .14); font-size: 11px; }
.viz-switcher a:hover { background: rgba(255, 255, 255, .1); }
.viz-switcher a[aria-current="true"] { background: #fff; color: #0b0d12; }
.viz-switcher a[aria-current="true"] b { background: #0b0d12; color: #fff; }
.viz-switcher-legacy { opacity: .6; }
.viz-switcher { max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.viz-switcher::-webkit-scrollbar { display: none; }
@media (max-width: 1100px) { .viz-switcher-label { display: none; } }
@media (max-width: 760px) { .viz-switcher .nm { display: none; } .viz-switcher a { padding: 6px; } .viz-switcher a b { width: 26px; height: 26px; font-size: 12px; } .viz-switcher-legacy { padding: 6px 10px !important; } }

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

/* ---------- 支持与合作 ---------- */
.viz-support { margin-top: 26px; padding: 18px 20px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); }
.viz-support-note { margin: 0 0 12px; font-size: .92rem; opacity: .85; }
.viz-support-links { display: flex; flex-wrap: wrap; gap: 8px; }
.viz-support-btn { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); color: inherit; text-decoration: none; font-size: .88rem; transition: background-color .2s, transform .2s; }
.viz-support-btn:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.viz-support-legal { margin: 12px 0 0; font-size: .78rem; opacity: .6; }
.viz-support-legal a { color: inherit; }
