/* ========== 小站 · 全站样式 ========== */
:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --ink: #262a30;
  --ink-soft: #4b5563;
  --muted: #8b9096;
  --line: #e6e2d8;
  --accent: #b3402a;
  --accent-soft: rgba(179, 64, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(31, 41, 51, .04), 0 2px 8px rgba(31, 41, 51, .05);
  --shadow-md: 0 6px 16px rgba(31, 41, 51, .08), 0 16px 40px rgba(31, 41, 51, .09);
  --radius: 14px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --paper: #14161a;
  --surface: #1d2025;
  --ink: #e8e6e1;
  --ink-soft: #b6bcc4;
  --muted: #7d838b;
  --line: #2c3037;
  --accent: #d4694f;
  --accent-soft: rgba(212, 105, 79, 0.13);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.28);
  --shadow-md: 0 6px 16px rgba(0,0,0,.34), 0 16px 40px rgba(0,0,0,.38);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.9;
  font-size: 16px;
  transition: background .3s, color .3s;
}
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { opacity: .8; }
img { max-width: 100%; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- 头部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1040px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { opacity: 1; }
.brand-seal {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--ink-soft); font-size: 15px; padding: 6px 14px;
  border-radius: 999px; position: relative; transition: all .2s;
}
.nav-links a:hover { color: var(--accent); background: var(--accent-soft); opacity: 1; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.theme-toggle {
  margin-left: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }

/* ---------- Hero ---------- */
.hero { padding: 110px 24px 90px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 260px at 85% 20%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero-seal {
  width: 72px; height: 72px; margin: 0 auto 28px;
  border-radius: 16px; background: var(--accent); color: #fff;
  font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl;
  box-shadow: var(--shadow-md);
  transform: rotate(-3deg);
}
.hero h1 {
  font-family: var(--serif); font-size: 44px; font-weight: 700;
  letter-spacing: 3px; line-height: 1.5; margin-bottom: 22px;
}
.hero-sub {
  max-width: 620px; margin: 0 auto 36px;
  color: var(--ink-soft); font-size: 17px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 30px; border-radius: 999px; font-size: 15px;
  transition: all .25s; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); background: var(--surface); }
.btn-ghost:hover { opacity: 1; border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- 区块 ---------- */
.section { padding: 72px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; }
.section-title { font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: 2px; }
.section-title::after {
  content: ""; display: block; width: 42px; height: 3px;
  background: var(--accent); border-radius: 2px; margin-top: 8px;
}
.section-more { font-size: 14px; color: var(--muted); }
.section-more:hover { color: var(--accent); opacity: 1; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; font-weight: 600; }
.card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 随笔卡片 / 列表 ---------- */
.post-card { display: flex; flex-direction: column; color: var(--ink); }
.post-card:hover { opacity: 1; }
.post-card .post-date { font-size: 13px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.post-card h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 10px; transition: color .2s; }
.post-card:hover h3 { color: var(--accent); }
.post-card p { font-size: 14.5px; color: var(--ink-soft); flex: 1; }
.post-card .read-more { margin-top: 16px; font-size: 14px; color: var(--accent); }
.post-card .read-more::after { content: " →"; transition: margin .2s; }
.post-card:hover .read-more::after { margin-left: 4px; }

.post-row {
  display: flex; gap: 28px; align-items: baseline;
  padding: 26px 4px; border-bottom: 1px solid var(--line); color: var(--ink);
  transition: padding .2s;
}
.post-row:hover { opacity: 1; padding-left: 12px; }
.post-row .row-date { flex-shrink: 0; width: 110px; font-size: 13.5px; color: var(--muted); letter-spacing: 1px; }
.post-row h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 6px; transition: color .2s; }
.post-row:hover h3 { color: var(--accent); }
.post-row p { font-size: 14px; color: var(--ink-soft); }

/* ---------- 标签 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  padding: 7px 18px; border-radius: 999px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .2s; cursor: default;
}
.tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- 时间线（关于页） ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line); border-radius: 1px;
}
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -28px; top: 10px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--accent);
}
.timeline-item .tl-date { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.timeline-item h3 { font-size: 17px; font-weight: 600; margin: 4px 0 6px; }
.timeline-item p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 页头（子页面） ---------- */
.page-head { padding: 80px 0 40px; text-align: center; }
.page-head h1 { font-family: var(--serif); font-size: 36px; letter-spacing: 3px; margin-bottom: 14px; }
.page-head p { color: var(--ink-soft); max-width: 560px; margin: 0 auto; }

/* ---------- 文章页 ---------- */
.article-wrap { max-width: 740px; margin: 0 auto; }
.article-meta {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); font-size: 14px; margin-top: 18px; letter-spacing: 1px;
}
.article {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 56px 60px;
  box-shadow: var(--shadow-sm); margin: 40px 0 72px;
}
.article p { margin-bottom: 22px; color: var(--ink); font-size: 16.5px; line-height: 2.05; }
.article h2 {
  font-family: var(--serif); font-size: 23px; margin: 42px 0 18px;
  padding-left: 14px; border-left: 4px solid var(--accent); letter-spacing: 1px;
}
.article blockquote {
  margin: 28px 0; padding: 20px 26px;
  background: var(--accent-soft); border-radius: 10px;
  color: var(--ink-soft); font-size: 15.5px;
}
.article blockquote p { margin: 0; color: var(--ink-soft); }
.article ul { margin: 0 0 22px 24px; color: var(--ink); line-height: 2.05; }
.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 72px; flex-wrap: wrap; }
.article-nav a {
  flex: 1; min-width: 220px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-soft); font-size: 14.5px; transition: all .2s;
}
.article-nav a:hover { opacity: 1; border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.article-nav .nav-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.article-nav .next { text-align: right; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 80px; border-top: 1px solid var(--line);
  padding: 44px 24px 36px; text-align: center;
  color: var(--muted); font-size: 13.5px;
}
.footer-seal {
  width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 9px;
  background: var(--accent); color: #fff; opacity: .85;
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.site-footer p { margin-bottom: 6px; }
.site-footer .icp { color: var(--muted); opacity: .75; }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: var(--shadow-md); cursor: pointer; font-size: 18px;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: all .3s;
  display: flex; align-items: center; justify-content: center;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 滚动显现动画 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero { padding: 72px 20px 60px; }
  .hero h1 { font-size: 30px; }
  .nav { padding: 0 16px; }
  .brand-name { letter-spacing: 2px; }
  .nav-links a { padding: 6px 9px; font-size: 14px; }
  .article { padding: 36px 26px; }
  .post-row { flex-direction: column; gap: 4px; }
  .post-row .row-date { width: auto; }
  .section { padding: 52px 0 4px; }
}
