/* 0xsu.com — 公共样式 */
:root {
  --bg: #07070f;
  --bg-2: #0c0c1a;
  --panel: rgba(18, 18, 36, 0.72);
  --panel-solid: #12122a;
  --line: #24243f;
  --line-2: #33335a;
  --text: #e9eaf7;
  --muted: #9a9cc2;
  --dim: #6b6d95;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --pink: #f472b6;
  --green: #4ade80;
  --yellow: #facc15;
  --grad: linear-gradient(90deg, var(--cyan), var(--violet) 50%, var(--pink));
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --radius: 14px;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  overflow-x: hidden;
}
/* 点阵网格背景 + 顶部辉光 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 95% 0%, rgba(244, 114, 182, 0.10), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0) 0 0 / 26px 26px,
    var(--bg);
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(167, 139, 250, 0.35); }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.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 { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--cyan); color: #000; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ── 顶栏 ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 7, 15, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--mono); font-weight: 700; letter-spacing: 0.04em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand small { color: var(--dim); font-weight: 400; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14px; padding: 6px 12px; border-radius: 8px; font-family: var(--mono); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
@media (max-width: 640px) {
  .brand small { display: none; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
  .nav-links .hide-sm { display: none; }
}

/* ── 通用组件 ── */
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--cyan); letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow::before { content: "// "; color: var(--dim); }
.section { padding: 88px 0 24px; }
.section h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.25; margin: 10px 0 12px; letter-spacing: -0.01em; }
.section .lead { color: var(--muted); max-width: 720px; margin: 0 0 36px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font: 600 15px/1 var(--sans);
  border: 1px solid var(--line-2); color: var(--text); background: rgba(255, 255, 255, 0.03);
  cursor: pointer; transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--violet); transform: translateY(-1px); }
.btn.primary { border: 0; color: #08080f; background: var(--grad); box-shadow: 0 6px 30px -8px rgba(167, 139, 250, 0.65); }
.btn.primary:hover { box-shadow: 0 10px 36px -8px rgba(244, 114, 182, 0.7); }
.btn .k { font-family: var(--mono); font-size: 12px; opacity: .7; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12.5px/1 var(--mono); color: var(--muted);
  padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, 0.02);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); }

/* 像素角标装饰 */
.corners { position: relative; }
.corners::before, .corners::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 2px solid var(--cyan); opacity: .8;
}
.corners::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.corners::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-color: var(--pink); }

/* ── 页脚 ── */
.footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--dim); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer a, .footer button.link { color: var(--muted); }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
button.link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ── Cookie / 隐私提示 ── */
.consent {
  position: fixed; z-index: 90; left: 16px; right: 16px; bottom: 16px;
  max-width: 560px; margin-left: auto;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.7);
  font-size: 14px; color: var(--muted);
  transform: translateY(16px); opacity: 0; transition: transform .25s, opacity .25s;
}
.consent.show { transform: none; opacity: 1; }
.consent[hidden] { display: none; }
.consent h2 { margin: 0 0 6px; font: 600 15px/1.4 var(--mono); color: var(--text); }
.consent p { margin: 0 0 6px; }
.consent .en { font-size: 12.5px; color: var(--dim); }
.consent .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.consent .btn { padding: 9px 16px; font-size: 14px; }
.consent .row a { margin-left: auto; font-size: 13px; }

