:root {
  --bg: #0b0e14;
  --bg2: #10141d;
  --panel: #141a26;
  --line: #222b3a;
  --text: #e8ecf3;
  --muted: #8b96a8;
  --accent: #5b8cff;
  --accent2: #7c5bff;
  --good: #3fce7c;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #16203a 0%, var(--bg) 55%) var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
code {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  color: #9fc6ff;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  font-size: 18px;
}
.brand b { font-size: 15px; }
.brand .ver {
  display: inline-block;
  margin-left: 6px;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
}

.nav nav { display: flex; gap: 18px; }
.nav nav a { color: var(--muted); font-size: 14px; }
.nav nav a:hover, .nav nav a.on { color: var(--text); }
.nav-cta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 20px 40px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2), #c99bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub { color: var(--muted); max-width: 46ch; margin-bottom: 28px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }

.btn {
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 24px rgba(91, 140, 255, 0.35);
}
.btn.primary:hover { box-shadow: 0 8px 30px rgba(91, 140, 255, 0.5); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.btn.ghost:hover { border-color: var(--accent); }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-row span {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 20px;
}

/* ---------- Monitor mockup ---------- */
.stage { display: grid; place-items: center; }

.monitor {
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.monitor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.monitor-bar em { font-style: normal; margin-left: 8px; font-size: 12px; color: var(--muted); }
.traffic { width: 10px; height: 10px; border-radius: 50%; }
.traffic.r { background: #ff5f57; }
.traffic.y { background: #febc2e; }
.traffic.g { background: #28c840; }

.monitor-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  height: 260px;
}

.preview {
  background: linear-gradient(180deg, #1a2233, #141b29);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: 14px;
}

.phone {
  width: 74px;
  height: 150px;
  border: 6px solid #0a0d13;
  border-radius: 18px;
  background: linear-gradient(200deg, #fdf3e3, #f3d9b8);
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}
.phone i {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 4px;
  background: #caa06b;
  border-radius: 4px;
}
.hero-phone { padding: 14px 6px 6px; }
.hero-phone b { font-size: 8px; color: #7b4b2a; display: block; text-align: center; margin-bottom: 8px; }
.hero-phone .card {
  height: 38px;
  border-radius: 8px;
  background: #fff8ec;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.lap { width: 150px; }
.lap-screen {
  background: #111827;
  border: 3px solid #6b7280;
  border-radius: 8px 8px 0 0;
  padding: 10px;
  height: 120px;
}
.lap::after {
  content: "";
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(#8b93a3, #6b7280);
}
.line { height: 6px; border-radius: 4px; background: #2b3750; margin-bottom: 8px; }
.line.w90 { width: 90%; }
.line.w70 { width: 70%; }
.box-row { display: flex; gap: 6px; margin-top: 10px; }
.box { flex: 1; height: 26px; border-radius: 5px; background: linear-gradient(160deg, #5b8cff, #7c5bff); }

.editor {
  background: #0e1420;
  border-left: 1px solid var(--line);
  padding: 16px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-line { color: #a9b7cf; }
.c-tag { color: #7c9bdb; }
.editor::after {
  content: "agent 寫程式…";
  color: var(--good);
  font-size: 11px;
}

.monitor-stand {
  width: 60%;
  margin: 0 auto;
  height: 18px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#20293a, #141a26);
}

/* ---------- Sections ---------- */
.section { padding: 72px 20px; }
.section.alt { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sec-title {
  text-align: center;
  font-size: clamp(24px, 3.4vw, 34px);
  margin-bottom: 44px;
  letter-spacing: 0.5px;
}

.grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.card .ico { font-size: 26px; display: inline-block; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }

/* ---------- Steps ---------- */
.steps {
  max-width: 760px;
  margin: 0 auto;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px 20px 84px;
  position: relative;
}
.steps li b { font-size: 16px; color: var(--text); }
.steps li p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.steps li b::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 24px; top: 20px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.quote {
  max-width: 760px;
  margin: 36px auto 0;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
}
.quote p { font-style: italic; color: var(--text); }
.quote span { font-size: 12px; color: var(--muted); }

/* ---------- API ---------- */
.api-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.api-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.api-block h3 { font-size: 16px; margin-bottom: 12px; }
.api-block p { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.api-block ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.api-block li { font-size: 14px; color: var(--muted); }
.api-block li b { color: var(--text); }
.tag {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 20px;
  padding: 1px 9px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- Changelog page ---------- */
main.narrow { max-width: 860px; margin: 0 auto; padding: 56px 20px; }

.chlog-head h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 10px; }
.chlog-head p { color: var(--muted); margin-bottom: 30px; }
.badge-ver {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

.version-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
}
.version-block.current { border-color: color-mix(in srgb, var(--good) 60%, var(--line)); }

.ver-tag {
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
}
.ver-date { font-style: normal; font-size: 12px; color: var(--muted); display: block; margin-top: 6px; }
.pill {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  color: #05230f;
  background: var(--good);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}
.version-block h2 { font-size: 19px; margin-bottom: 12px; }
.version-block ul { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.version-block li { font-size: 14px; color: var(--muted); }
.version-block li b { color: var(--text); }

.back { margin-top: 30px; font-size: 14px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: var(--bg2);
}
.foot-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot-inner b { font-size: 15px; }
.foot-inner p { color: var(--muted); font-size: 13px; }
.foot-inner nav { display: flex; gap: 16px; font-size: 14px; }
.foot-note { width: 100%; text-align: center; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .api-grid { grid-template-columns: 1fr; }
  .version-block { grid-template-columns: 1fr; }
  .nav nav { display: none; }
}