/* ============================================================
   Aero Web Playground — 共享样式（橙+淡蓝+翠绿 纯色版）
   极简 · 克制 · 无红无紫 + 粘性页脚 + 微交互动效
   ============================================================ */

:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel2: #fafafc;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-faint: #8e8e93;
  --accent: #1d1d1f;
  --accent-2: #3a3a3c;
  --accent-soft: rgba(0, 0, 0, 0.05);
  --code-bg: #f7f7f9;
  --code-text: #1d1d1f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  --mono: "SFMono-Regular", Consolas, "JetBrains Mono", Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0a0a0c;
  --panel: #1c1c1e;
  --panel2: #2c2c2e;
  --border: #3a3a3c;
  --text: #f5f5f7;
  --text-soft: #aeaeb2;
  --text-faint: #8e8e93;
  --accent: #ffffff;
  --accent-2: #d2d2d7;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --code-bg: #0d0d0f;
  --code-text: #e5e5ea;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

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

/* ---------- 核心：粘性页脚 ---------- */
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
a:hover { border-bottom-color: var(--text); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 56px; padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .logo {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: #1d1d1f;
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: -1px;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 6px 14px; border-radius: 8px; color: var(--text-soft);
  font-size: 14px; font-weight: 500; border-bottom: none;
  position: relative;
  transition: color 0.2s ease;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--text);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateX(-50%);
  border-radius: 2px;
}
.nav a:hover::after,
.nav a.active::after {
  width: 60%;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--panel); color: var(--text-soft);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.icon-btn:hover { background: var(--panel2); color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------- 容器 ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 28px 80px;
  flex: 1;
  width: 100%;
}
.container.wide { max-width: 1280px; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 56px 0 40px; animation: fadeUp 0.8s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
  font-size: 13px; font-weight: 600; border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.hero .badge:hover { border-color: var(--text-soft); transform: scale(1.02); }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; margin: 18px 0 12px; color: var(--text); }
.hero h1 .grad {
  background: none;
  color: var(--text);
  -webkit-background-clip: unset; background-clip: unset;
}
.hero .tagline { font-size: 18px; color: var(--text-soft); max-width: 640px; margin: 0 auto; }
.actions { display: flex; justify-content: center; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* ---------- 按钮：全屏动效 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 26px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.btn:hover::before { opacity: 1; }
.btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.btn:active { transform: scale(0.96); }
.btn svg { width: 17px; height: 17px; transition: transform 0.3s ease; }
.btn:hover svg { transform: scale(1.1) rotate(-3deg); }
.btn.primary {
  background: #1d1d1f; color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: #1d1d1f;
}
.btn.primary:hover { background: #3a3a3c; border-color: #3a3a3c; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25); }
.btn.secondary { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--text); color: var(--text); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06); }
.btn.ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--text); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04); }

/* ---------- 特性网格 ---------- */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px;
}
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: fadeUp 0.6s ease backwards;
}
.feature:nth-child(1) { animation-delay: 0.05s; }
.feature:nth-child(2) { animation-delay: 0.15s; }
.feature:nth-child(3) { animation-delay: 0.25s; }
.feature:hover {
  transform: translateY(-6px) scale(1.005);
  border-color: var(--text-soft);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}
.feature .ic {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; background: var(--accent-soft); color: var(--text);
  margin-bottom: 14px; border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.feature:hover .ic {
  transform: scale(1.05) rotate(-2deg);
  border-color: var(--text-soft);
}
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--text-soft); }

/* ---------- 免责横幅 ---------- */
.disclaimer {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 48px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); font-size: 13.5px; color: var(--text-soft);
  transition: all 0.3s ease;
}
.disclaimer:hover { border-color: var(--text-soft); box-shadow: 0 8px 24px rgba(0,0,0,0.04); }
.disclaimer svg { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; margin-top: 2px; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 26px 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  flex-shrink: 0;
}
.footer .links { display: flex; justify-content: center; gap: 24px; margin-bottom: 10px; }
.footer .links a { color: var(--text-soft); border-bottom: none; transition: color 0.2s ease; }
.footer .links a:hover { color: var(--text); }

/* ---------- 文档 ---------- */
.docs h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; animation: fadeUp 0.6s ease; }
.docs .sub { color: var(--text-soft); margin-bottom: 34px; }
.doc-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 30px; margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: fadeUp 0.6s ease backwards;
}
.doc-card:nth-child(1) { animation-delay: 0.05s; }
.doc-card:nth-child(2) { animation-delay: 0.15s; }
.doc-card:nth-child(3) { animation-delay: 0.25s; }
.doc-card:nth-child(4) { animation-delay: 0.35s; }
.doc-card:nth-child(5) { animation-delay: 0.45s; }
.doc-card:hover {
  border-color: var(--text-soft);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}