/* ── 文本页（隐私政策等） ── */
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 56px 0 8px; }
.prose h2 { font-size: 21px; margin: 40px 0 8px; }
.prose h3 { font-size: 17px; margin: 24px 0 4px; }
.prose p, .prose li { color: #c9cae3; }
.prose .meta { color: var(--dim); font-family: var(--mono); font-size: 13px; }
.prose hr { border: 0; border-top: 1px dashed var(--line-2); margin: 48px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.table-scroll { overflow-x: auto; }

/* ═════════════════════ 主页 ═════════════════════ */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding: 72px 0 24px; }
.hero h1 { margin: 18px 0 10px; display: flex; flex-direction: column; gap: 18px; }
.pixel-logo { width: min(340px, 70vw); height: auto; filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.45)); }
.h1-name { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: 0.06em; }
.term { margin: 22px 0 0; color: var(--muted); font-size: 15px; }
.term .p { color: var(--green); }
.caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.18em; margin-left: 3px; background: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tagline { font-size: clamp(18px, 2.2vw, 22px); color: #d6d7ef; margin: 0; }
.tagline-en { color: var(--dim); font-size: 13.5px; margin: 6px 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, auto); gap: 10px 28px; justify-content: start; color: var(--dim); font-size: 13px; }
.hero-stats b { display: block; font-size: 28px; color: var(--text); line-height: 1.2; }
.hero-art { justify-self: center; width: min(420px, 100%); border-radius: 28px; }
.hero-art img { width: 100%; height: auto; border-radius: 22%; box-shadow: 0 0 80px -10px rgba(167, 139, 250, 0.55), 0 0 140px -30px rgba(34, 211, 238, 0.5); animation: float 6s ease-in-out infinite; }
.hero-art.corners::before, .hero-art.corners::after { width: 26px; height: 26px; }
@keyframes float { 50% { transform: translateY(-10px); } }
.spark { position: absolute; width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: twinkle 2.6s ease-in-out infinite; }
.spark.s1 { left: -14px; top: 30%; }
.spark.s2 { right: -10px; top: 12%; background: var(--pink); box-shadow: 0 0 12px var(--pink); animation-delay: .8s; }
.spark.s3 { right: 18%; bottom: -14px; background: var(--yellow); box-shadow: 0 0 12px var(--yellow); animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-art img, .spark, .caret { animation: none; } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .hero-art { display: none; }
  .hero-stats { grid-template-columns: repeat(2, auto); }
}

