:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #7a7a7a;
  --line: #d9d9d9;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 28px 96px;
}

/* ---------- 载入与切换动画（柔和缓动） ---------- */
.site-header,
.site-main,
.site-footer {
  animation: riseIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.site-header { animation-delay: 0.05s; }
.site-main   { animation-delay: 0.18s; }
.site-footer { animation-delay: 0.3s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 离场淡出（导航切换时由 JS 添加 is-leaving） */
html.is-leaving body { opacity: 0; }

/* ---------- 页头 ---------- */
.site-header { text-align: center; margin-bottom: 48px; }

.ornament {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  color: var(--fg);
}
.ornament svg { opacity: 0.92; }

.site-name {
  font-size: 2.7rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  line-height: 1.3;
  margin: 0 0 14px;
}

.site-dates {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  letter-spacing: 0.22em;
}

.site-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 30px;
  margin-top: 34px;
}

.nav-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.18em;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.nav-link:hover { border-color: var(--fg); }

.rule {
  width: 72px;
  height: 1px;
  margin: 0 auto;
  background: var(--line);
}
.site-header .rule { margin-top: 36px; }

/* ---------- 正文 ---------- */
.site-main h1,
.site-main h2,
.site-main h3 {
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.5;
  margin: 2.2em 0 0.8em;
}
.site-main h1 { font-size: 1.7rem; text-align: center; }
.site-main h2 { font-size: 1.35rem; }
.site-main h3 { font-size: 1.1rem; }
.site-main h1:first-child,
.site-main h2:first-child { margin-top: 0; }

.site-main p { margin: 0 0 1.3em; }
.site-main a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-main a:hover { border-color: var(--fg); }

.site-main img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 2px;
}

.site-main blockquote {
  margin: 2em 0;
  padding: 0.2em 1.6em;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 1.02em;
  letter-spacing: 0.08em;
}

.site-main ul,
.site-main ol { padding-left: 1.5em; margin: 0 0 1.3em; }
.site-main li { margin: 0.4em 0; }

.site-main hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3em auto;
  width: 60%;
}

/* 首页第一张图（遗像）做柔和相框 */
.site-main > p:first-child img {
  max-width: 260px;
  margin-top: 0;
  border: 1px solid var(--line);
  padding: 8px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ---------- 相册 ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 2em 0;
}
.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 6px;
  background: #fff;
}
.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

/* ---------- 页脚 ---------- */
.site-footer { text-align: center; margin-top: 72px; }
.site-footer .rule { margin-bottom: 28px; }
.footer-text {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  margin: 0;
}
.footer-year { color: #b5b5b5; font-size: 0.8rem; margin: 10px 0 0; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-name { font-size: 2rem; letter-spacing: 0.3em; }
  .site-nav { gap: 6px 18px; }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
