/* vike AI 技术站 — shared styles. Dark terminal aesthetic, single green accent. */
:root {
  --bg: #0a0d11;
  --bg-soft: #0d1117;
  --panel: #10151c;
  --panel-2: #151b24;
  --panel-3: #1a212c;
  --border: #222c39;
  --border-strong: #2e3a49;
  --text: #e9edf2;
  --muted: #96a1ad;
  --faint: #6b7684;
  --accent: #3ecf8e;
  --accent-soft: rgba(62, 207, 142, 0.12);
  --accent-glow: rgba(62, 207, 142, 0.16);
  --accent-text: #06281a;
  --danger: #e5534b;
  --radius: 14px;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
section[id], footer[id] { scroll-margin-top: 84px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 17, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(62, 207, 142, 0.35);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.brand span { color: var(--accent); font-weight: 600; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 76px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(720px 360px at 78% -10%, var(--accent-glow), transparent 65%),
    radial-gradient(560px 300px at 8% 110%, rgba(62, 207, 142, 0.07), transparent 60%),
    var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(640px 420px at 70% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(640px 420px at 70% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(62, 207, 142, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18);
}
.hero h1 {
  font-size: 54px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #3ecf8e 10%, #7ee2ae 55%, #3ecf8e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { font-size: 19px; color: var(--text); max-width: 560px; }
.lede-sub { color: var(--muted); max-width: 560px; margin-top: 10px; }
.btn-row { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  transition: filter 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: var(--panel); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { padding: 8px 16px; font-size: 14px; }

/* terminal card */
.terminal {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(62, 207, 142, 0.05);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.9;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; display: 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: 8px;
  color: var(--faint);
  font-size: 12px;
}
.terminal-body { padding: 18px 20px 20px; }
.terminal-body .cmd { color: var(--text); }
.terminal-body .cmd::before { content: "$ "; color: var(--accent); }
.terminal-body .out { color: var(--muted); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .dim { color: var(--faint); }

/* ---------- sections ---------- */
.section { padding: 68px 0; border-bottom: 1px solid var(--border); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}
.section-head .idx {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}
.section h2 { font-size: 28px; letter-spacing: -0.01em; margin-bottom: 10px; }
.section .sub { color: var(--muted); max-width: 640px; margin-bottom: 28px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
a.card:hover {
  text-decoration: none;
  border-color: rgba(62, 207, 142, 0.55);
  transform: translateY(-3px);
  background: var(--panel-2);
}
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(62, 207, 142, 0.25);
  color: var(--accent);
  margin-bottom: 16px;
}
.card .icon svg { width: 20px; height: 20px; }
.card .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 10px;
}
.card .tag {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.card h3 { font-size: 18px; line-height: 1.5; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }
.card .more { color: var(--accent); margin-top: 16px; font-size: 14px; font-weight: 600; }

/* article list rows */
.article-list { display: flex; flex-direction: column; }
.article-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}
.article-row:first-child { border-top: 1px solid var(--border); }
.article-row:hover { text-decoration: none; background: var(--panel); }
.article-row .row-num {
  font-family: var(--font-mono);
  color: var(--faint);
  font-size: 13px;
  min-width: 28px;
}
.article-row .row-main { flex: 1; min-width: 0; }
.article-row .row-main h3 { font-size: 18px; line-height: 1.5; margin: 2px 0 4px; }
.article-row .row-main p { color: var(--muted); font-size: 14px; }
.article-row .row-tag {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(62, 207, 142, 0.3);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.article-row .row-arrow { color: var(--faint); font-size: 18px; transition: color 0.15s, transform 0.15s; }
.article-row:hover .row-arrow { color: var(--accent); transform: translateX(3px); }


/* ---------- footer ---------- */
.site-footer {
  padding: 36px 0 44px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner .foot-note { color: var(--faint); font-size: 13px; }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner nav a { color: var(--muted); font-size: 14px; }
.footer-inner nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- article pages ---------- */
.article { padding: 64px 0; }
.article .tag { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.article h1 { font-size: 34px; line-height: 1.35; letter-spacing: -0.01em; margin-bottom: 16px; }
.article .lede { font-size: 17px; color: var(--muted); max-width: 680px; }
.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin: 28px 0;
  border-radius: 0 8px 8px 0;
}
.article hr { border: none; border-top: 1px solid var(--border); margin: 32px 0 20px; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- game pages ---------- */
.game-page { padding: 56px 0 64px; }
.game-page .tag { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.game-page h1 { font-size: 32px; letter-spacing: -0.01em; margin-bottom: 10px; }
.game-page .lede { color: var(--muted); max-width: 640px; }
.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 24px 0 18px;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
}
.hud .spacer { flex: 1; }
.hud b { color: var(--accent); }
.hint { color: var(--muted); font-size: 14px; margin-top: 16px; }
.back-link { margin-top: 28px; }

/* gomoku */
.gomoku-board {
  display: grid;
  grid-template-columns: repeat(15, 28px);
  width: max-content;
  background: #dcb26a;
  border: 2px solid #8a5f14;
  border-radius: 4px;
}
.g-cell {
  width: 28px;
  height: 28px;
  box-shadow: inset 0 0 0 1px rgba(120, 72, 20, 0.45);
  cursor: pointer;
}
.g-cell.black::after,
.g-cell.white::after,
.g-cell:hover:not(.black):not(.white)::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 2px;
  border-radius: 50%;
}
.g-cell.black::after {
  background: radial-gradient(circle at 35% 30%, #555, #000 70%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.g-cell.white::after {
  background: radial-gradient(circle at 35% 30%, #fff, #c4c4c4 70%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.g-cell:hover:not(.black):not(.white)::after { background: rgba(0, 0, 0, 0.28); }

/* minesweeper */
.ms-board {
  display: grid;
  grid-template-columns: repeat(9, 38px);
  gap: 2px;
  width: max-content;
}
.ms-cell {
  width: 38px;
  height: 38px;
  background: #2b323c;
  border: 1px solid #3d4652;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
}
.ms-cell:hover:not(.open) { background: #343d49; }
.ms-cell.open { background: var(--panel); border-color: #232a33; cursor: default; }
.ms-cell.hit { background: var(--danger); }
.ms-cell.n1 { color: #58a6ff; }
.ms-cell.n2 { color: #3fb950; }
.ms-cell.n3 { color: #f85149; }
.ms-cell.n4 { color: #bc8cff; }
.ms-cell.n5 { color: #ff7b72; }
.ms-cell.n6 { color: #39c5cf; }
.ms-cell.n7 { color: #e3b341; }
.ms-cell.n8 { color: #8b949e; }

/* tank */
#tank-canvas {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #10151a;
  max-width: 100%;
  height: auto;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 720px) {
  .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 36px; }
  .section { padding: 52px 0; }
  .article-row { flex-wrap: wrap; gap: 10px; }
  .article-row .row-arrow { display: none; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 8px; }
}
