:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1f2328;
  --ink-soft: #5b6169;
  --ink-faint: #8b9099;
  --line: #e8e4dd;
  --accent: #d95f0e;
  --accent-soft: #fff3e8;
  --radius: 14px;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}
.nav { display: flex; gap: 22px; }
.nav a { color: var(--ink-soft); font-size: 14px; }
.nav a:hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero h1 {
  font-size: 32px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 34em;
}

/* Post list */
.list { padding-bottom: 24px; }
.list-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 8px 0 8px;
}
.post-item {
  display: block;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: inherit;
}
.post-item:hover { text-decoration: none; }
.post-item:hover .post-title { color: var(--accent); }
.post-date {
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.post-title {
  font-size: 20px;
  font-weight: 650;
  margin: 6px 0 6px;
  transition: color 0.15s ease;
}
.post-excerpt { font-size: 15px; color: var(--ink-soft); }

/* Article */
article { padding: 48px 0 8px; }
article header { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
article h1 {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.01em;
}
article .meta { margin-top: 12px; font-size: 13px; color: var(--ink-faint); }
article h2 {
  font-size: 20px;
  margin: 40px 0 12px;
  font-weight: 650;
}
article h3 { font-size: 17px; margin: 26px 0 8px; font-weight: 650; }
article p { margin: 14px 0; }
article ul, article ol { margin: 14px 0 14px 1.3em; }
article li { margin: 6px 0; }
article strong { font-weight: 650; }
article blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #7a3a08;
  font-size: 15px;
}
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}
article th, article td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
article th { color: var(--ink-faint); font-weight: 600; font-size: 13px; }
article code {
  background: #f1efe9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
}

.back { display: inline-block; margin-top: 44px; font-size: 14px; }

/* Legal pages */
article.legal h1 { font-size: 28px; }
article.legal h2 { scroll-margin-top: 84px; }
article.legal h3 { color: var(--ink); }
article.legal p.meta { font-size: 13px; color: var(--ink-faint); margin: 6px 0; }

.highlight {
  margin: 22px 0;
  padding: 16px 20px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
}
.highlight p { margin: 8px 0; color: #7a3a08; }
.highlight ul { margin: 8px 0 8px 1.2em; color: #7a3a08; }
.highlight a { color: #7a3a08; text-decoration: underline; }

.toc {
  margin: 26px 0 8px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}
.toc ol { margin: 8px 0 0 1.3em; }
.toc li { margin: 4px 0; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--accent); }

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--ink-faint); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 26px; }
  article h1 { font-size: 24px; }
  .nav { gap: 16px; }
}

/* 窄屏下宽表格横向滚动，避免整页溢出 */
@media (max-width: 640px) {
  article table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  article table th,
  article table td { min-width: 92px; }
  article table th:first-child,
  article table td:first-child { min-width: 116px; }
}
