@font-face { font-family: Geist; src: url(assets/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(assets/geist-mono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #06080c;
  --panel: #0c1017;
  --panel-2: #10151e;
  --line: #1b2230;
  --line-2: #263043;
  --text: #e9edf4;
  --muted: #8b95a8;
  --dim: #5d6779;
  --blue: #4f7cff;
  --blue-2: #8aa6ff;
  --orange: #ff8a3d;
  --green: #3ddc97;
  --red: #ff5d6c;
  --sans: Geist, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 14px;
  --bar-h: 84px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans);
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(79, 124, 255, .16), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(255, 138, 61, .07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 48px 100%;
}
a { color: inherit; }
code, pre, .mono { font-family: var(--mono); }
.wrap { width: min(1200px, 100% - 48px); margin: 0 auto; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(6, 8, 12, .72); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 8px; background: #fff; }
.brand small { color: var(--muted); font-weight: 450; font-size: 13px; }
.nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 72px 0 40px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; color: var(--blue-2); text-transform: uppercase; display: inline-flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.hero h1 { font-size: clamp(32px, 5.2vw, 64px); line-height: 1.12; letter-spacing: -.02em; margin: 20px 0 18px; font-weight: 700; max-width: 18em; }
.hero h1 .hl { background: linear-gradient(90deg, #fff, var(--blue-2) 55%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 46em; margin: 0; }
.principle { margin-top: 28px; display: grid; grid-template-columns: 1fr auto 1fr; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.principle > div { padding: 18px 22px; }
.principle .tag { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.principle b { display: block; font-size: 18px; margin-top: 8px; }
.principle p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.principle .code-side b { color: var(--orange); }
.principle .agent-side b { color: var(--blue-2); }
.principle .vs { display: grid; place-items: center; padding: 0 14px; color: var(--muted); font: 500 20px var(--mono); border-inline: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(12, 16, 23, .7); }
.stat b { font: 650 28px/1.1 var(--mono); display: block; }
.stat span { color: var(--muted); font-size: 13px; }

/* 三层工厂 */
.factory { margin-top: 40px; display: grid; gap: 10px; }
.layer { display: grid; grid-template-columns: 150px 1fr; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.layer .name { padding: 16px 18px; border-right: 1px solid var(--line); background: var(--panel-2); }
.layer .name small { display: block; font: 500 11px var(--mono); color: var(--dim); letter-spacing: .1em; }
.layer .name b { font-size: 16px; }
.layer .cells { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; background: rgba(255, 255, 255, .02); white-space: nowrap; }
.chip img { width: 18px; height: 18px; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.chip.o { border-color: rgba(255, 138, 61, .45); }
.chip.g { border-color: rgba(61, 220, 151, .4); }
.swap { color: var(--dim); font-family: var(--mono); }

/* 区块 */
section.block { padding: 64px 0 24px; scroll-margin-top: 60px; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-head .num { font: 500 12px var(--mono); color: var(--orange); letter-spacing: .14em; }
.sec-head h2 { font-size: clamp(24px, 3vw, 36px); margin: 6px 0 0; letter-spacing: -.01em; line-height: 1.2; }
.sec-head p { margin: 0; color: var(--muted); max-width: 34em; font-size: 15px; }

/* 样板切换 */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-width: 0; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); border-radius: 12px; padding: 10px 14px; font: 500 14px var(--sans); cursor: pointer; text-align: left; display: grid; gap: 2px; }
.tab small { font: 500 11px var(--mono); color: var(--dim); }
.tab[aria-selected='true'] { color: var(--text); border-color: var(--blue); background: linear-gradient(180deg, rgba(79, 124, 255, .16), rgba(79, 124, 255, .04)); box-shadow: 0 0 0 1px rgba(79, 124, 255, .25) inset; }
.tab[aria-selected='true'] small { color: var(--blue-2); }

.sample-one { margin: 18px 0 16px; font-size: 17px; color: var(--text); }
.sample-one b { color: var(--blue-2); font-weight: 600; }

.studio { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.card-head h3 { margin: 0; font: 600 13px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.copy { border: 1px solid var(--line-2); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 12px; font: 500 13px var(--sans); cursor: pointer; white-space: nowrap; min-height: 34px; }
.copy:hover { border-color: var(--blue); }
.copy.done { border-color: var(--green); color: var(--green); }
.left-col { display: grid; gap: 14px; min-width: 0; }

/* 状态机 */
.flow { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; counter-reset: s; }
.flow li { position: relative; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px 10px 44px; background: rgba(255, 255, 255, .015); min-width: 0; }
.flow li::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; left: 10px; top: 10px; font: 600 12px/22px var(--mono); width: 26px; text-align: center; border-radius: 6px; background: rgba(79, 124, 255, .16); color: var(--blue-2); }
.flow li b { display: block; font-size: 14px; }
.flow li span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.flow li:nth-child(5)::before, .flow li:nth-child(6)::before { background: rgba(255, 138, 61, .16); color: var(--orange); }
.flow li:last-child { border-color: rgba(61, 220, 151, .5); }
.flow li:last-child::before { background: rgba(61, 220, 151, .16); color: var(--green); }
.flow-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 0 16px 14px; font-size: 12px; color: var(--muted); }
.flow-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

pre.code { margin: 0; padding: 14px 16px; overflow: auto; font-size: 12.5px; line-height: 1.6; color: #cdd5e3; tab-size: 2; white-space: pre; }
pre.tree { max-height: 330px; }
.viewer pre.code { height: 640px; }
.file-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.file-tabs::-webkit-scrollbar { display: none; }
.ftab { border: 0; background: transparent; color: var(--muted); font: 500 13px var(--mono); padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; min-height: 34px; }
.ftab[aria-selected='true'] { background: rgba(79, 124, 255, .16); color: var(--text); }
.tok-h { color: #fff; font-weight: 600; }
.tok-c { color: #6b7a90; }
.tok-s { color: #9ad7a8; }
.tok-k { color: var(--orange); }

/* 计算器 */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; }
.controls { padding: 18px; display: grid; gap: 22px; }
.ctl label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.ctl label output { font: 650 22px var(--mono); color: var(--text); white-space: nowrap; }
.ctl label output small, .kpi b small { font: 500 14px var(--sans); margin-left: 4px; color: var(--muted); }
.ctl small { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; }
input[type='range'] { width: 100%; margin: 10px 0 0; accent-color: var(--blue); height: 28px; }
.results { padding: 18px; display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(255, 255, 255, .015); min-width: 0; }
.kpi span { color: var(--muted); font-size: 13px; display: block; }
.kpi b { font: 650 clamp(24px, 3vw, 34px)/1.15 var(--mono); display: block; margin-top: 6px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi em { font-style: normal; color: var(--dim); font-size: 12px; display: block; line-height: 1.45; margin-top: 4px; }
.kpi.warn b { color: var(--orange); }
.kpi.good b { color: var(--green); }
.kpi.blue b { color: var(--blue-2); }
.day { display: grid; gap: 10px; }
.day-row { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.bar { height: 26px; border-radius: 7px; background: #141a24; display: flex; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; transition: width .25s ease; }
.bar .use { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.bar .night { background: repeating-linear-gradient(45deg, var(--green), var(--green) 6px, #2bb37a 6px, #2bb37a 12px); }
.bar .idle { background: repeating-linear-gradient(45deg, #2a1d17, #2a1d17 6px, #3a251a 6px, #3a251a 12px); }
.day-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-left: 124px; }
.day-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
details.formula { border-top: 1px dashed var(--line-2); padding-top: 12px; font-size: 13px; color: var(--muted); }
details.formula summary { cursor: pointer; color: var(--text); }
details.formula ul { margin: 8px 0 0; padding-left: 18px; }
details.formula code { color: var(--blue-2); }

/* 导流 */
.ctas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cta { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); text-decoration: none; transition: transform .15s, border-color .15s; min-width: 0; }
.cta:hover { transform: translateY(-2px); }
.cta .k { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.cta b { font-size: 20px; line-height: 1.3; }
.cta p { margin: 0; color: var(--muted); font-size: 14px; }
.cta .go { margin-top: auto; font-weight: 600; font-size: 14px; }
.cta.free { border-color: rgba(61, 220, 151, .45); }
.cta.free .k, .cta.free .go { color: var(--green); }
.cta.paid { border-color: rgba(255, 138, 61, .55); background: linear-gradient(180deg, rgba(255, 138, 61, .1), var(--panel) 60%); }
.cta.paid .k, .cta.paid .go { color: var(--orange); }
.cta.open { border-color: rgba(79, 124, 255, .55); }
.cta.open .k, .cta.open .go { color: var(--blue-2); }
.cta.open:hover { transform: none; }
.cta .links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.cta .links a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.cta .links a:hover { text-decoration: underline; }

footer { padding: 48px 0 40px; color: var(--dim); font-size: 12.5px; line-height: 1.7; }
footer .wrap { border-top: 1px solid var(--line); padding-top: 20px; }

/* 底栏 */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: rgba(6, 8, 12, .86); backdrop-filter: blur(16px); border-top: 1px solid var(--line-2); }
.dock .wrap { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; }
.dock a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 14px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14.5px; text-align: center; line-height: 1.3; border: 1px solid var(--line-2); }
.dock .a { background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .5); }
.dock .b { background: linear-gradient(90deg, #ff7a2a, #ff9d57); color: #170b03; border-color: transparent; box-shadow: 0 6px 24px rgba(255, 138, 61, .25); }
.dock .c { background: rgba(79, 124, 255, .14); border-color: rgba(79, 124, 255, .55); }
.dock .short { display: none; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 18px); transform: translateX(-50%) translateY(10px); opacity: 0; pointer-events: none; background: #e9edf4; color: #06080c; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; transition: .2s; z-index: 40; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  .tabs { display: flex; }
  .tab { flex: 0 0 auto; }
  .studio, .calc { grid-template-columns: 1fr; }
  .viewer pre.code { height: 480px; }
  .ctas { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  :root { --bar-h: 76px; }
  .wrap { width: calc(100% - 32px); }
  .nav { display: none; }
  .hero { padding: 40px 0 24px; }
  .principle { grid-template-columns: 1fr; }
  .principle .vs { border-inline: 0; border-block: 1px solid var(--line); padding: 6px; }
  .layer { grid-template-columns: 1fr; }
  .layer .name { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .chip { white-space: normal; }
  .flow { grid-template-columns: 1fr; padding: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 22px; }
  .day-row { grid-template-columns: 1fr; gap: 6px; }
  .day-legend { padding-left: 0; }
  .viewer pre.code { height: 420px; font-size: 12px; }
  .card-head { padding: 8px 8px 8px 12px; }
  .dock { padding-top: 10px; }
  .dock .wrap { grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; }
  .dock a { min-height: 50px; padding: 6px 6px; font-size: 13px; border-radius: 10px; }
  .dock .long { display: none; }
  .dock .short { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
  .dock .short b { font-size: 14px; white-space: nowrap; }
  .dock .short small { font-size: 10.5px; font-weight: 500; opacity: .8; white-space: nowrap; }
  .hero h1 { font-size: 26px; }
  .hero h1 br { display: block; }
  .principle .vs { padding: 4px; font-size: 14px; }
  .principle > div { padding: 14px 16px; }
  section.block { padding-top: 48px; }
}