.doc-card h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.doc-card h2 .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #1d1d1f;
  transition: all 0.3s ease;
}
.doc-card:hover h2 .dot {
  transform: scale(1.3);
}
.doc-card p { font-size: 14.5px; color: var(--text-soft); margin-bottom: 14px; }
.doc-card h4 { font-size: 14px; margin: 18px 0 8px; }
code.inline {
  font-family: var(--mono); font-size: 0.9em; padding: 2px 6px;
  background: var(--accent-soft); color: var(--text); border-radius: 6px;
}

/* ===== 代码高亮：纯橙 + 淡蓝 + 翠绿（无红无紫） ===== */
.doc-card pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
}
.doc-card pre .c { color: #008000; font-style: italic; }        /* 注释：VS 绿 */
.doc-card pre .k { color: #0000ff; font-weight: bold; }         /* 关键字：VS 蓝 */
.doc-card pre .s { color: #a31515; }                            /* 字符串：VS 橙红 */
.doc-card pre .n { color: #098658; }                            /* 数字：VS 绿 */
.doc-card pre .f { color: #795e26; }                            /* 函数：VS 黄褐 */
.doc-card pre .struct { color: #267f99; font-weight: bold; }    /* 结构体：VS 青 */
html[data-theme="dark"] .doc-card pre .c { color: #6a9955; }
html[data-theme="dark"] .doc-card pre .k { color: #569cd6; }
html[data-theme="dark"] .doc-card pre .s { color: #ce9178; }
html[data-theme="dark"] .doc-card pre .n { color: #b5cea8; }
html[data-theme="dark"] .doc-card pre .f { color: #dcdcaa; }
html[data-theme="dark"] .doc-card pre .struct { color: #4ec9b0; }

.note {
  font-size: 13px; color: var(--text-faint);
  border-left: 3px solid var(--border); padding-left: 12px; margin-top: 14px;
}
.compare { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.compare th, .compare td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.compare th { color: var(--text-soft); font-weight: 600; }

/* ---------- Playground ---------- */
.playground {
  display: grid; grid-template-rows: auto 1fr auto auto;
  gap: 14px;
  padding: 18px 20px 20px;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
.editor-shell {
  display: grid; grid-template-columns: 1fr; position: relative;
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 0;
  animation: fadeUp 0.6s ease;
}
.editor-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
}
.editor-toolbar select {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: all 0.3s ease;
}
.editor-toolbar select:hover {
  border-color: var(--text-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.editor-toolbar .spacer { flex: 1; }
.editor-body { display: grid; grid-template-columns: 44px 1fr; min-height: 0; }
.line-nums {
  padding: 14px 0; text-align: right; color: #8e8e93;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  user-select: none; overflow: hidden;
  background: var(--panel2);
  border-right: 1px solid var(--border);
}
textarea#code {
  width: 100%; height: 100%; resize: none; border: none; outline: none;
  background: transparent;
  color: var(--code-text);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  padding: 14px 16px; tab-size: 4; white-space: pre; overflow: auto;
  caret-color: var(--text);
}
textarea#code::selection { background: rgba(0,0,0,0.1); }
html[data-theme="dark"] textarea#code::selection { background: rgba(255,255,255,0.15); }

/* Playground 高亮（与文档一致：VS Code 风格） */
.code-wrap pre#hl .c { color: #008000; font-style: italic; }
.code-wrap pre#hl .k { color: #0000ff; font-weight: bold; }
.code-wrap pre#hl .s { color: #a31515; }
.code-wrap pre#hl .n { color: #098658; }
.code-wrap pre#hl .f { color: #795e26; }
.code-wrap pre#hl .struct { color: #267f99; font-weight: bold; }
html[data-theme="dark"] .code-wrap pre#hl .c { color: #6a9955; }
html[data-theme="dark"] .code-wrap pre#hl .k { color: #569cd6; }
html[data-theme="dark"] .code-wrap pre#hl .s { color: #ce9178; }
html[data-theme="dark"] .code-wrap pre#hl .n { color: #b5cea8; }
html[data-theme="dark"] .code-wrap pre#hl .f { color: #dcdcaa; }
html[data-theme="dark"] .code-wrap pre#hl .struct { color: #4ec9b0; }

.output-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 150px; display: flex; flex-direction: column; overflow: hidden;
  transition: all 0.3s ease;
}
.output-panel:hover { border-color: var(--text-soft); }
.output-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600;
  color: var(--text-soft); background: var(--panel2);
}
.output-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); transition: all 0.3s ease; }
.output-head .dot.running { background: #e36209; animation: blink 1s infinite; }
.output-head .dot.ok { background: #00aff5; }
.output-head .dot.err { background: #ca4949; }
@keyframes blink { 50% { opacity: .3; } }
#output {
  flex: 1; padding: 14px 16px; overflow: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; white-space: pre-wrap;
  color: var(--text);
}
#output .err { color: #d73a49; }
.statusline {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-faint);
  padding: 0 4px;
}
.statusline .spacer { flex: 1; }

@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .nav { display: none; }
  .playground { padding: 12px; }
}