:root {
  --bg: #0a0f1e;
  --bg-alt: #0d1426;
  --surface: #121a30;
  --surface-2: #172140;
  --border: #26304f;
  --border-soft: #1c2540;
  --text: #e8ebf7;
  --muted: #9aa4c0;
  --indigo: #6366f1;
  --indigo-strong: #4f46e5;
  --indigo-soft: #818cf8;
  --indigo-deep: #312e81;
  --green: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --shadow: 0 20px 50px -20px rgba(2, 6, 23, 0.8);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* ---------- i18n ---------- */
html[data-lang="zh"] [data-en] { display: none !important; }
html[data-lang="en"] [data-zh] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: rgba(99, 102, 241, .14);
  color: #c7d2fe;
  padding: .12em .42em;
  border-radius: 6px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-weight: 600;
  font-size: .95rem;
  padding: .72em 1.35em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo-soft), var(--indigo-strong));
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(99, 102, 241, .9);
}
.btn-outline { border-color: var(--border); color: var(--text); background: rgba(255,255,255,.02); }
.btn-outline:hover { border-color: var(--indigo); }
.btn-ghost { color: var(--text); background: transparent; border-color: var(--border-soft); padding: .5em 1em; }
.btn-ghost:hover { border-color: var(--indigo); }
.btn-sm { padding: .5em 1em; font-size: .85rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 15, 30, .78);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; gap: 16px; height: 66px; flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; flex-shrink: 0; }
.brand-mark { width: 34px; height: 27px; }
.brand-text strong { color: var(--indigo-soft); font-weight: 800; }
/* 英文标签比中文长一截（8 项 ≈723px vs 565px），这里用 flex:1 + 溢出滚动兜底，
   保证极端情况下是「可横滑」而不是把品牌/语言切换挤变形 */
