/* 小羽 Xiaoyu 官网
   dark-first, single amber accent, system font stack (CJK-first), radius 6px everywhere */

:root {
  --bg: #0f0f10;
  --bg-2: #151517;
  --bg-3: #1c1c1f;
  --line: #27272b;
  --line-2: #3a3a40;
  --fg: #ececea;
  --fg-2: #a8a8a4;
  --fg-3: #6f6f6c;
  --accent: #e0a64b;
  --accent-ink: #1a1407;
  --accent-soft: rgba(224, 166, 75, 0.12);
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: Monaco, "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; /* Monaco is Apple-bundled, used only when installed locally; Fragment Mono is self-hosted (OFL) */
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f5;
    --bg-2: #ffffff;
    --bg-3: #efefec;
    --line: #e2e2de;
    --line-2: #cfcfca;
    --fg: #141414;
    --fg-2: #55554f;
    --fg-3: #8a8a84;
    --accent: #b9791c;
    --accent-ink: #fffaf0;
    --accent-soft: rgba(185, 121, 28, 0.1);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.92em; }
p code, li code, h3 code {
  white-space: nowrap;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand em { font-style: normal; color: var(--fg-3); font-weight: 500; }
.brand svg { color: var(--accent); }
.links { display: flex; gap: 24px; margin-left: auto; font-size: 14px; color: var(--fg-2); white-space: nowrap; }
.links a:hover { color: var(--fg); }
@media (max-width: 760px) { .links { display: none; } .nav-in { gap: 12px; } .nav .btn-sm { margin-left: auto; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  font: inherit; font-size: 15px; font-weight: 500;
  color: var(--fg); background: transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}
.btn:hover { border-color: var(--fg-3); background: var(--bg-2); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); border-color: transparent; }
.btn-primary code { font-size: 14px; font-weight: 500; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.copy { position: relative; }
.copy-state { font-size: 13px; opacity: 0; transition: opacity 0.2s; }
.copy.done .copy-state { opacity: 1; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 96px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.22; letter-spacing: -0.02em; font-weight: 650;
}
.lede { margin-top: 20px; font-size: 17px; color: var(--fg-2); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.term {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.6);
}
.term-bar {
  display: flex; justify-content: space-between;
  padding: 9px 14px; font: 12px/1 var(--mono); color: var(--fg-3);
  border-bottom: 1px solid var(--line); background: var(--bg-3);
}
.term pre, .install-block pre {
  margin: 0; padding: 18px 18px 20px; overflow-x: auto;
  font: 13.5px/1.75 var(--mono); color: var(--fg);
}
.term .p { color: var(--accent); }
.term .c, .install-block .c { color: var(--fg-3); }
.cur { display: inline-block; width: 8px; height: 1.1em; vertical-align: text-bottom; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .cur { animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- section shared ---------- */
section { padding: 96px 0; border-top: 1px solid var(--line); }
.sec-title { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; }
.sec-sub { margin-top: 12px; color: var(--fg-2); max-width: 40em; }
@media (max-width: 760px) { section { padding: 64px 0; } }

/* ---------- stance ---------- */
.stance .wrap { display: grid; gap: 56px; }
.stance-row { max-width: 760px; }
.stance-offset { margin-left: auto; }
.stance-row h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
.stance-row p { margin-top: 14px; color: var(--fg-2); font-size: 16.5px; }
@media (max-width: 760px) { .stance-offset { margin-left: 0; } .stance .wrap { gap: 40px; } }

/* ---------- modes ---------- */
.mode-scale {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.mode-scale li { padding: 26px 22px 28px; border-left: 1px solid var(--line); position: relative; background: var(--bg-2); }
.mode-scale li:first-child { border-left: 0; }
.mode-scale li::before {
  content: ""; display: block; height: 4px; margin-bottom: 22px; border-radius: 2px;
  background: var(--line-2);
}
.mode-scale li:nth-child(2)::before { background: linear-gradient(90deg, var(--line-2), var(--accent) 50%, var(--line-2)); opacity: 0.55; }
.mode-scale li:nth-child(3)::before { background: var(--line-2); }
.mode-scale li.is-yolo { background: var(--accent-soft); }
.mode-scale li.is-yolo::before { background: var(--accent); }
.mode-scale h3 { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.mode-scale li.is-yolo h3 { color: var(--accent); }
.mode-scale p { margin-top: 10px; color: var(--fg-2); font-size: 15px; }
@media (max-width: 860px) {
  .mode-scale { grid-template-columns: 1fr 1fr; }
  .mode-scale li:nth-child(3) { border-left: 0; }
  .mode-scale li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .mode-scale { grid-template-columns: 1fr; }
  .mode-scale li { border-left: 0; border-top: 1px solid var(--line); }
  .mode-scale li:first-child { border-top: 0; }
}
.yolo-floor { margin-top: 40px; display: grid; grid-template-columns: 1fr 2fr; gap: 24px 48px; align-items: start; }
.yolo-floor h3 { font-size: 19px; font-weight: 600; line-height: 1.4; }
.yolo-floor ul { list-style: none; padding: 0; display: grid; gap: 12px; color: var(--fg-2); }
.yolo-floor li { padding-left: 18px; position: relative; }
.yolo-floor li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--accent); }
@media (max-width: 760px) { .yolo-floor { grid-template-columns: 1fr; } }

/* ---------- bento ---------- */
.bento {
  margin-top: 40px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(200px, auto);
}
.cell {
  padding: 26px 26px 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2);
  position: relative; overflow: hidden;
  transition: border-color 0.25s;
}
.cell:hover { border-color: var(--line-2); }
.cell h3 { font-size: 18px; font-weight: 600; line-height: 1.35; position: relative; }
.cell p { margin-top: 10px; color: var(--fg-2); font-size: 15px; position: relative; max-width: 48em; }
.cell-sandbox { grid-column: span 4; }
.cell-sandbox::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 100% 0%, var(--accent-soft), transparent 55%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--accent) 9%, transparent) 14px 15px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.cell-tint { background: var(--bg-3); }
.cell:nth-child(2) { grid-column: span 2; }
.cell:nth-child(3), .cell:nth-child(4) { grid-column: span 2; }
.cell-grid { grid-column: span 2; }
.cell-grid::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 80% 100%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 80% 100%, #000 20%, transparent 70%);
}
.cell:nth-child(6) { grid-column: span 6; }
.cell:nth-child(6) p { max-width: 60em; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .cell, .cell-sandbox, .cell-grid, .cell:nth-child(n) { grid-column: span 1; }
}

