/*! Orange酱 · 子项目共用外壳
    与主站 index.html 同一套设计语言：深空底色 + 轨道橙 + 亮色黑白白洞。
    放在各页面 <style> 之后引入，视觉覆盖旧样式，布局不受影响。 */

:root {
  color-scheme: dark;
  --void: #000000;
  --surface: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f4f5f7;
  --text-soft: rgba(244, 245, 247, .72);
  --text-muted: rgba(244, 245, 247, .52);
  --orange: #f0873e;
  --orange-hot: #ffb06a;
  --accent-ink: #f0873e;
  --field-bg: #0d0e12;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --label: "Archivo", "Noto Sans SC", "PingFang SC", sans-serif;
  --header-h: 64px;
  --max: 1240px;

  --bg-card-hover: rgba(255, 255, 255, .07);
  --glass: rgba(0, 0, 0, .78);
  --container-bg: rgba(255, 255, 255, .02);
  --block-bg: rgba(255, 255, 255, .06);
  --score-bg: rgba(255, 255, 255, .04);
  --score-border: var(--line);
  --score-num: rgba(244, 245, 247, .28);
  --score-done: #63d69b;
  --score-early: #ff7b72;
  --history-border: var(--line);
  --btn-gradient: linear-gradient(135deg, #f0873e, #ffb06a);
  --btn-shadow: rgba(240, 135, 62, .35);
}

body.light {
  color-scheme: light;
  --void: #f7f7f4;
  --surface: rgba(255, 255, 255, .78);
  --line: rgba(15, 15, 15, .105);
  --line-strong: rgba(15, 15, 15, .22);
  --text: #111111;
  --text-soft: rgba(17, 17, 17, .68);
  --text-muted: rgba(17, 17, 17, .62);
  --orange: #111111;
  --orange-hot: #111111;
  --accent-ink: #111111;
  --field-bg: #ffffff;
  --bg-card-hover: rgba(17, 17, 17, .05);
  --glass: rgba(247, 247, 244, .82);
  --container-bg: rgba(255, 255, 255, .6);
  --block-bg: rgba(17, 17, 17, .06);
  --score-bg: rgba(17, 17, 17, .04);
  --score-border: var(--line);
  --score-num: rgba(17, 17, 17, .3);
  --score-done: #1f9d63;
  --score-early: #d64545;
  --history-border: var(--line);
  --btn-gradient: linear-gradient(135deg, #111111, #3a3a3a);
  --btn-shadow: rgba(0, 0, 0, .18);
}

/* 旧子页面变量名 → 主站 token（写在 body 上，亮色时按 body.light 的 token 解析） */
body, body.light {
  --bg: var(--void);
  --bg-card: var(--surface);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text-secondary: var(--text-soft);
  --accent: var(--orange);
  --accent-hover: var(--orange-hot);
  --score-border: var(--line);
  --history-border: var(--line);
}

/* ---------- 滚动条：细、低调，悬停回到主站橙 ---------- */
:root {
  --sb-thumb: rgba(255, 255, 255, .14);
  --sb-thumb-hover: rgba(240, 135, 62, .62);
}
html.light {
  --sb-thumb: rgba(17, 17, 17, .2);
  --sb-thumb-hover: rgba(17, 17, 17, .5);
}
/* Firefox 走标准属性；Chrome/Safari 走 ::-webkit-scrollbar，两者互斥才不会互相顶掉 */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
}
html { scroll-behavior: smooth; }
html::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
html::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); background-clip: content-box; }
html::-webkit-scrollbar-corner { background: transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.light { background: var(--void); color: var(--text); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--orange); color: #000; }
body.light ::selection { background: #111; color: #fff; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--orange-hot); outline-offset: 3px; }

/* ---------- 背景：星野 + 噪点 ---------- */
.space-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 72% 42%, rgba(80, 96, 180, .14), transparent 55%),
    radial-gradient(ellipse 40% 35% at 20% 80%, rgba(240, 135, 62, .06), transparent 50%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .04), transparent 40%),
    var(--void);
}
.space-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.light .space-field {
  background:
    radial-gradient(ellipse 44% 32% at 74% 38%, rgba(0, 0, 0, .075), transparent 68%),
    radial-gradient(ellipse 34% 24% at 14% 88%, rgba(0, 0, 0, .035), transparent 72%),
    linear-gradient(180deg, #fbfbf9 0%, #f2f2ef 100%);
}
body.light .space-noise { opacity: .028; mix-blend-mode: multiply; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px clamp(18px, 4vw, 40px);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .92), rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, 0));
}
body.light .site-header::before {
  background: linear-gradient(to bottom, rgba(247, 247, 244, .95), rgba(247, 247, 244, .6) 60%, rgba(247, 247, 244, 0));
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--display);
  font-size: .96rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.logo-mark { display: inline-flex; width: 27px; height: 27px; flex: none; }
