:root {
  --bg: #F6F3EA;
  --panel: #FFFFFF;
  --ink: #3B3430;
  --muted: #8B8078;
  --line: #E4DCD0;
  --board: #BBADA0;
  --accent: #8F7A66;
  --gold: #EDC22E;
  --code-bg: #241F1C;
  --code-ink: #F2EDE6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }

/* ---------- hero ---------- */

.hero {
  background:
    radial-gradient(1100px 460px at 88% -8%, rgba(237, 194, 46, 0.30), transparent 62%),
    radial-gradient(760px 380px at 4% 6%, rgba(143, 122, 102, 0.16), transparent 60%),
    #FBF9F3;
  border-bottom: 1px solid var(--line);
  padding: 56px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #6E645C;
}

.lede { margin: 0 0 22px; max-width: 56ch; font-size: 16px; color: #5C534D; }
.lede strong { color: var(--ink); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: #5C534D;
  white-space: nowrap;
}

.badge b { color: var(--ink); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(80, 62, 48, 0.13); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.tiny { padding: 7px 14px; font-size: 13px; }

/* ---------- phone ---------- */

.phone-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.phone {
  width: 372px;
  padding: 12px;
  border-radius: 42px;
  background: linear-gradient(160deg, #4A423C, #2A2522);
  box-shadow: 0 26px 60px rgba(60, 44, 32, 0.30), inset 0 0 0 2px rgba(255, 255, 255, 0.07);
}

.screen {
  position: relative;
  height: 660px;
  border-radius: 31px;
  background: #FAF8EF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.statusbar {
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-size: 11px;
  font-weight: 600;
  color: #6E645C;
}

.statusbar .dots { letter-spacing: 1px; }

.app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 14px 14px;
}

.app-header { display: flex; align-items: flex-start; gap: 8px; flex: none; }

.app-title { flex: 1; min-width: 0; }

.app-title h2 {
  margin: 0;
  font-size: 31px;
  line-height: 1.1;
  font-weight: 800;
  color: #776E65;
}

.app-title p { margin: 1px 0 0; font-size: 11px; color: #9C8E82; }

.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--board);
  line-height: 1.25;
}

.score-box .label { font-size: 10px; color: #EEE4DA; }
.score-box .value { font-size: 19px; font-weight: 800; color: #fff; }

.score-box.pop .value { animation: pop 0.22s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.app-btn {
  flex: none;
  margin-top: 11px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.app-btn:active { background: #7C6957; }

.board-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 11px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#board { display: block; touch-action: none; cursor: grab; }
#board:active { cursor: grabbing; }

.phone-hint { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 340px; }
.phone-hint kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

/* ---------- sections ---------- */

section { padding: 62px 0; }
section + section { border-top: 1px solid var(--line); }

.sec-head { margin-bottom: 30px; }

.sec-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: #5C534D;
}

.sec-head p { margin: 0; max-width: 74ch; color: var(--muted); }

/* pipeline */

.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; }

.step {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.step .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}

.step h3 { margin: 0 0 5px; font-size: 15px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }
.step code { font-size: 12px; }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.step code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #F1EBE0;
  color: #6E5B49;
}

/* facts */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 22px; }

.fact {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-size: 19px; font-weight: 800; color: #4A423C; letter-spacing: -0.01em; }
.fact .s { font-size: 12px; color: var(--muted); }

/* source browser */

.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }

.tab {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #5C534D;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  cursor: pointer;
}

.tab:hover { border-color: #CFC4B6; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.code-shell {
  position: relative;
  border-radius: 13px;
  background: var(--code-bg);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12.5px;
  color: #B8ADA2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.code-bar .meta { color: #8B8078; }

.code-body {
  display: flex;
  align-items: stretch;
  max-height: 560px;
  overflow: auto;
}

.gutter {
  position: sticky;
  left: 0;
  flex: none;
  padding: 17px 12px 17px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #1E1A17;
  color: #6B625B;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.6px;
  line-height: 1.62;
  text-align: right;
  white-space: pre;
  user-select: none;
}

pre.code {
  margin: 0;
  padding: 17px 18px;
  flex: 1;
  min-width: 0;
  font-size: 12.6px;
  line-height: 1.62;
  color: var(--code-ink);
  tab-size: 4;
  white-space: pre;
}

.code-body::-webkit-scrollbar { width: 11px; height: 11px; }
.code-body::-webkit-scrollbar-thumb { background: #4A423C; border-radius: 6px; }
.code-body::-webkit-scrollbar-track { background: #2E2825; }

.tok-c { color: #7E8C7A; font-style: italic; }
.tok-s { color: #E8C07D; }
.tok-k { color: #E48A6F; }
.tok-n { color: #9CC5E8; }
.tok-t { color: #E48A6F; }
.tok-a { color: #B7D9A0; }

/* install */

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }

.card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.card h3 { margin: 0 0 10px; font-size: 17px; }
.card ol, .card ul { margin: 0; padding-left: 20px; font-size: 14px; color: #5C534D; }
.card li { margin-bottom: 6px; }

.note {
  margin-top: 16px;
  padding: 13px 16px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #FDF7E3;
  font-size: 13.5px;
  color: #6E5B36;
}

.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

.log {
  margin: 16px 0 0;
  padding: 15px 17px;
  max-height: 320px;
  overflow: auto;
  border-radius: 11px;
  background: var(--code-bg);
  color: #C9E8C0;
  font-size: 12.2px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

footer {
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .phone-col { order: -1; }
  .phone { width: min(372px, 100%); }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 26px); }
  .phone { padding: 9px; border-radius: 34px; }
  .screen { height: 600px; border-radius: 26px; }
}
