:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1d24;
  --text-dim: #5b6472;
  --accent: #4f7cff;
  --border: #e5e8ee;
  --card: #ffffff;
  --shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
}

[data-theme="dark"] {
  --bg: #0f1218;
  --bg-soft: #151a22;
  --text: #e8ebf1;
  --text-dim: #9aa4b5;
  --accent: #7da2ff;
  --border: #252c38;
  --card: #171c26;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

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

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

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  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; gap: 24px; height: 60px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 20px; list-style: none; margin-left: auto; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; }
.nav-links a.active, .nav-links a:hover { color: var(--accent); }

.theme-toggle {
  border: 1px solid var(--border); background: var(--card); cursor: pointer;
  border-radius: 8px; padding: 6px 10px; font-size: 0.95rem;
}

.hero { padding: 96px 24px 64px; text-align: center; }
.hero-kicker { color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.hero-title { font-size: 2.4rem; line-height: 1.35; margin-bottom: 16px; }
.hero-sub { color: var(--text-dim); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.btn {
  display: inline-block; padding: 10px 22px; border-radius: 10px;
  text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.section-head h2 { font-size: 1.5rem; }

.search {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); width: 220px; font-size: 0.9rem;
}
.search:focus { outline: 2px solid var(--accent); border-color: transparent; }

.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-bottom: 72px;
}

.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.post-card time { font-size: 0.8rem; color: var(--text-dim); }
.post-card h3 { margin: 8px 0; font-size: 1.1rem; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 12px; }
.post-card .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-card .tags span {
  font-size: 0.75rem; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--accent); border: 1px solid var(--border);
}

.empty { grid-column: 1 / -1; text-align: center; color: var(--text-dim); padding: 32px 0; }

.about { margin-bottom: 72px; }
.about h2 { font-size: 1.5rem; margin-bottom: 12px; }
.about p { color: var(--text-dim); max-width: 640px; }

.tag-list { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; margin-top: 16px; }
.tag-list li {
  padding: 4px 14px; border-radius: 999px; font-size: 0.85rem;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-dim);
}

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; text-align: center; }
.site-footer p { color: var(--text-dim); font-size: 0.85rem; }

@media (max-width: 640px) {
  .hero { padding: 64px 24px 48px; }
  .hero-title { font-size: 1.7rem; }
  .section-head { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
}

/* 文章详情页 */
.article { max-width: 760px; margin: 0 auto; padding: 56px 24px 72px; }
.article time { color: var(--text-dim); font-size: 0.85rem; }
.article h1 { font-size: 1.8rem; line-height: 1.4; margin: 8px 0 24px; }
.article h2 { font-size: 1.25rem; margin: 36px 0 12px; padding-left: 12px; border-left: 4px solid var(--accent); }
.article p { margin-bottom: 14px; color: var(--text); }
.article ul, .article ol { margin: 0 0 14px 24px; color: var(--text); }
.article li { margin-bottom: 6px; }
.article .tip {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 12px 16px; margin: 16px 0; font-size: 0.95rem;
}
.article .warn {
  background: color-mix(in srgb, #ff6b6b 8%, var(--bg-soft));
  border: 1px solid var(--border); border-left: 4px solid #ff6b6b;
  border-radius: 8px; padding: 12px 16px; margin: 16px 0; font-size: 0.95rem;
}
.article kbd {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px;
  padding: 1px 7px; font-size: 0.85em; font-family: inherit;
}
.article .back {
  display: inline-block; margin-bottom: 24px; color: var(--accent);
  text-decoration: none; font-size: 0.9rem;
}
.article .back:hover { text-decoration: underline; }
.article .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.article .tags span {
  font-size: 0.8rem; padding: 3px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--accent); border: 1px solid var(--border);
}

/* 备案号 */
.site-footer .icp { color: var(--text-dim); text-decoration: none; }
.site-footer .icp:hover { color: var(--accent); text-decoration: underline; }
