/* ============================================================
   主题变量 · 头部导航 · 页面标题 · 通用区块 · 按钮
   由 style.css 按原顺序拆分（2026-11-22），层叠顺序未变
   引用顺序：base → modules → pages，不要调换
   ============================================================ */

/* ============================================================
   我的个人主页 · 基础样式
   改配色：改下面 :root 里的变量即可，其他样式会自动跟着变
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 主题变量 ---------- */
:root {
  --bg: #f6f7f9;            /* 页面背景 */
  --bg-alt: #ffffff;        /* 头部 / 卡片 / 交替区块背景 */
  --text: #23272f;          /* 正文颜色 */
  --text-muted: #5b6472;    /* 次要文字 */
  --accent: #4f6ef7;        /* 主色（按钮、高亮、链接） */
  --accent-strong: #3d5ce0; /* 主色 hover */
  --accent-soft: #e9edfe;   /* 主色的浅色底 */
  --border: #e3e6ec;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(35, 39, 47, 0.06);
  --container: 960px;
  --header-h: 64px;
}

/* 手动选择深色 */
:root[data-theme="dark"] {
  --bg: #16181d;
  --bg-alt: #1e2127;
  --text: #e8eaf0;
  --text-muted: #9aa3b2;
  --accent: #7c93ff;
  --accent-strong: #93a6ff;
  --accent-soft: #272c45;
  --border: #2c3039;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* 未手动选择时，跟随系统深色模式 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d;
    --bg-alt: #1e2127;
    --text: #e8eaf0;
    --text-muted: #9aa3b2;
    --accent: #7c93ff;
    --accent-strong: #93a6ff;
    --accent-soft: #272c45;
    --border: #2c3039;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}

html {
  scroll-behavior: smooth;
}

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

a { color: var(--accent); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 头部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* 主题按钮：浅色显示太阳，深色显示月亮 */
.icon-btn .icon-moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: block; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-btn .icon-sun { display: none; }
}

.nav-toggle { display: none; }

/* 按钮内嵌图标 */
.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.record-del svg {
  width: 15px;
  height: 15px;
}

/* ---------- 页面标题 ---------- */
.page-head {
  padding: 56px 0 40px;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.page-head h1 { font-size: 2rem; }
.page-head p { margin-top: 8px; color: var(--text-muted); }

.status-chip {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.guest-banner {
  margin: 14px auto 0;
  max-width: 640px;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius);
  color: #d97706;
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 通用区块 ---------- */
.section { padding: 64px 0; }
.section-sm { padding: 32px 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 { font-size: 1.5rem; margin-bottom: 12px; }
.sub-title { font-size: 1.15rem !important; }
.section-intro { color: var(--text-muted); margin-bottom: 28px; }

/* 占位提示框 */
.placeholder {
  padding: 16px 18px;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: none;
}

.btn-ghost {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
