/* ==========================================================================
   ysin 展示壳 · 共享样式
   三站共用: 原神 / 星穹铁道 / 绝区零
   站点主色由 <body data-site="..."> 决定
   ========================================================================== */

:root {
  --bg: #070a10;
  --surface: rgba(255, 255, 255, .038);
  --surface-2: rgba(0, 0, 0, .22);
  --line: rgba(255, 255, 255, .095);
  --line-soft: rgba(255, 255, 255, .055);
  --fg: #e8ecf5;
  --fg-dim: #9aa4bb;
  --fg-faint: #5f6880;
  --accent: #6ee7d7;
  --accent-soft: rgba(110, 231, 215, .14);
  --accent-line: rgba(110, 231, 215, .32);
  --ok: #4ade80;
  --dev: #fbbf24;
  --plan: #8b93a8;
  --block: #f87171;
  --r: 16px;
  color-scheme: dark;
}

body[data-site="genshin"]  { --accent: #6ee7d7; --accent-soft: rgba(110,231,215,.14); --accent-line: rgba(110,231,215,.32); }
body[data-site="starrail"] { --accent: #b39dff; --accent-soft: rgba(179,157,255,.14); --accent-line: rgba(179,157,255,.32); }
body[data-site="zzz"]      { --accent: #fbbf24; --accent-soft: rgba(251,191,36,.13);  --accent-line: rgba(251,191,36,.30); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 88% -18%, var(--accent-soft), transparent 60%),
    radial-gradient(760px 420px at -12% 8%, rgba(255, 255, 255, .028), transparent 58%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- 顶栏 */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 16, .78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--accent), transparent 130%);
  box-shadow: 0 0 0 1px var(--accent-line), 0 4px 14px var(--accent-soft);
  display: grid; place-items: center;
  font-size: 14.5px; font-weight: 800; color: #06121a; letter-spacing: -.5px;
}
.brand b { font-size: 18px; font-weight: 700; letter-spacing: .4px; }
.brand .sub { font-size: 13px; color: var(--fg-faint); letter-spacing: .6px; }
.top .spacer { flex: 1; }

/* 头部"不起眼的链接" —— 低调到几乎看不见, 但确实可点 */
.siblings { display: flex; align-items: center; gap: 8px; }
.siblings a {
  font-size: 13px; color: var(--fg-faint); text-decoration: none;
  opacity: .48; padding: 3px 2px; border-radius: 4px;
  transition: opacity .18s ease, color .18s ease;
}
.siblings a:hover, .siblings a:focus-visible { opacity: 1; color: var(--accent); }
.siblings .sep { color: var(--line); font-size: 12px; opacity: .6; }

/* ---------------------------------------------------------------- 布局 */
.shell { display: flex; align-items: flex-start; max-width: 1340px; margin: 0 auto; }

.side {
  flex: 0 0 210px; width: 210px;
  padding: 26px 10px 40px 24px;
  position: sticky; top: 56px; align-self: flex-start;
  max-height: calc(100vh - 56px); overflow-y: auto;
  scrollbar-width: thin;
}
.side h3 {
  font-size: 12px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--fg-faint); text-transform: uppercase; margin: 0 0 10px 10px;
}
.side a {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; margin-bottom: 2px; border-radius: 9px;
  font-size: 15.5px; color: var(--fg-dim); text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.side a .n {
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--fg-faint); letter-spacing: .3px;
}
.side a:hover { background: var(--surface); color: var(--fg); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a.on .n { color: var(--accent); opacity: .85; }

.main { flex: 1; min-width: 0; padding: 26px 24px 64px 10px; }

/* ---------------------------------------------------------------- 标题 */
.hero { margin-bottom: 18px; }
.hero h1 {
  font-size: 32.5px; font-weight: 750; letter-spacing: .6px; line-height: 1.25;
  display: flex; align-items: center; gap: 11px;
}
.hero h1 .tick {
  width: 4px; height: 22px; border-radius: 3px; flex: 0 0 auto;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-soft);
}
.hero p { color: var(--fg-dim); font-size: 15.5px; margin-top: 6px; padding-left: 15px; }

/* ------------------------------------------------------------ 状态条 */
.livebar {
  position: relative;              /* 高光(.sweep)以状态条为定位基准 */
  display: flex; align-items: stretch; flex-wrap: wrap;
  gap: 0; padding: 0; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.014));
}
.livebar .item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 11px 18px; min-width: 0;
  border-right: 1px solid var(--line-soft);
}
.livebar .item:last-child { border-right: none; }
.livebar .item .k { font-size: 12px; letter-spacing: .6px; color: var(--fg-faint); white-space: nowrap; }
.livebar .item .v {
  font-size: 17px; font-weight: 650; color: var(--fg);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.livebar .item .v.ok { color: var(--ok); }
.livebar .item .v.bad { color: var(--block); }
.livebar .grow { flex: 1; }
.livebar .item.stamp { justify-content: center; padding-right: 16px; }
.livebar .item.stamp .v { font-size: 13px; font-weight: 500; color: var(--fg-faint); }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--plan); margin-right: 6px; vertical-align: middle;
  transition: background .3s ease, box-shadow .3s ease;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 9px rgba(74,222,128,.75); }