/* 作品卡片 */
.works { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.work { display: flex; flex-direction: column; }
.work.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.work-cover { display: block; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
a.work-cover:hover img { transform: scale(1.04); }
.work-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 4px; }
.work-body h3 { font-size: 21px; line-height: 1.35; margin: 4px 0 4px; }
.work.featured .work-body h3 { font-size: 26px; }
.work-body p { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.work-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--dim); }
.work-meta .tag { color: var(--cyan); border: 1px solid rgba(34, 211, 238, .35); padding: 2px 8px; border-radius: 6px; }
.work-meta .new { color: #08080f; background: var(--pink); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.stats { list-style: none; padding: 0; margin: 6px 0 18px; display: flex; flex-wrap: wrap; gap: 8px 26px; }
.stats b { display: block; font: 700 22px/1.2 var(--mono); }
.stats span { font-size: 12.5px; color: var(--dim); }
.work .actions { margin-top: auto; }
@media (max-width: 860px) {
  .works, .work.featured { grid-template-columns: 1fr; }
}

/* 预览格 */
.split-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.split-head .lead { margin-bottom: 0; }
.pv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pv { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; }
.pv video { width: 100%; height: 100%; object-fit: cover; }
.pv:hover { border-color: var(--violet); }
.pv-l { position: absolute; left: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(7, 7, 15, .8); color: var(--c); border: 1px solid var(--c); font-weight: 700; }
.pv-g { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; font-size: 13.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
@media (max-width: 760px) { .pv-grid { grid-template-columns: repeat(2, 1fr); } }

/* 规则 & 选手 */
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.pipeline li { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.pipeline .n { color: var(--violet); font-size: 13px; }
.pipeline b { font-size: 18px; }
.pipeline li span:last-child { color: var(--muted); font-size: 14.5px; }
.sub { margin: 44px 0 14px; font-size: 18px; }
.models { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.model { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 14px; }
.model b { color: var(--text); font-size: 18px; }
.model-k { color: var(--dim); font-size: 12px; letter-spacing: .1em; }
.model code { font-family: var(--mono); color: var(--yellow); }
.note { color: var(--dim); font-size: 13.5px; margin-top: 12px; }
@media (max-width: 860px) { .pipeline { grid-template-columns: repeat(2, 1fr); } .models { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .pipeline { grid-template-columns: 1fr; } }

.about { display: grid; grid-template-columns: auto 1fr; gap: 28px; padding: 28px; align-items: center; overflow: visible; }
.about > img { width: 120px; height: 120px; border-radius: 28px; }
.about > img.vcover { width: 360px; height: auto; border-radius: 10px; }
.about h2 { margin: 4px 0 8px; font-size: 26px; }
.about p { color: var(--muted); margin: 0 0 18px; }
.dim { color: var(--dim); font-size: .6em; font-weight: 400; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .about > img.vcover { width: 100%; } }

/* 404 */
.nf { padding: 120px 0 40px; }
.nf-code { color: var(--pink); }
.nf h1 { font: 700 clamp(44px, 9vw, 96px)/1 var(--mono); margin: 10px 0 16px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf p { color: var(--muted); margin-bottom: 28px; }

/* ═════════════════════ 2D 擂台对比页 ═════════════════════ */
.sd-hero { padding: 36px 0 32px; }
.crumbs { font-size: 13px; color: var(--dim); margin-bottom: 26px; }
.crumbs a { color: var(--muted); }
.sd-hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.15; margin: 18px 0 16px; letter-spacing: -0.01em; }
.sd-hero .lead { color: #c9cae3; max-width: 780px; font-size: 17px; }

.sd-bar { position: sticky; top: 60px; z-index: 40; background: rgba(7, 7, 15, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-block: 1px solid var(--line); }
.sd-bar .wrap { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.fchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; font: 500 13px/1 var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line-2); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.fchip[aria-pressed="true"] { color: var(--text); border-color: var(--cyan); background: rgba(34, 211, 238, .1); }

.chapter { padding-top: 48px; scroll-margin-top: 120px; }
.chapter h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 24px; margin: 0 0 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-2); }
.chapter h2 .mono { color: var(--violet); font-size: 14px; }
.chapter h2 small { color: var(--dim); font: 400 13px var(--mono); margin-left: auto; }
.game { padding: 26px 0 18px; scroll-margin-top: 120px; }
.game header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.game .idx { color: var(--dim); font-size: 13px; }
.game h3 { margin: 0; font-size: 20px; }
.game .prompt { margin: 0; color: var(--dim); font-size: 13.5px; flex-basis: 100%; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { margin: 0; }
.tile-media { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; cursor: zoom-in; transition: border-color .2s, box-shadow .2s; }
.tile-media:hover { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 10px 30px -12px var(--c); }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 8px; top: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(7, 7, 15, .82); border: 1px solid var(--c); color: var(--c); font-weight: 700; font-size: 14px; }
.tile figcaption { display: flex; flex-direction: column; padding: 8px 2px 0; font-size: 14px; line-height: 1.45; }
.tile .who b { color: var(--c); }
.tile .ttl { color: var(--muted); font-size: 13px; }
.cmt { margin: 12px 0 0; color: #c9cae3; font-size: 15px; padding: 10px 14px; border-left: 3px solid var(--violet); background: rgba(167, 139, 250, .06); border-radius: 0 8px 8px 0; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; gap: 16px; }
  .sd-bar { top: 60px; }
}

.bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.bars li { display: grid; grid-template-columns: 170px 1fr 70px; gap: 14px; align-items: center; }
.bars .lbl { display: flex; flex-direction: column; line-height: 1.3; }
.bars .lbl b { color: var(--c); }
.bars .lbl small { color: var(--dim); font-size: 12px; }
.bar { height: 14px; background: rgba(255, 255, 255, .05); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 4px; box-shadow: 0 0 14px -2px var(--c); }
.num { text-align: right; }
@media (max-width: 560px) { .bars li { grid-template-columns: 110px 1fr 54px; gap: 10px; } }


.lb { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: #000; width: min(1100px, 94vw); color: var(--text); }
.lb::backdrop { background: rgba(4, 4, 10, .85); backdrop-filter: blur(4px); }
.lb video { width: 100%; height: auto; }
.lb-cap { margin: 0; padding: 12px 16px; background: var(--panel-solid); font-size: 14px; }
.lb-x { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(7, 7, 15, .8); color: #fff; font-size: 20px; cursor: pointer; }

.legend { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.legend li { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; }
.legend .badge { position: static; grid-row: span 2; width: auto; padding: 0 8px; }
.legend b { color: var(--c); font-size: 15px; line-height: 1.3; }
.legend small { color: var(--dim); font-size: 12.5px; }
.badge { width: auto; min-width: 28px; padding: 0 7px; font-size: 12.5px; }
.takeaways { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.takeaways li { padding: 20px; border-top: 3px solid var(--c); display: flex; flex-direction: column; gap: 8px; }
.takeaways b { color: var(--c); font-size: 18px; }
.takeaways span { color: var(--muted); font-size: 14.5px; }
.pv-l { width: auto; padding: 0 8px; font-size: 12.5px; }
@media (max-width: 860px) { .takeaways { grid-template-columns: 1fr; } }

/* ── 语言切换 ── */
.nav-links a.lang { margin-left: 6px; color: var(--text); border: 1px solid var(--line-2); font-weight: 600; }
.nav-links a.lang:hover { border-color: var(--cyan); }
.langhint {
  position: fixed; z-index: 80; left: 50%; top: 72px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px 10px 16px; font-size: 14px; color: var(--muted);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
}
.langhint .btn { padding: 7px 14px; font-size: 13.5px; }
.langhint .x { background: none; border: 0; color: var(--dim); font-size: 18px; cursor: pointer; padding: 2px 6px; }
