/* ============================================================
   极简个人网站样式
   设计原则：大量留白、克制的颜色、内容优先。
   只用系统字体，不加载任何外部资源，快且免费。
   ============================================================ */

:root {
  --bg: #fcfbf9;
  --ink: #1c1b19;
  --muted: #7b7669;
  --line: #e8e5de;
  --accent: #8a6d3b;
  --serif: ui-serif, Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --ink: #e9e6df;
    --muted: #8f8a7d;
    --line: #2c2a26;
    --accent: #c2a069;
  }
}

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

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

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- 页头 ---------- */

.site-header {
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- 主体 ---------- */

.site-main {
  flex: 1;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

/* ---------- 首页 ---------- */

.hero {
  max-width: 42rem;
  padding: 2.5rem 0 3.5rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.section-label {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

/* 文章列表 */

.post-list {
  list-style: none;
  max-width: 42rem;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.post-list time {
  flex: none;
  width: 7.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-list a {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.post-list a:hover {
  color: var(--accent);
}

/* ---------- 文章页 ---------- */

.post {
  max-width: 42rem;
}

.post-header {
  padding: 1.5rem 0 2.5rem;
}

.post-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.post-header time {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.post-body > * + * {
  margin-top: 1.4rem;
}

.post-body h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin-top: 2.75rem;
}

.post-body h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2.25rem;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.post-body img {
  width: 100%;
  border-radius: 4px;
  margin: 2.25rem 0;
}

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--muted);
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
}

.post-body li + li {
  margin-top: 0.4rem;
}

.post-body code {
  font-size: 0.9em;
  background: var(--line);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--line);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem auto;
  width: 4rem;
}

/* 视频嵌入：16:9 自适应 */

.video-embed {
  margin: 2.25rem 0;
}

.video-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
  background: var(--line);
}

.post-back {
  margin-top: 4rem;
}

.post-back a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.post-back a:hover {
  color: var(--ink);
}

/* ---------- 相册 ---------- */

.gallery-intro {
  max-width: 42rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 2rem 1.5rem;
}

.gallery a {
  display: block;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.gallery a:hover img {
  opacity: 0.85;
}

.gallery figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */

.site-footer {
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ---------- 小屏幕 ---------- */

@media (max-width: 32rem) {
  .post-list li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .post-list time {
    width: auto;
  }
}