/* ---------- weave ledger ---------- */
.ledger { margin-top: 40px; border-top: 1px solid var(--line); }
.ledger-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 24px 48px;
  padding: 34px 0; border-bottom: 1px solid var(--line);
}
.ledger-name strong { display: block; font-size: 40px; line-height: 1; letter-spacing: 0.06em; font-weight: 650; color: var(--accent); }
.ledger-name span { display: block; margin-top: 10px; font: 13px/1.4 var(--mono); color: var(--fg-3); }
.ledger-row p { color: var(--fg-2); font-size: 16px; align-self: center; }
@media (max-width: 760px) { .ledger-row { grid-template-columns: 1fr; gap: 14px; padding: 26px 0; } .ledger-name strong { font-size: 32px; } }

/* ---------- integrate ---------- */
.int-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.keys { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.keys code {
  display: inline-block; padding: 7px 11px; font-size: 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--fg);
}
.keys li:last-child code { border-color: var(--accent); color: var(--accent); }
.surfaces { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.surface { padding: 24px; background: var(--bg-2); }
.surface:nth-child(even) { border-left: 1px solid var(--line); }
.surface:nth-child(n+3) { border-top: 1px solid var(--line); }
.surface h3 { font-size: 16px; font-weight: 600; }
.surface p { margin-top: 8px; color: var(--fg-2); font-size: 14.5px; }
@media (max-width: 860px) { .int-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 520px) { .surfaces { grid-template-columns: 1fr; } .surface:nth-child(even) { border-left: 0; } .surface:nth-child(n+2) { border-top: 1px solid var(--line); } }

/* ---------- install ---------- */
.install-block {
  margin-top: 32px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 20px 20px 6px;
}
.install-block pre { font-size: 14.5px; }
.fine { margin-top: 18px; color: var(--fg-3); font-size: 14px; }
@media (max-width: 640px) { .install-block { grid-template-columns: 1fr; padding: 6px 16px 16px 6px; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px 0; color: var(--fg-3); font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot span { font-size: 12.5px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot nav a:hover { color: var(--fg); }

/* ---------- reveal motion (hierarchy: content arrives in reading order) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .no-js .reveal { opacity: 1; transform: none; }
}

/* ---------- shells ---------- */
.shell-grid { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shell {
  padding: 26px 26px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); display: flex; flex-direction: column; gap: 12px;
}
.shell h3 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.shell p { color: var(--fg-2); font-size: 15px; flex: 1; }
.shell pre { margin: 6px 0 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line); font: 13.5px/1.7 var(--mono); color: var(--fg); }
.shell .c { color: var(--fg-3); }
.tag { font: 11px/1 var(--mono); letter-spacing: 0.04em; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 4px 6px; }
.more { font-size: 14px; color: var(--accent); }
.more:hover { text-decoration: underline; }
.shell-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 40px; background: var(--bg-3); }
.shell-wide > div { flex: 1; }
.shell-wide pre { margin: 0; min-width: 320px; }
@media (max-width: 860px) {
  .shell-grid { grid-template-columns: 1fr; }
  .shell-wide { flex-direction: column; align-items: stretch; gap: 12px; }
  .shell-wide pre { min-width: 0; }
}
.shot { margin: -26px -26px 6px; border-bottom: 1px solid var(--line); background: #f2f2f2; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 8px 26px; font-size: 12.5px; color: var(--fg-3); background: var(--bg-2); border-top: 1px solid var(--line); }

.tui-shot { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #24283b; }
.tui-shot img { display: block; width: 100%; height: auto; }
.tui-shot figcaption { padding: 9px 16px; font-size: 13px; color: var(--fg-3); background: var(--bg-2); border-top: 1px solid var(--line); }

/* ---------- zoomable screenshot + lightbox ---------- */
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100dvh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox[open] { display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92dvh; width: auto; height: auto; border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-close { position: fixed; top: 16px; right: 16px; height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.5); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }

/* ---------- screenshot hover: lift + hint (motion only when allowed) ---------- */
.zoom { position: relative; overflow: hidden; }
.zoom img { transition: transform 0.5s var(--ease); transform-origin: 50% 40%; }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px;
  padding: 6px 10px; border-radius: var(--radius);
  background: rgba(20, 20, 22, 0.78); color: #fff; font-size: 12.5px; line-height: 1;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; transform: none; }
.shot .zoom, .tui-shot .zoom { border-radius: 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .zoom:hover img { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .zoom img, .zoom-hint { transition: none; }
  .zoom-hint { transform: none; }
}

/* TUI banner: no scale on hover (edges of the bordered panel get clipped); keep hint + lightbox */
.tui-shot .zoom:hover img { transform: none; }

/* ---------- language switch ---------- */
.lang { font-size: 13px; color: var(--fg-2); padding: 6px 8px; border-radius: var(--radius); white-space: nowrap; }
.lang:hover { color: var(--fg); background: var(--bg-2); }
@media (max-width: 760px) { .nav .lang { margin-left: auto; } .nav .btn-sm { margin-left: 0; } }
html[lang="en"] h1 { font-size: clamp(28px, 3.1vw, 40px); letter-spacing: -0.025em; }
html[lang="en"] .hero-grid { grid-template-columns: 1.1fr 1fr; }

/* ---------- English page type: Nunito Sans (variable, wght 400-800) + Fragment Mono, self-hosted, OFL ---------- */
@font-face {
  font-family: "Nunito Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/NunitoSans.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fragment Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/FragmentMono.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
html[lang="en"] {
  --sans: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[lang="en"] body { font-size: 16.5px; }
html[lang="en"] h1 { font-weight: 800; letter-spacing: -0.02em; }
html[lang="en"] .sec-title, html[lang="en"] .stance-row h2 { font-weight: 750; letter-spacing: -0.015em; }
html[lang="en"] h3, html[lang="en"] .btn { font-weight: 700; }
html[lang="en"] .mode-scale h3, html[lang="en"] .ledger-name span, html[lang="en"] .term-bar { font-weight: 400; }

/* ---------- enterprise custom-build aside ---------- */
.custom {
  margin-top: 22px; padding: 18px 20px;
  display: flex; align-items: center; gap: 24px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: var(--bg-2);
}
.custom p { margin: 0; color: var(--fg); font-size: 15.5px; flex: 1 1 auto; min-width: 0; }
.custom .btn { height: 40px; padding: 0 16px; font-size: 14px; flex: 0 0 auto; }
@media (max-width: 640px) { .custom { flex-direction: column; align-items: flex-start; } }
