:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-alt: #161b22;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #9198a1;
  --border: #30363d;
  --brand: #3fb950;
  --brand-dark: #2ea043;
  --brand-solid: #238636;
  --brand-soft: rgba(63, 185, 80, .15);
  --danger: #f85149;
  --shadow: rgba(0, 0, 0, .45);
  --radius: 10px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #57606a;
  --border: #d0d7de;
  --brand: #2f6f4f;
  --brand-dark: #245a40;
  --brand-solid: #2f6f4f;
  --brand-soft: #eaf4ee;
  --danger: #cf222e;
  --shadow: rgba(0, 0, 0, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* 蜜罐字段：真人不可见，机器人会填写 */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.brand span { color: var(--brand); }
.nav a {
  margin-left: 22px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.nav a:hover { color: var(--brand); }
.nav a.active { color: var(--brand); font-weight: 600; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 40px;
  text-align: center;
}
.hero h1 { font-size: 40px; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 17px; margin: 4px 0; }
.hero-actions { margin-top: 28px; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  margin: 0 6px;
}
.btn-primary { background: var(--brand-solid); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost {
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-ghost:hover { background: var(--bg-alt); }

/* ---------- 版块/文章列表 ---------- */
.section { padding: 20px 0 40px; }
.section-title { font-size: 24px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.post-list { display: flex; flex-direction: column; gap: 18px; }
.post {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
}
.post:hover { box-shadow: 0 4px 16px var(--shadow); border-color: var(--brand); }
.post .post-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.post .post-excerpt { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.post .post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 16px;
}
.post .tag {
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 12px;
}

.empty { color: var(--muted); padding: 20px 0; }

/* ---------- 单篇文章 ---------- */
.article h1 { font-size: 30px; margin: 0 0 8px; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.article .post-content { font-size: 16px; }
.article .post-content h2 { font-size: 22px; margin-top: 28px; }

/* ---------- 关于/联系 ---------- */
.page h1 { font-size: 30px; margin: 40px 0 16px; }
.page .lead { color: var(--muted); font-size: 16px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-status { margin-top: 14px; font-size: 14px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.beian {
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.beian a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.beian a:hover { color: var(--brand); }

::selection { background: var(--brand-soft); color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  .nav a { margin-left: 12px; font-size: 14px; }
  .theme-toggle { margin-left: 10px; }
}