.logo-mark svg, .logo-mark img { display: block; width: 100%; height: 100%; }
body:not(.light) .logo-mark--light,
body.light .logo-mark--dark { display: none; }
.logo-word { color: var(--text); }
.site-header .logo { padding: 0; border: 0; background: none; border-radius: 0; }
.nav-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 26px); }
.nav-links a {
  position: relative;
  padding: 6px 2px;
  color: var(--text-soft);
  text-decoration: none;
  font-family: var(--label);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  transition: color .25s var(--ease-out);
}
.site-header .nav-links a:hover,
.site-header .nav-links a.active { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.site-header .nav-links a {
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
}
.theme-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: transform .3s var(--ease-out), border-color .25s var(--ease-out);
}
.theme-btn:hover { transform: rotate(24deg); border-color: var(--accent-ink); }
.theme-btn svg, .theme-btn img { display: block; width: 18px; height: 18px; }
.hole-i { display: inline-flex; }
body:not(.light) .hole-i--light,
body.light .hole-i--dark { display: none; }

/* ---------- 页头（工具页沿用 .hero 结构） ---------- */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(30px, 4.4vw, 54px) clamp(18px, 4vw, 40px) 6px;
  text-align: left;
}
.hero h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.06;
  color: var(--text);
}
.hero h1 span {
  color: var(--text);
  background: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}
.hero p { margin: 0; max-width: 60ch; color: var(--text-soft); font-size: .95rem; }
.page-kicker,
.hero .page-kicker {
  margin: 0 0 12px;
  color: var(--orange);
  font-family: var(--label);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero .page-kicker { max-width: none; }
.hero > p + h1, .hero .page-kicker + h1 { margin-top: 0; }
body.light .page-kicker { color: #111; }

/* ---------- 卡片 / 面板 ---------- */
.card, .panel, .canvas-card, .thumb, .preview-card, .entry, .stat, .row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out), transform .3s var(--ease-out);
}
.card:hover, .panel:hover, .thumb:hover, .canvas-card:hover { border-color: var(--line-strong); }
.entry { background: none; border: none; border-radius: 0; }
body.light .card, body.light .panel, body.light .canvas-card, body.light .thumb {
  box-shadow: 0 14px 42px rgba(0, 0, 0, .055);
}

/* ---------- 按钮：主站胶囊风 ---------- */
.m-btn, .abtn, .tool, .play, .t-btn, .chip, .card-btn, .ghost-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .25s var(--ease-out), color .25s var(--ease-out), background .25s var(--ease-out), box-shadow .3s var(--ease-out);
}
.m-btn:hover, .abtn:hover, .tool:hover, .play:hover, .t-btn:hover, .chip:hover, .card-btn:hover, .ghost-btn:hover {
  border-color: var(--accent-ink);
  color: var(--text);
}
.m-btn.solid, .abtn.solid, .tool.on, .t-btn.solid, .chip.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--void);
  font-weight: 700;
}
.m-btn.solid:hover, .abtn.solid:hover, .tool.on:hover, .chip.on:hover { opacity: .88; color: var(--void); }
.play { display: grid; place-items: center; padding: 0; }
.ghost-btn { border-color: var(--line); color: var(--text-muted); }

/* ---------- 表单控件 ---------- */
input[type=text], input[type=search], input[type=number], input[type=date], input[type=month],
input[type=password], input[type=url], input[type=email], select, textarea {
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: .88rem;
  font-family: var(--body);
  transition: border-color .2s var(--ease-out);
}
input[type=text]:focus, input[type=search]:focus, input[type=number]:focus, input[type=date]:focus,
input[type=month]:focus, input[type=password]:focus, input[type=url]:focus, input[type=email]:focus,
select:focus, textarea:focus { border-color: var(--accent-ink); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type=range] { accent-color: var(--orange); }
input[type=checkbox], input[type=radio] { accent-color: var(--orange); }
body.light input[type=range], body.light input[type=checkbox], body.light input[type=radio] { accent-color: #111; }

/* ---------- 标签 / 说明 ---------- */
.card-desc, .sub, .hint, .lede, .meta { color: var(--text-soft); }
.note, .gallery p, .gallery-empty, .footer small { color: var(--text-muted); }
.eyebrow {
  color: var(--orange);
  font-family: var(--label);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
body.light .eyebrow { color: #111; }

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 40px) max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: .78rem;
}
.site-footer p { margin: 0; }
.site-footer a {
  color: var(--text-soft);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: inherit;
  text-decoration: none;
  transition: color .2s ease;
}
.site-footer .footer-links a {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-soft);
  font-family: var(--label);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.site-footer a:hover { color: var(--orange); }
body.light .site-footer a:hover { color: #111; }
.footer-links { display: flex; gap: 14px; align-items: center; }
.footer-meta {
  font-family: var(--label);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero { padding-top: 26px; }
  .hero h1 { font-size: clamp(26px, 8vw, 34px); }
}
/* iOS：整屏噪点层不参与混合，滚动才跟得上手指；颗粒改用低不透明度保留 */
@supports (-webkit-touch-callout: none) {
  .space-noise,
  body.light .space-noise { mix-blend-mode: normal; }
}