.nav-links {
  display: flex; gap: 17px; margin-left: 6px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); font-size: .9rem; font-weight: 500; transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lang-switch {
  font-family: var(--font);
  font-size: .85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: .42em .8em;
  cursor: pointer;
}
.lang-switch .lang-sep { opacity: .45; margin: 0 4px; }
html[data-lang="zh"] .lang-zh-label { color: var(--indigo-soft); font-weight: 700; }
html[data-lang="en"] .lang-en-label { color: var(--indigo-soft); font-weight: 700; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 78px 0 40px; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(600px 340px at 78% -8%, rgba(99,102,241,.38), transparent 70%),
    radial-gradient(520px 320px at 6% 12%, rgba(129,140,248,.18), transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .83rem; color: #c7d2fe;
  border: 1px solid var(--border); border-radius: 999px;
  padding: .4em .9em; margin-bottom: 22px;
  background: rgba(99,102,241,.08);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.01em; }
.hero h1 span[data-zh], .hero h1 span[data-en] { display: block; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 560px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-release { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.hero-release a { color: var(--green); text-decoration: none; }
.hero-release a:hover { text-decoration: underline; }
.hero-release strong { color: var(--text); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-tags span {
  font-size: .78rem; color: var(--muted);
  border: 1px solid var(--border-soft); border-radius: 999px; padding: .32em .78em;
}

/* terminal mock */
.mock {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, #0f1730, #0b1224);
  box-shadow: var(--shadow); overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
.mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3654; }
.mock-bar i:nth-child(1) { background: #ff5f57; }
.mock-bar i:nth-child(2) { background: #febc2e; }
.mock-bar i:nth-child(3) { background: #28c840; }
.mock-title { margin-left: 10px; color: var(--muted); font-size: .8rem; font-family: var(--mono); }
.mock-body { margin: 0; padding: 18px; font-family: var(--mono); font-size: .82rem; line-height: 1.75; overflow-x: auto; }
.mock-body code { background: none; padding: 0; color: #cbd5ff; }
.c-comment { color: #5b6b93; }
.c-prompt { color: var(--green); }
.c-ok { color: var(--green); }
.c-str { color: #fdba74; }
.c-ai { color: var(--indigo-soft); }

/* stats */
.stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 54px; padding: 26px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: rgba(18, 26, 48, .55);
}
.stat { text-align: center; }
.stat b { display: block; font-size: 1.9rem; color: #fff; }
.stat span { color: var(--muted); font-size: .86rem; }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.section-head { max-width: 760px; margin: 0 auto 46px; text-align: center; }
.section-head p { color: var(--muted); }
.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--indigo-soft); margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }

/* grids & cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.gap-lg { gap: 20px; }
.gap-top { margin-top: 34px; }
.card {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), #0e1730);
  padding: 26px;
  transition: transform .18s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--indigo); }
.card h3 { font-size: 1.08rem; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: rgba(99,102,241,.14); color: var(--indigo-soft);
  border: 1px solid rgba(99,102,241,.28);
}
.card-icon svg { width: 22px; height: 22px; }

/* ---------- pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.step {
  position: relative; padding: 22px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, #101a34, #0b1224);
}
.step-no { font-family: var(--mono); font-size: .8rem; color: var(--indigo-soft); }
.step h4 { margin: 10px 0 4px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- open api / gateway ---------- */
.openapi-flow { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: start; margin-top: 26px; }
.openapi-code pre { margin: 0; }
.openapi-aside {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); padding: 24px;
}
.openapi-aside h3 { font-size: 1.05rem; margin-bottom: 14px; }
.openapi-aside p { margin: 16px 0 0; }

.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 34px; }
.ai-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); padding: 26px;
}
.ai-card h3 { font-size: 1.1rem; }
.ai-card p { color: var(--muted); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: .8rem; color: #c7d2fe; border: 1px solid var(--border);
  border-radius: 999px; padding: .3em .8em; background: rgba(99,102,241,.08);
}
.code-card pre.code, pre.code {
  margin: 0 0 12px;
  background: #0a1120; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 16px;
  font-family: var(--mono); font-size: .82rem; line-height: 1.7;
  overflow-x: auto; color: #cbd5ff;
}
pre.code code { background: none; padding: 0; }
.muted { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }
.gap-top { margin-top: 22px; }

/* ---------- architecture ---------- */
.arch { max-width: 760px; margin: 0 auto; text-align: center; }
.arch-row { display: flex; justify-content: center; }
.arch-node {
  width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 16px 20px;
}
.arch-node b { display: block; font-size: 1.05rem; margin-bottom: 3px; }
.arch-node span { color: var(--muted); font-size: .85rem; }
.arch-node.accent { border-color: var(--indigo); background: rgba(99,102,241,.1); }
.arch-arrow { color: var(--indigo-soft); padding: 10px 0; font-family: var(--mono); font-size: .85rem; }
.arch-node.accent span[data-zh], .arch-node.accent span[data-en] { display: block; }

/* 底座：一排药丸标签，自动换行 */
.arch-bases { flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.arch-base {
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); padding: 7px 16px;
  font-family: var(--mono); font-size: .82rem; color: var(--text);
  white-space: nowrap;
}
.arch-base:hover { border-color: var(--indigo); color: var(--indigo-soft); }

/* ---------- quick start ---------- */
.start-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: start; }
.start-info { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border-soft); font-size: .9rem; }
.info-row:last-of-type { border-bottom: none; }
.info-row span { color: var(--muted); }
.info-row code { font-size: .82rem; }

/* ---------- database config ---------- */
.db-config {
  margin-top: 26px; padding: 26px 28px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface);
}
.db-config-head h3 { font-size: 1.1rem; margin-bottom: 8px; }
.db-config-head p { color: var(--muted); font-size: .9rem; margin: 0; }
.db-config-head code { font-size: .84rem; }
.db-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; align-items: start; }
.db-config-grid pre { margin: 0; }
.db-config-note p { font-size: .88rem; line-height: 1.75; color: var(--muted); }
.db-config-note p + p { margin-top: 12px; }
.db-config-note strong { color: var(--text); }
.db-config-note code { font-size: .82rem; }

