/* Gox 官网样式 —— 无框架、无外部字体,系统字体栈 + 终端风深色主题 */

:root {
  --bg: #0b0f14;
  --bg-soft: #10161e;
  --bg-card: #131b24;
  --border: #1f2b37;
  --border-strong: #2b3c4c;
  --text: #dbe4ee;
  --text-dim: #8fa1b5;
  --text-faint: #64778c;
  --accent: #4ade9c;
  --accent-dim: #2ea97a;
  --accent-soft: rgba(74, 222, 156, 0.12);
  --blue: #6cb2ff;
  --purple: #c3a6ff;
  --yellow: #e8c579;
  --red: #ff8f8f;
  --cyan: #6cd9e5;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --content-w: 1160px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(74, 222, 156, 0.3); }

.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 顶部导航 ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  letter-spacing: 0.5px;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #2b8f68 100%);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  color: #06251a;
}

.brand .ver {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 1px 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

.nav-links .btn {
  color: #06251a;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.nav-links .btn:hover { background: #63e8ab; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 18px;
  padding: 4px 12px;
  cursor: pointer;
}

/* ===== Hero ===== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 320px at 50% -60px, rgba(74, 222, 156, 0.13), transparent 70%),
    radial-gradient(500px 300px at 82% 30%, rgba(108, 178, 255, 0.07), transparent 70%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 156, 0.35);
  border-radius: 99px;
  padding: 5px 14px;
  margin-bottom: 26px;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -1px;
}

.hero h1 .accent { color: var(--accent); }

.hero .tagline {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 34px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn {
  display: inline-block;
  border-radius: 10px;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06251a;
}
.btn-primary:hover { background: #63e8ab; }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-dim); color: var(--accent); }

/* 终端窗口 */
.terminal {
  max-width: 680px;
  margin: 0 auto;
  background: #0a0e13;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  text-align: left;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.terminal-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }

.terminal-bar span {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.terminal-body {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  padding: 18px 22px;
  overflow-x: auto;
  white-space: pre;
}

.terminal-body .prompt { color: var(--accent); font-weight: 700; }
.terminal-body .out { color: var(--text-dim); }
.terminal-body .caret {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== 统计条 ===== */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-cell {
  background: var(--bg);
  text-align: center;
  padding: 26px 12px;
}

.stat-cell b {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}

.stat-cell span {
  font-size: 13px;
  color: var(--text-faint);
}

/* ===== 通用区块 ===== */

.section { padding: 76px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 {
  font-size: 32px;
  margin: 0 0 12px;
  font-weight: 750;
  letter-spacing: -0.5px;
}
.section-head p { color: var(--text-dim); margin: 0; max-width: 620px; margin-inline: auto; }

/* 特性卡片 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }

.feature-card .icon {
  font-size: 24px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border-radius: 10px;
  margin-bottom: 14px;
}

.feature-card h3 { margin: 0 0 8px; font-size: 16.5px; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.7; }

/* 双栏代码展示 */
.code-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.code-panel {
  background: #0a0e13;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
}

.code-panel .panel-title {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-panel pre { margin: 0; }

/* ===== 代码块 ===== */

pre.code {
  position: relative;
  background: #0a0e13;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

pre.code code {
  font-family: var(--mono);
  color: #c9d6e4;
  white-space: pre;
  display: block;
  min-width: fit-content;
}

code.inline {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 156, 0.2);
  color: var(--accent);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
pre.code:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy-btn.done { color: var(--accent); opacity: 1; }

/* 语法高亮 token */
.tk-cmt { color: #5c7086; font-style: italic; }
.tk-str { color: #a8d98b; }
.tk-num { color: var(--yellow); }
.tk-kw  { color: var(--purple); }
.tk-lit { color: var(--red); }
.tk-blt { color: var(--blue); }
.tk-tag { color: var(--cyan); }
.tk-fn  { color: #7fd8f5; }

/* ===== 架构流水线 ===== */

.pipeline {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pipe-node {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 175px;
  text-align: center;
}

.pipe-node b {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
}

.pipe-node span { font-size: 12.5px; color: var(--text-dim); }

.pipe-arrow {
  align-self: center;
  color: var(--text-faint);
  font-size: 20px;
  padding: 0 12px;
}

.arch-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 34px;
}

.arch-note {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px 20px;
}
.arch-note h4 { margin: 0 0 6px; font-size: 15px; }
.arch-note p { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ===== CTA ===== */

.cta {
  text-align: center;
  padding: 80px 0;
}

.cta h2 { font-size: 30px; margin: 0 0 12px; }
.cta p { color: var(--text-dim); margin: 0 0 28px; }

/* ===== 页脚 ===== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--text-faint);
  font-size: 13.5px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-row .links { display: flex; gap: 20px; }
.footer-row a { color: var(--text-dim); }

/* =========================================================
   教程页布局
   ========================================================= */

.guide-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  padding: 44px 0 90px;
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  font-size: 13.5px;
  padding-right: 6px;
}

.toc-title {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.toc a {
  display: block;
  color: var(--text-dim);
  padding: 5px 12px;
  border-left: 2px solid var(--border);
  border-radius: 0;
  line-height: 1.5;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.doc { min-width: 0; }

.doc h2 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 64px 0 18px;
  padding-top: 10px;
}
.doc h2:first-child { margin-top: 0; }
.doc h2 .anchor { color: transparent; font-weight: 400; margin-left: 8px; font-size: 0.75em; }
.doc h2:hover .anchor { color: var(--text-faint); }

.doc h3 {
  font-size: 19px;
  margin: 34px 0 12px;
}

.doc p { color: #c2cfdd; }

.doc ul, .doc ol { color: #c2cfdd; padding-left: 26px; }
.doc li { margin: 5px 0; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 18px 0;
}
.doc th, .doc td {
  border: 1px solid var(--border-strong);
  padding: 9px 13px;
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--bg-card); color: var(--text); white-space: nowrap; }
.doc td { color: var(--text-dim); }
.doc td code, .doc th code { white-space: nowrap; }

/* 提示框 */
.callout {
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14.5px;
  line-height: 1.7;
}
.callout b { display: block; margin-bottom: 4px; font-size: 13.5px; }
.callout p { margin: 0; }
.callout.tip    { border-left: 3px solid var(--accent); background: rgba(74, 222, 156, 0.06); }
.callout.tip b { color: var(--accent); }
.callout.note   { border-left: 3px solid var(--blue); background: rgba(108, 178, 255, 0.06); }
.callout.note b { color: var(--blue); }
.callout.warn   { border-left: 3px solid var(--yellow); background: rgba(232, 197, 121, 0.06); }
.callout.warn b { color: var(--yellow); }

/* 教程页头 */
.guide-hero { border-bottom: 1px solid var(--border); padding: 52px 0 0; }
.guide-hero h1 { font-size: 36px; margin: 0 0 10px; letter-spacing: -0.6px; }
.guide-hero .sub { color: var(--text-dim); font-size: 16.5px; margin: 0; }

.breadcrumb { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }

/* 步骤编号 */
.step-num {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 156, 0.35);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-right: 10px;
  vertical-align: -6px;
}

/* 上一页/下一页 */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 70px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
}
.pager a {
  display: block;
  max-width: 48%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 20px;
  transition: border-color 0.15s;
}
.pager a:hover { text-decoration: none; border-color: var(--accent-dim); }
.pager .dir { font-size: 12px; color: var(--text-faint); display: block; margin-bottom: 3px; }
.pager .title { font-weight: 600; font-size: 15px; color: var(--text); }
.pager .next { margin-left: auto; text-align: right; }

/* =========================================================
   组件参考页
   ========================================================= */

/* 组件的二级目录:在左栏 toc 里缩进一层 */
.toc .toc-sub {
  padding-left: 24px;
  font-size: 13px;
  color: var(--text-faint);
}

/* 分类小标题 */
.doc .cat {
  margin: 52px 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-faint);
}

/* 单个组件的头部:标签名 + 徽章 */
.comp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.comp-head h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  color: var(--text-faint);
  white-space: nowrap;
}
.badge.ok     { color: var(--accent); border-color: rgba(74, 222, 156, 0.4);  background: var(--accent-soft); }
.badge.win    { color: var(--blue);   border-color: rgba(108, 178, 255, 0.4); background: rgba(108, 178, 255, 0.1); }
.badge.ctrl   { color: var(--purple); border-color: rgba(195, 166, 255, 0.4); }
.badge.layer  { color: var(--cyan);   border-color: rgba(108, 217, 229, 0.4); }

/* 组件说明的引导句 */
.doc .comp-lead {
  color: var(--text-dim);
  margin: 6px 0 0;
}

/* 属性表:第一列是 prop 名,固定窄一点 */
.doc table.props td:first-child {
  white-space: nowrap;
  color: var(--text);
}
.doc table.props code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cyan);
  background: none;
  border: none;
  padding: 0;
}
.doc table.props td:nth-child(2) {
  white-space: nowrap;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* 「必需」标记 */
.req { color: var(--red); font-size: 11px; margin-left: 4px; }

/* 组件之间的分隔 */
.doc .comp-div {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 44px 0 0;
}

/* 限制清单 */
.limits {
  border-left: 3px solid var(--border-strong);
  padding: 2px 0 2px 16px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--text-faint);
}
.limits li { margin: 3px 0; }

/* 内联代码在提示里不要换行挤坏版面 */
.callout code.inline { white-space: normal; }

/* ===== 响应式 ===== */

@media (max-width: 1000px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .code-duo { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .guide-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .arch-notes { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .features-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .pipe-arrow { display: none; }
  .pipeline { gap: 12px; }
  .hero { padding: 68px 0 60px; }
  .section { padding: 56px 0; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px 20px;
    gap: 4px;
    margin: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 4px; }
  .nav-links .btn { text-align: center; margin-top: 8px; }
}
