/* ============ 主题变量 ============ */
:root {
  --bg: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1a2233;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --danger: #dc2626;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --radius: 14px;
}
body.dark {
  --bg: #0f1420;
  --bg-card: #171e2e;
  --text: #e5e9f0;
  --text-muted: #8b94a7;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --border: #2a3245;
  --shadow: 0 2px 12px rgba(0,0,0,.35);
}

/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); font-size: .9em; }

/* ============ 导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.4em; font-weight: 800; color: var(--text); }
.logo-dot { color: var(--primary); }
.nav-links { display: flex; gap: 6px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-muted); padding: 6px 14px; border-radius: 8px; font-size: .95em;
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); text-decoration: none; }
.nav-links a.active { color: var(--primary); font-weight: 600; }
.theme-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; font-size: 1em;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.4em; color: var(--text); cursor: pointer; }

/* ============ Hero ============ */
.hero { padding: 90px 20px 60px; text-align: center; }
.hero-hi { font-size: 1.1em; color: var(--text-muted); }
.hero-name {
  font-size: clamp(2.6em, 8vw, 4.2em); font-weight: 900; letter-spacing: .02em;
  background: linear-gradient(120deg, var(--primary), #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 6px 0 10px;
}
.hero-sub { max-width: 560px; margin: 0 auto 26px; color: var(--text-muted); font-size: 1.05em; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.hero-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ============ 按钮 / 标签 ============ */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 10px;
  font-size: .95em; cursor: pointer; border: none; transition: .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.tag {
  display: inline-block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 12px; font-size: .82em; color: var(--text-muted);
}

/* ============ 区块 / 卡片 ============ */
.section { padding: 40px 20px; }
.section-title, .page-title { font-size: 1.7em; font-weight: 800; margin-bottom: 8px; }
.page-sub { color: var(--text-muted); margin-bottom: 30px; }
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; color: var(--text); transition: .2s; box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-3px); text-decoration: none; border-color: var(--primary); }
.card-icon { font-size: 1.8em; margin-bottom: 10px; }
.card h3 { margin-bottom: 6px; font-size: 1.1em; }
.card p { color: var(--text-muted); font-size: .9em; }

.about-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.about-box p { margin-bottom: 10px; }

/* ============ 博客列表 ============ */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: .2s;
}
.post-item:hover { border-color: var(--primary); }
.post-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.post-meta time { color: var(--text-muted); font-size: .85em; }
.post-title { font-size: 1.15em; margin-bottom: 6px; }
.post-excerpt { color: var(--text-muted); font-size: .93em; }

/* ============ 简历 ============ */
.resume-block { margin-bottom: 36px; }
.resume-block h2 { font-size: 1.3em; margin-bottom: 14px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.skill-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { display: flex; flex-direction: column; gap: 18px; }
.timeline-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow);
}
.timeline-date { color: var(--primary); font-size: .85em; font-weight: 600; margin-bottom: 4px; }
.timeline-item h3 { font-size: 1.05em; margin-bottom: 6px; }
.timeline-item p { color: var(--text-muted); font-size: .93em; }

/* ============ 工具箱 ============ */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.tool-card h2 { font-size: 1.2em; margin-bottom: 6px; }
.tool-card textarea, .tool-card input {
  width: 100%; margin: 12px 0; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: .92em; resize: vertical;
}
.tool-card textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.stat-row { display: flex; gap: 18px; margin-top: 6px; }
.stat { text-align: center; flex: 1; background: var(--bg); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.3em; color: var(--primary); }
.stat span { font-size: .78em; color: var(--text-muted); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-out {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-top: 12px; font-size: .82em; white-space: pre-wrap;
  word-break: break-all; max-height: 220px; overflow: auto;
}

/* ============ 页脚 ============ */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: 40px; }
.site-footer p { color: var(--text-muted); font-size: .88em; }

/* ============ 移动端 ============ */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 12px 20px; gap: 4px;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 60px; }
}