/* ---------- ecosystem ---------- */
.eco {
  display: block;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); padding: 24px;
  transition: border-color .15s, transform .15s;
}
.eco:hover { border-color: var(--indigo); transform: translateY(-2px); }
.eco-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.eco-head h3 { margin: 0; font-size: 1.12rem; }
.eco p { margin: 0; color: var(--muted); font-size: .92rem; }
.tag {
  font-size: .72rem; font-family: var(--mono); color: #c7d2fe;
  border: 1px solid var(--border); border-radius: 999px; padding: .2em .7em;
  background: rgba(99,102,241,.1);
}

/* ---------- repository ---------- */
.repo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.repo-col {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); padding: 26px;
}
.repo-col h3 { font-size: 1.1rem; }
ul.check { list-style: none; margin: 0; padding: 0; }
ul.check li {
  position: relative; padding: 7px 0 7px 28px; color: var(--muted); font-size: .92rem;
}
ul.check li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(52, 211, 153, .16);
  border: 1px solid rgba(52, 211, 153, .5);
}
ul.check li::after {
  content: ""; position: absolute; left: 4.5px; top: 17px;
  width: 6px; height: 3px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}
.badge {
  display: inline-block; font-size: .85rem; color: #c7d2fe;
  border: 1px dashed var(--indigo); border-radius: 999px; padding: .5em 1.1em;
  background: rgba(99,102,241,.08);
}

/* ---------- editions ---------- */
.editions { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.edition {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); padding: 28px;
}
.edition h3 { font-size: 1.15rem; }
.price { color: var(--indigo-soft); font-weight: 600; font-size: .9rem; }
.plan-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.plan-cta .btn { text-decoration: none; }
.plan { position: relative; }
.plan.pro { border-color: var(--indigo); background: linear-gradient(180deg, rgba(99,102,241,.12), var(--surface)); }
.plan-badge {
  position: absolute; top: 18px; right: 20px;
  font-size: .74rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--indigo-soft), var(--indigo-strong));
  border-radius: 999px; padding: .28em .8em;
}

/* ---------- footer ---------- */
.footer { background: #070b16; border-top: 1px solid var(--border-soft); padding: 54px 0 26px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; }
.footer-logo { width: 190px; height: auto; margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 320px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-links h5 { color: var(--text); font-size: .9rem; margin-bottom: 12px; }
.footer-links a { display: block; color: var(--muted); font-size: .9rem; padding: 4px 0; }
.footer-links a:hover { color: var(--indigo-soft); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  color: var(--muted); font-size: .84rem;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero-visual { order: -1; }
  /* 窄屏不隐藏导航：另起一行，横向可滑动 */
  .nav-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 6px; }
  .nav-links {
    order: 3; width: 100%; margin-left: 0; gap: 16px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .pipeline { grid-template-columns: 1fr 1fr; }
  .start-grid, .ai-grid, .footer-inner, .openapi-flow, .db-config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .section { padding: 60px 0; }
  .grid-3, .grid-2, .pipeline, .repo-grid, .editions, .db-config-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; padding: 20px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

/* ---------- video tutorials ---------- */
.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.video-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}
.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-meta { padding: 16px 4px 0; }
.video-ep {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--indigo-soft);
}
.video-meta h3 { margin: .3em 0 .25em; font-size: 1.15rem; }
.video-meta p { margin: 0; color: var(--muted); font-size: .9rem; }
.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-item {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.video-item:hover { transform: translateY(-1px); border-color: var(--indigo); }
.video-item.is-active { border-color: var(--indigo); background: var(--surface-2); }
.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #fff;
  background: rgba(2, 6, 23, .22);
}
.video-info { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.video-t { font-size: .9rem; font-weight: 600; line-height: 1.35; }
.video-d { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .video-layout { grid-template-columns: 1fr; gap: 22px; }
  .video-item { grid-template-columns: 108px 1fr; }
}

/* ---------- video external links ---------- */
.video-external {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