.dot.bad { background: var(--block); box-shadow: 0 0 9px rgba(248,113,113,.7); }

/* ---------------------------------------------------------------- 卡片 */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,.012));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; margin-bottom: 14px;
  scroll-margin-top: 72px;
  transition: border-color .22s ease, background .22s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 2px;
  border-radius: 0 3px 3px 0; background: var(--accent);
  opacity: 0; transition: opacity .25s ease;
}
.card:hover { border-color: rgba(255, 255, 255, .17); }
.card:hover::before { opacity: .6; }

.card > header {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.card h2 { font-size: 18.5px; font-weight: 680; letter-spacing: .3px; }
.card .desc { color: var(--fg-dim); font-size: 15.5px; margin-top: 5px; }

/* ---------------------------------------------------------------- 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .35px;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid; white-space: nowrap; line-height: 1.5;
}
.badge::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
.badge.live  { color: var(--ok);   background: rgba(74,222,128,.09);  border-color: rgba(74,222,128,.30); }
.badge.dev   { color: var(--dev);  background: rgba(251,191,36,.09);  border-color: rgba(251,191,36,.28); }
.badge.plan  { color: var(--plan); background: rgba(139,147,168,.10); border-color: rgba(139,147,168,.26); }
.badge.block { color: var(--block);background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.28); }

/* ------------------------------------------------------------ 指标格子 */
.stats {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}
.stat {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 14px 16px 15px;
}
.stat .k { font-size: 12.5px; letter-spacing: .5px; color: var(--fg-faint); }
.stat .v {
  font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1.35;
  font-variant-numeric: tabular-nums; color: var(--fg); margin-top: 2px;
  display: flex; align-items: baseline; gap: 3px;
}
.stat .v .u { font-size: 14px; font-weight: 500; color: var(--fg-dim); letter-spacing: 0; }
.stat .v.accent { color: var(--accent); }
.stat .v.sm { font-size: 18px; font-weight: 650; letter-spacing: -.1px; }
.stat .s { font-size: 13px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.stat .bar { margin-top: 9px; }

.bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.075); overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 9px var(--accent-soft);
  transition: width .6s cubic-bezier(.22,.61,.36,1);
}
.bar.warn > i { background: var(--dev); box-shadow: 0 0 9px rgba(251,191,36,.3); }
.bar.hot > i  { background: var(--block); box-shadow: 0 0 9px rgba(248,113,113,.32); }

/* ---------------------------------------------------------------- 表格 */
.kv { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.kv th, .kv td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }
.kv th { color: var(--fg-faint); font-weight: 500; width: 38%; padding-right: 16px; vertical-align: top; }
.kv td { color: var(--fg); }
.kv td .num, .kv td.n { font-variant-numeric: tabular-nums; }
.kv td.n { text-align: right; width: 22%; color: var(--fg); font-weight: 600; }
.kv tr.sum th, .kv tr.sum td { border-top: 1px solid var(--line); font-weight: 700; color: var(--accent); }
.kv tr.sum th { color: var(--accent); }

.cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card h4 {
  font-size: 13px; font-weight: 700; letter-spacing: 1.2px; color: var(--fg-faint);
  text-transform: uppercase; margin-top: 18px;
}
.cols h4 { margin-top: 16px; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; padding: 1.5px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .38); border: 1px solid var(--line);
  color: #ffd479; word-break: break-all;
}

