﻿/* ==========================================================
   上线性能与顺滑度增强引擎 (Smoothness & Performance Optimization)
   ========================================================== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* 硬件加速与流畅悬停 */
a, button, .media-news-card, .btn-media-primary, .btn-media-secondary, .faq-card, .intro-panel {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* 移动端平滑滚动与防抖 */
.table-wrapper, .table-container, .code-box, pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* 媒体图片防溢出与自适应 */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 消除点击高亮延迟 */
a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0d1117;
  --bg-subtle: #010409;
  --surface: #161b22;
  --surface-hover: #21262d;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-dim: #484f58;
  --line: #30363d;
  --line-strong: #6e7681;
  
  --geek-white: #ffffff;
  --geek-green: #3fb950;
  --geek-green-dim: rgba(63, 185, 80, 0.15);
  --geek-cyan: #58a6ff;
  --geek-red: #f85149;
  --mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

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

code, pre {
  font-family: var(--mono-font);
}

a { color: var(--geek-cyan); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; color: var(--geek-white); }

.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

/* 顶部独立声明 */
.notice {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px 0;
  font-family: var(--mono-font);
}
.notice-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notice-badge code {
  background: #21262d;
  color: var(--geek-green);
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 导航栏 */
.site-header {
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--geek-white);
  font-size: 19px;
  font-weight: 900;
  font-family: var(--mono-font);
  border-bottom: none;
}
.brand-prompt {
  color: var(--geek-green);
  font-weight: 900;
}
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--mono-font);
  border: 1px solid transparent;
  transition: all .15s ease;
}
.nav a:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--geek-white);
  text-decoration: none;
}

/* 首屏 Hero */
.hero {
  padding: 56px 0 48px;
  background: radial-gradient(circle at 50% 0%, #161b22 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--line);
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--surface);
  color: var(--geek-green);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--mono-font);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(30px, 4.8vw, 50px);
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--geek-white);
  margin-bottom: 18px;
  max-width: 960px;
}
.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 880px;
  line-height: 1.75;
}
.hero strong { color: var(--geek-white); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  margin-bottom: 36px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--mono-font);
  transition: all .2s ease;
}
.button.primary {
  background: var(--geek-white);
  color: #000000;
  border: 1px solid var(--geek-white);
}
.button.primary:hover {
  background: #e6edf3;
  text-decoration: none;
}
.button.secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--line);
}
.button.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  text-decoration: none;
}

/* 极客终端对比卡片 */
.terminal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.terminal-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.terminal-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono-font);
  font-size: 12px;
}
.terminal-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title {
  color: var(--text-muted);
  font-weight: 700;
}
.terminal-content {
  padding: 20px;
  font-family: var(--mono-font);
  font-size: 13px;
}
.terminal-list {
  list-style: none;
  display: grid;
  gap: 12px;
}
.terminal-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
  color: var(--text-muted);
}
.terminal-list li code {
  color: var(--geek-green);
  font-weight: 800;
}
.terminal-list li strong {
  color: var(--geek-white);
}
.terminal-box.danger .terminal-list li code {
  color: var(--geek-red);
}

/* 通用 Section */
.section {
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 900;
  color: var(--geek-white);
  letter-spacing: -0.02em;
}
.section-note {
  max-width: 480px;
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--mono-font);
}

/* 六宫格功能模块区 */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  transition: all .2s;
}
.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--mono-font);
}
.card-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--geek-green);
  background: var(--geek-green-dim);
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}
.card-num {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
}
.card h3 {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--geek-white);
}
.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.card strong { color: var(--geek-white); }

/* 正文介绍区 */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.intro-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}
.intro-box h3 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 14px;
  color: var(--geek-white);
  font-family: var(--mono-font);
  display: flex;
  align-items: center;
  gap: 8px;
}
.intro-box p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
}
.intro-box ul {
  list-style: none;
  display: grid;
  gap: 10px;
}
.intro-box li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
  font-family: var(--mono-font);
}
.intro-box li::before {
  content: "»";
  position: absolute;
  left: 0;
  color: var(--geek-green);
  font-weight: 900;
}

/* 热门教程表格 */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  font-family: var(--mono-font);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--mono-font);
}
.level-badge.easy { background: var(--geek-green-dim); color: var(--geek-green); border: 1px solid rgba(63, 185, 80, 0.3); }
.level-badge.medium { background: rgba(88, 166, 255, 0.15); color: var(--geek-cyan); border: 1px solid rgba(88, 166, 255, 0.3); }
.level-badge.hard { background: rgba(248, 81, 73, 0.15); color: var(--geek-red); border: 1px solid rgba(248, 81, 73, 0.3); }

/* FAQ 区域 */
.faq-list {
  display: grid;
  gap: 12px;
}
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
}
summary {
  font-size: 16px;
  font-weight: 800;
  color: var(--geek-white);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono-font);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "[+]";
  font-size: 14px;
  color: var(--text-dim);
  font-family: var(--mono-font);
}
details[open] summary::after {
  content: "[-]";
  color: var(--geek-green);
}
details p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* 子页面文章排版 */
.article {
  max-width: 900px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 38px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.article h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 950;
  color: var(--geek-white);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.25;
}
.article-lead {
  font-size: 15px;
  color: var(--text-muted);
  border-left: 3px solid var(--geek-white);
  padding: 10px 16px;
  margin-bottom: 26px;
  background: var(--bg-subtle);
  font-family: var(--mono-font);
}
.article h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--geek-white);
  margin: 30px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono-font);
}
.article p, .article li {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
  line-height: 1.8;
}
.article ul { margin-left: 20px; }
.article .geek-terminal-note {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 18px 0;
  color: var(--text-main);
  font-family: var(--mono-font);
  font-size: 13px;
}
.article .geek-terminal-note code { color: var(--geek-green); }

/* 页脚 */
.site-footer {
  margin-top: 50px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 44px 0 28px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 28px;
}
.footer-brand strong {
  display: block;
  font-size: 16px;
  color: var(--geek-white);
  margin: 8px 0 4px;
  font-family: var(--mono-font);
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 440px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-links a {
  color: var(--text-muted);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono-font);
  border: 1px solid var(--line);
}
.footer-links a:hover {
  background: var(--geek-white);
  color: #000000;
  border-color: var(--geek-white);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  font-family: var(--mono-font);
}

/* 响应式适配 */
@media (max-width: 860px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: 14px 0; }
  .terminal-grid, .grid-6, .intro-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer-top { flex-direction: column; }
  .article { padding: 22px 16px; }
  .notice-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}
