/* ============ 基础变量 ============ */
:root {
  --bg: #faf9f7;
  --bg-alt: #f1efe9;
  --surface: #ffffff;
  --text: #2d2a26;
  --text-muted: #7a7468;
  --accent: #c0392b;
  --accent-dark: #a93226;
  --border: #e5e0d6;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.06);
  --shadow-md: 0 8px 30px rgba(45, 42, 38, 0.1);
  --container: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

[data-theme="dark"] {
  --bg: #191714;
  --bg-alt: #211e1a;
  --surface: #26221d;
  --text: #ece7dd;
  --text-muted: #a29a8c;
  --accent: #e0715f;
  --accent-dark: #cf5a48;
  --border: #38332c;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

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

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

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, 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: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}
.brand-dot { color: var(--accent); }

.site-nav { display: flex; align-items: center; }

.nav-menu {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============ Hero 区 ============ */
.hero {
  position: relative;
  padding: 96px 0 140px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-desc { color: var(--text-muted); max-width: 520px; margin-bottom: 32px; }

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

.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Hero 装饰动画 */
.hero-art { position: relative; height: 260px; }

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, transparent);
}
.orbit-outer { width: 240px; height: 240px; animation: spin 24s linear infinite; }
.orbit-inner { width: 170px; height: 170px; border-color: color-mix(in srgb, var(--accent) 55%, transparent); animation: spin 16s linear infinite reverse; }
.orbit-inner::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent);
}
.orbit-outer::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 70%, #fff);
}

.sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5c06b, var(--accent));
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent);
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
  display: inline-flex;
}
@keyframes bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ============ 通用区块 ============ */
.section { padding: 84px 0; }
.section:nth-child(even) { background: var(--bg-alt); }

.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }

.section-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  position: relative;
  padding-left: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 4px;
  border-radius: 4px;
  background: var(--accent);
}

/* 筛选按钮 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============ 文章卡片 ============ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
}
.article-card.visible { opacity: 1; transform: translateY(0); transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease; }
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.article-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 0.82rem; color: var(--text-muted); }

.article-tag {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.article-title { font-family: var(--font-serif); font-size: 1.2rem; margin-bottom: 10px; }
.article-title a { color: var(--text); }
.article-title a:hover { color: var(--accent); }

.article-excerpt { font-size: 0.92rem; color: var(--text-muted); flex: 1; margin-bottom: 18px; }

.article-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); }

.article-read {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.article-read:hover { gap: 8px; transition: gap 0.2s ease; }

/* ============ 关于 ============ */
.about-body { display: flex; gap: 40px; align-items: flex-start; }

.about-avatar {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.6rem;
  box-shadow: var(--shadow-md);
}

.about-content p { margin-bottom: 14px; max-width: 640px; }

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

/* ============ 时间线 ============ */
.timeline-list { list-style: none; position: relative; padding-left: 0; max-width: 700px; }

.timeline-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; padding: 0 0 34px 34px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-sizing: border-box;
}

.timeline-date { font-size: 0.82rem; color: var(--accent); font-weight: 600; letter-spacing: 1px; }
.timeline-title { font-family: var(--font-serif); font-size: 1.05rem; margin: 2px 0 4px; }
.timeline-desc { font-size: 0.9rem; color: var(--text-muted); }

/* ============ 联系 ============ */
.contact-desc { color: var(--text-muted); margin-bottom: 24px; }

.contact-links { display: flex; flex-wrap: wrap; gap: 14px; }

.contact-link {
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.site-footer .container { display: flex; align-items: center; justify-content: space-between; }
.heart { color: var(--accent); }

.back-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .hero { padding: 64px 0 100px; }
}

@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .about-body { flex-direction: column; align-items: center; text-align: center; }
  .about-content p { margin-left: auto; margin-right: auto; }
  .tag-list { justify-content: center; }

  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-menu.open { max-height: 320px; }
  .nav-menu li { border-bottom: 1px solid var(--border); }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-link { display: block; padding: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