.note {
  margin-top: 15px; padding-top: 12px; border-top: 1px dashed var(--line);
  color: var(--fg-faint); font-size: 14px; line-height: 1.8;
}
.note b { color: var(--fg-dim); font-weight: 600; }
.note.warn { color: #d98b8b; border-top-color: rgba(248,113,113,.22); }
.note.warn b { color: var(--block); }

.foot {
  max-width: 1340px; margin: 0 auto; padding: 22px 28px 48px;
  border-top: 1px solid var(--line-soft);
  color: var(--fg-faint); font-size: 14px; letter-spacing: .3px;
}

/* ---------------------------------------------------------------- 响应 */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; flex: none; position: static; max-height: none;
    padding: 16px 18px 0; display: flex; flex-wrap: wrap; gap: 4px;
    border-bottom: 1px solid var(--line-soft);
  }
  .side h3 { width: 100%; margin-left: 2px; }
  .side a { margin-bottom: 0; }
  .main { padding: 18px 18px 48px; }
  .top { padding: 0 18px; }
  .hero h1 { font-size: 27.5px; }
  .livebar .item { flex: 1 1 45%; border-right: none; border-bottom: 1px solid var(--line-soft); }
  .livebar .item.stamp { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

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

/* 竞速视频 OCR 节: 表格里的状态值(通用的 .ok/.bad 规则是限定在 .livebar/.stat 里的) */
.kv span.ok { color: var(--ok); font-weight: 600; }
.kv span.bad { color: var(--block); font-weight: 600; }
.kv .stage {
  color: var(--fg-dim); font-size: 14px; margin-left: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --------------------------------------------------------------------------
   刷新高光: 每次取到新数据, 让一道高光从左到右扫过顶部状态条。
   数字没变的时候, 这道光就是"确实刷新了"的唯一证据。
   -------------------------------------------------------------------------- */
.livebar > .sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 34%;
  pointer-events: none; opacity: 0; will-change: transform, opacity;
  background: linear-gradient(90deg, transparent,
              var(--accent-soft) 35%, var(--accent-line) 50%, var(--accent-soft) 65%, transparent);
}
.livebar > .sweep.run { animation: refresh-sweep 1.05s cubic-bezier(.3, .1, .25, 1) 1; }
.livebar > .sweep.run.fail {
  background: linear-gradient(90deg, transparent,
              rgba(248,113,113,.18) 35%, rgba(248,113,113,.34) 50%, rgba(248,113,113,.18) 65%, transparent);
}
@keyframes refresh-sweep {
  0%   { opacity: 0; transform: translateX(-110%); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(330%); }
}
@media (prefers-reduced-motion: reduce) {
  .livebar > .sweep { display: none; }
}

/* --------------------------------------------------------------------------
   卡片本体的刷新闪光: 除了扫光, 边框与底色也短暂亮一下。
   给某块内容加 data-flash 就生效(见 site.js 的 sweep)。
   -------------------------------------------------------------------------- */
.card[data-flash] { position: relative; overflow: hidden; }
.card[data-flash] > .sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 26%;
  pointer-events: none; opacity: 0; z-index: 2;
  background: linear-gradient(90deg, transparent,
              var(--accent-soft) 35%, var(--accent-line) 50%, var(--accent-soft) 65%, transparent);
}
.card[data-flash] > .sweep.run { animation: card-sweep 1.15s cubic-bezier(.3, .1, .25, 1) 1; }
.card[data-flash] > .sweep.run.fail {
  background: linear-gradient(90deg, transparent,
              rgba(248,113,113,.16) 35%, rgba(248,113,113,.30) 50%, rgba(248,113,113,.16) 65%, transparent);
}
@keyframes card-sweep {
  0%   { opacity: 0; transform: translateX(-110%); }
  14%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(400%); }
}
.card.flash { animation: card-glow .9s ease-out 1; }
.card.flash-bad { animation: card-glow-bad .9s ease-out 1; }
@keyframes card-glow {
  0%   { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), 0 0 22px -6px var(--accent); }
  100% { border-color: var(--line); box-shadow: none; }
}
@keyframes card-glow-bad {
  0%   { border-color: rgba(248,113,113,.5); box-shadow: 0 0 0 1px rgba(248,113,113,.45), 0 0 22px -6px var(--block); }
  100% { border-color: var(--line); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card[data-flash] > .sweep { display: none; }
  .card.flash, .card.flash-bad { animation: none; }
}

/* --------------------------------------------------------------------------
   二级页面入口(段落标题右侧)
   -------------------------------------------------------------------------- */
.card > header .more {
  margin-left: auto; font-size: 14px; color: var(--fg-dim); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.card > header .more:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* 次要说明文字 */
.dim { color: var(--fg-faint); }

/* --------------------------------------------------------------------------
   查一个 BV 号(面向用户的入口)
   -------------------------------------------------------------------------- */
.lookup { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.lookup input {
  flex: 1; min-width: 220px; font: inherit; font-size: 15.5px; color: var(--fg);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.lookup input:focus { outline: none; border-color: var(--accent-line); background: rgba(0,0,0,.3); }
.lookup button {
  font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
  color: #06121a; background: var(--accent); border: none; border-radius: 10px; padding: 10px 18px;
}
.lookup button.ghost { color: var(--fg-dim); background: transparent; border: 1px solid var(--line); }
.lookup button:disabled { opacity: .5; cursor: default; }
.lookup-result { margin-top: 14px; }
.lookup-result .headline { font-size: 16.5px; font-weight: 650; }
.lookup-result .headline.ok { color: var(--ok); }
.lookup-result .headline.wait { color: var(--dev); }
.lookup-result .headline.bad { color: var(--block); }
.lookup-result .meta-line { color: var(--fg-dim); font-size: 15px; margin-top: 4px; }
.lookup-result pre {
  margin-top: 10px; padding: 14px 16px; border-radius: 12px; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 15px; line-height: 1.75; color: var(--fg);
}
.tag-src {
  display: inline-block; font-size: 13px; font-weight: 650; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--line);
}
.tag-src.self { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag-src.external { color: var(--dev); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.1); }
