/* ============ GitHub 新手村指南 - 样式 ============ */
:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-card: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #9198a1;
  --blue: #58a6ff;
  --green: #3fb950;
  --green-btn: #238636;
  --purple: #bc8cff;
  --orange: #f0883e;
  --pink: #f778ba;
  --yellow: #d29922;
  --red: #f85149;
  --radius: 12px;
  --maxw: 1080px;
}

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

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

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

::selection { background: rgba(88, 166, 255, 0.35); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { fill: var(--text); }
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: rgba(177, 186, 196, 0.12);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 20px 72px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 50% -10%, rgba(88, 166, 255, 0.18), transparent),
    radial-gradient(ellipse 45% 35% at 85% 15%, rgba(188, 140, 255, 0.12), transparent),
    radial-gradient(ellipse 45% 35% at 12% 20%, rgba(63, 185, 80, 0.1), transparent);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--blue);
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.35);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--blue); }
.hero h1 .accent-green { color: var(--green); }
.hero p.sub {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: 17px;
  color: var(--text-dim);
}
.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary {
  background: var(--green-btn);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(240, 246, 252, 0.1), 0 8px 24px rgba(35, 134, 54, 0.35);
}
.btn-primary:hover { background: #2ea043; transform: translateY(-2px); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(177, 186, 196, 0.06);
}
.btn-ghost:hover { background: rgba(177, 186, 196, 0.14); transform: translateY(-2px); }
.hero-meta {
  margin-top: 30px;
  font-size: 13px;
  color: var(--text-dim);
}
.hero-meta span { color: var(--text); font-weight: 600; }

/* ---------- 通用区块 ---------- */
section.block { padding: 72px 20px; }
section.block.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.block-head { margin-bottom: 40px; max-width: 720px; }
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}
.block-head h2 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.01em; }
.block-head p { margin-top: 12px; color: var(--text-dim); font-size: 15.5px; }

/* ---------- Git vs GitHub ---------- */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
}
.vs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.vs-card h3 { font-size: 20px; margin-bottom: 4px; }
.vs-card .tag { font-size: 13px; color: var(--text-dim); }
.vs-card ul { margin-top: 16px; list-style: none; }
.vs-card li {
  padding: 8px 0 8px 26px;
  position: relative;
  font-size: 14.5px;
  color: #c9d1d9;
  border-top: 1px dashed rgba(48, 54, 61, 0.7);
}
.vs-card li:first-child { border-top: none; }
.vs-card li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--green);
  font-weight: 700;
}
.vs-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 20px;
  font-weight: 800;
}
.vs-note {
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.4);
  color: #e3b341;
  font-size: 14px;
}
.vs-note strong { color: #f0c674; }

/* ---------- 概念卡片 ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.concept {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.18s, border-color 0.18s;
}
.concept:hover { transform: translateY(-4px); border-color: rgba(88, 166, 255, 0.5); }
.concept .icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 14px;
}
.concept h3 { font-size: 17px; }
.concept h3 code {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(110, 118, 129, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin-left: 6px;
}
.concept .metaphor {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--yellow);
}
.concept p { margin-top: 8px; font-size: 14px; color: var(--text-dim); }

/* ---------- 功能地图 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.feature h3 {
  font-size: 15.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feature .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.feature p { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); }
.feature .lvl {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---------- 模拟仓库界面 ---------- */
.mock {
  margin-top: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.mock-bar .cir { width: 11px; height: 11px; border-radius: 50%; }
.mock-bar .url {
  margin-left: 10px;
  flex: 1;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 12px;
  font-family: ui-monospace, Consolas, monospace;
}
.mock-body { padding: 20px 22px; font-size: 13.5px; }
.mock-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.mock-tabs span { color: var(--text-dim); }
.mock-tabs span.on { color: var(--text); font-weight: 600; position: relative; }
.mock-tabs span.on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -11px;
  height: 2px;
  background: #f78166;
  border-radius: 2px;
}
.mock-repo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mock-repo-head .name { font-size: 17px; font-weight: 600; color: var(--blue); }
.mock-repo-head .badge {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--text-dim);
}
.mock-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  color: #c9d1d9;
}
.mock-file .ico { color: var(--text-dim); }
.mock-file .msg { color: var(--text-dim); font-size: 12px; }
.mock-file .time { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.callout-list { margin-top: 18px; display: grid; gap: 10px; }
.callout-list .co {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  align-items: baseline;
}
.callout-list .co b { color: var(--text); }
.callout-list .co .n {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.15);
  color: var(--blue);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-weight: 700;
}

