/* ============ 设计变量 ============ */
:root {
  --bg: #faf7f2;
  --bg-soft: #f1ece3;
  --card: #ffffff;
  --text: #2b2620;
  --text-soft: #6b6156;
  --accent: #c2410c;
  --accent-soft: #fde8d7;
  --border: #e7dfd3;
  --shadow: 0 2px 12px rgba(60, 45, 25, 0.06);
  --radius: 14px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-head: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia,
    serif;
}

[data-theme="dark"] {
  --bg: #1b1712;
  --bg-soft: #241e17;
  --card: #2a231b;
  --text: #ece4d8;
  --text-soft: #a89b89;
  --accent: #f08a4b;
  --accent-soft: #3d2a1c;
  --border: #3a3126;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.3s ease, color 0.3s ease;
}

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

a { color: var(--accent); text-decoration: none; }

img { max-width: 100%; display: block; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.logo-en {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-soft);
  margin-left: 4px;
}

.nav { display: flex; gap: 6px; }

.nav-link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-soft);
  transition: all 0.2s ease;
}

.nav-link:hover { color: var(--text); background: var(--bg-soft); }

.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover { color: var(--text); border-color: var(--text-soft); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ============ 欢迎区 ============ */
.hero {
  padding: 88px 0 72px;
  text-align: center;
  background:
    radial-gradient(600px 200px at 50% 0%, var(--accent-soft), transparent 70%);
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.3;
  margin-bottom: 20px;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--text-soft);
  font-size: 16px;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

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

/* ============ 文章 ============ */
.posts { padding: 64px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 26px;
}

.section-sub { color: var(--text-soft); font-size: 14px; }

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

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(16px);
}

.post-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(60, 45, 25, 0.12);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.post-tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.post-title {
  font-family: var(--font-head);
  font-size: 19px;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--text);
}

.post-card:hover .post-title { color: var(--accent); }

.post-excerpt {
  font-size: 14px;
  color: var(--text-soft);
  flex: 1;
  margin-bottom: 16px;
}

.post-link {
  font-size: 14px;
  font-weight: 600;
}

/* ============ 关于 ============ */
.about { padding: 32px 0 72px; }

.about-inner { max-width: 720px; }

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.about-card .section-title { margin-bottom: 16px; }

.about-card p { color: var(--text-soft); margin-bottom: 12px; }

.about-meta {
  font-size: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  margin-top: 16px;
}

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
}

.beian { font-size: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .hero { padding: 64px 0 48px; }
  .logo-en { display: none; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .post-grid { grid-template-columns: 1fr; }
}

/* ============ 减少动效 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card { transition: none; opacity: 1; transform: none; }
  .post-card:hover { transform: none; }
}
