/* ============================================================
   base.css — 全局变量 / 重置 / 导航栏 / 页脚 / 响应式
   ============================================================ */

/* ---------- 1. 变量 ---------- */
:root {
  /* 配色：深色背景 + 亮色强调 */
  --bg:          #121212;
  --bg-elev:     #1c1c1e;   /* 卡片/浮层 */
  --bg-elev-2:   #26262a;   /* 悬停/输入框 */
  --text:        #e8e8ea;
  --text-muted:  #9a9aa2;
  --accent:      #00e5ff;   /* 亮色强调，全站统一 */
  --accent-dim:  rgba(0, 229, 255, 0.15);
  --border:      #2e2e33;

  /* 尺寸 */
  --nav-h:       64px;
  --max-w:       1100px;
  --radius:      12px;
  --gap:         24px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 过渡 */
  --t-fast: 0.15s ease;
  --t:      0.25s ease;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  /* 给固定导航留出空间 */
  padding-top: var(--nav-h);
  min-height: 100vh;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: #fff; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 3. 通用布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.page-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 40px 0 8px;
}
.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ============================================================
   4. 导航栏（固定顶部）
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav .nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 左侧站名 */
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-brand:hover { color: var(--accent); }

/* 链接列表 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-elev);
}

/* 当前页高亮：底部强调条 */
.nav-links a.active {
  color: var(--accent);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* 移动端汉堡按钮（默认隐藏） */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.nav-toggle:hover { background: var(--bg-elev); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }

/* ============================================================
   5. 页脚
   ============================================================ */
.site-footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   6. 响应式：768px 断点
   ============================================================ */
@media (max-width: 768px) {
  :root { --nav-h: 56px; --gap: 16px; }

  .page-title { font-size: 1.5rem; margin-top: 28px; }

  /* 显示汉堡按钮 */
  .nav-toggle { display: flex; }

  /* 链接列表变为下拉面板 */
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    /* 默认隐藏 */
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t), transform var(--t);
  }
  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a {
    padding: 12px 14px;
    font-size: 1rem;
  }
  /* 移动端 active 改为左侧竖条 */
  .nav-links a.active::after {
    left: 4px;
    right: auto;
    top: 10px;
    bottom: 10px;
    width: 3px;
    height: auto;
  }
}