/* ---------- 教程步骤 ---------- */
.steps { display: grid; gap: 20px; position: relative; }
.step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  position: relative;
}
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 56px;
  bottom: -22px;
  width: 2px;
  background: linear-gradient(var(--border), transparent);
}
.step-num {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.step-card h3 { font-size: 17.5px; }
.step-card h3 .en { color: var(--text-dim); font-weight: 400; font-size: 13px; margin-left: 8px; }
.step-card > p { margin-top: 8px; font-size: 14.5px; color: #c9d1d9; }
.step-card ol { margin: 12px 0 0 20px; font-size: 14px; color: var(--text-dim); display: grid; gap: 6px; }
.step-card ol b { color: var(--text); }
.tip {
  margin-top: 14px;
  padding: 11px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.tip.blue { background: rgba(88, 166, 255, 0.1); border: 1px solid rgba(88, 166, 255, 0.35); color: #a5cfff; }
.tip.green { background: rgba(63, 185, 80, 0.1); border: 1px solid rgba(63, 185, 80, 0.35); color: #8ddb8c; }
.tip.orange { background: rgba(240, 136, 62, 0.1); border: 1px solid rgba(240, 136, 62, 0.35); color: #f5b98a; }

/* ---------- 代码块 ---------- */
.code {
  margin-top: 14px;
  background: #010409;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.code .code-title {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(177, 186, 196, 0.04);
}
.code pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.75;
}
.code .cm { color: #8b949e; }
.code .kw { color: var(--red); }
.code .ar { color: var(--blue); }
.code .st { color: #a5d6ff; }

/* ---------- 术语表 ---------- */
.gloss-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.gloss-table th, .gloss-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.gloss-table th {
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.gloss-table tr:last-child td { border-bottom: none; }
.gloss-table td:first-child {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--blue);
  white-space: nowrap;
  font-weight: 600;
}
.gloss-table td:last-child { color: var(--text-dim); }
.gloss-table td:nth-child(2) { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }
details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
details[open] { border-color: rgba(88, 166, 255, 0.4); }
summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "＋";
  color: var(--blue);
  font-weight: 700;
  transition: transform 0.2s;
}
details[open] summary::before { content: "－"; }
.faq-a {
  padding: 0 20px 18px 48px;
  font-size: 14px;
  color: var(--text-dim);
}
.faq-a b { color: var(--text); }
.faq-a a { color: var(--blue); font-weight: 600; text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }
.faq-a code, p code, li code, td code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(110, 118, 129, 0.3);
  padding: 1.5px 6px;
  border-radius: 6px;
  color: #ffa657;
}

/* ---------- 资源 / Footer ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.res {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s, border-color 0.18s;
}
.res:hover { transform: translateY(-4px); border-color: rgba(188, 140, 255, 0.5); }
.res h3 { font-size: 15.5px; color: var(--blue); }
.res p { margin-top: 6px; font-size: 13.5px; color: var(--text-dim); }
.res .go { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }

footer {
  border-top: 1px solid var(--border);
  padding: 36px 20px 44px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}
footer .heart { color: var(--red); }
footer p + p { margin-top: 6px; }

/* ---------- 回到顶部 ---------- */
#toTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 90;
}
#toTop.show { opacity: 1; pointer-events: auto; }
#toTop:hover { transform: translateY(-3px); border-color: var(--blue); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .vs-grid { grid-template-columns: 1fr; }
  .vs-mid { padding: 4px 0; }
  .step { grid-template-columns: 40px 1fr; gap: 14px; }
  .step-num { width: 40px; height: 40px; font-size: 15px; border-radius: 11px; }
  .step:not(:last-child)::before { left: 19px; top: 44px; }
  .step-card { padding: 18px; }
  .faq-a { padding-left: 20px; }
  section.block { padding: 52px 16px; }
  .hero { padding: 60px 16px 52px; }
}

/* ---------- 专题实战页 ---------- */
.page-hero {
  padding: 64px 20px 52px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 55% 60% at 50% -10%, rgba(88, 166, 255, 0.16), transparent),
    radial-gradient(ellipse 40% 45% at 80% 10%, rgba(188, 140, 255, 0.12), transparent);
}
.page-hero .crumbs { font-size: 13.5px; margin-bottom: 18px; }
.page-hero .crumbs a { color: var(--blue); text-decoration: none; }
.page-hero .crumbs a:hover { text-decoration: underline; }
.page-hero .crumbs .sep { color: var(--text-dim); margin: 0 6px; }
.page-hero h1 { font-size: clamp(26px, 4.6vw, 42px); font-weight: 800; letter-spacing: -0.02em; }
.page-hero p.sub {
  max-width: 620px;
  margin: 16px auto 0;
  font-size: 16px;
  color: var(--text-dim);
}
.page-hero .req {
  display: inline-block;
  margin-top: 22px;
  font-size: 13px;
  color: #8ddb8c;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
}

/* 实战专题入口卡片（主页） */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.lab-card {
  position: relative;
  display: block;
  background: linear-gradient(165deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 28px;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.lab-card:hover {
  transform: translateY(-5px);
  border-color: rgba(88, 166, 255, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.lab-card .emoji { font-size: 36px; }
.lab-card h3 { font-size: 20px; margin-top: 14px; }
.lab-card h3 .en { color: var(--text-dim); font-weight: 400; font-size: 13px; margin-left: 8px; }
.lab-card p { margin-top: 10px; font-size: 14.5px; color: var(--text-dim); }
.lab-card .go { display: inline-block; margin-top: 16px; color: var(--blue); font-weight: 600; font-size: 14.5px; }
.lab-card .chip {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 11.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
  background: rgba(177, 186, 196, 0.06);
}

/* 专题页尾部的上一篇 / 下一篇 */
.pager {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 64px;
  display: flex;
  gap: 16px;
}
.pager a {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s, border-color 0.18s;
}
.pager a:hover { transform: translateY(-3px); border-color: rgba(88, 166, 255, 0.5); }
.pager a.next { text-align: right; }
.pager .dir { font-size: 12px; color: var(--text-dim); }
.pager .t { font-size: 15px; font-weight: 600; color: var(--blue); margin-top: 4px; }
@media (max-width: 640px) {
  .pager { flex-direction: column; }
}
