/* ============================================================
   草原杂谈 — 样式表
   结构：变量 → 基础 → 布局 → 页头页脚 → 首页 → 列表 → 文章
        → 归档/标签/关于 → 状态 → 响应式
   ============================================================ */

/* ---------- 1. 变量 ---------- */

:root {
  color-scheme: light;

  --bg: #f6f9ef;
  --bg-soft: #edf2e1;
  --surface: #fdfef8;
  --text: #26301f;
  --text-strong: #16200f;
  --muted: #66705a;
  --faint: #737e63;
  --border: #dfe6cf;
  --border-strong: #c6d2b0;
  --accent: #3f7a3a;
  --accent-hover: #2f5f2c;
  --accent-soft: rgba(63, 122, 58, 0.09);
  --code-bg: #edf1e0;
  --mark: rgba(63, 122, 58, 0.16);
  --shadow: 0 1px 2px rgba(38, 52, 24, 0.05), 0 8px 24px -12px rgba(38, 52, 24, 0.13);

  --wrap: 1080px;
  --reading: 700px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #12160e;
    --bg-soft: #191e14;
    --surface: #1b2116;
    --text: #dde4d1;
    --text-strong: #f1f5e8;
    --muted: #98a189;
    --faint: #7a8570;
    --border: #2a3222;
    --border-strong: #3b4631;
    --accent: #9ccf74;
    --accent-hover: #b2dc8c;
    --accent-soft: rgba(156, 207, 116, 0.13);
    --code-bg: #1f2618;
    --mark: rgba(156, 207, 116, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #12160e;
  --bg-soft: #191e14;
  --surface: #1b2116;
  --text: #dde4d1;
  --text-strong: #f1f5e8;
  --muted: #98a189;
  --faint: #7a8570;
  --border: #2a3222;
  --border-strong: #3b4631;
  --accent: #9ccf74;
  --accent-hover: #b2dc8c;
  --accent-soft: rgba(156, 207, 116, 0.13);
  --code-bg: #1f2618;
  --mark: rgba(156, 207, 116, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- 2. 基础 ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0;
}

::selection {
  background: var(--mark);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. 页头 ---------- */

#progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 100;
  transition: width 0.08s linear;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text-strong);
}

.brand .dot {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  border-radius: 6px;
}

.site-nav a:hover {
  color: var(--text-strong);
  background: var(--bg-soft);
}

.site-nav a[aria-current="page"] {
  color: var(--text-strong);
  font-weight: 600;
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

[data-theme="light"] .icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .icon-moon { display: none; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun { display: none; }
}

/* ---------- 4. 首页 ---------- */

.hero {
  padding: 76px 0 56px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.22;
  letter-spacing: 0.015em;
  max-width: 18em;
}

.hero .lead {
  margin: 22px 0 0;
  max-width: 32em;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.9;
}

.hero .rule {
  width: 44px;
  height: 2px;
  background: var(--accent);
  margin: 30px 0 0;
  border: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-size: 0.86rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.section-head .count {
  font-size: 0.8rem;
  color: var(--faint);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.searchbar:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.searchbar svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
  flex: none;
}

.searchbar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.searchbar input::placeholder {
  color: var(--faint);
}

.featured {
  display: block;
  position: relative;
  margin: 0 0 46px;
  padding: 30px 32px 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.featured:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(30, 44, 20, 0.06), 0 18px 40px -18px rgba(30, 44, 20, 0.24);
}

.featured .kicker {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.featured h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.4;
}

.featured p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.featured .meta {
  margin-top: 18px;
}

/* ---------- 5. 文章列表 ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: 0;
}

.post-item > a {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 24px;
  padding: 24px 0;
  color: inherit;
}

.post-item > a:hover {
  color: inherit;
}

.post-item .date {
  padding-top: 4px;
  font-size: 0.78rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.post-item h3 {
  font-size: 1.18rem;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.post-item > a:hover h3 {
  color: var(--accent);
}

.post-item .excerpt {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.78;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.78rem;
  color: var(--faint);
}

.meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.7;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 34px;
  font-size: 0.9rem;
  color: var(--muted);
}

.more:hover {
  color: var(--accent);
}

/* ---------- 6. 文章页 ---------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 56px;
  padding: 54px 0 72px;
  align-items: start;
  justify-content: space-between;
}

.article {
  max-width: var(--reading);
}

.article-head {
  margin-bottom: 38px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.article-head .back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--faint);
}

.article-head .back:hover {
  color: var(--accent);
}

.article-head h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.article-head .meta {
  margin-top: 20px;
}

.article-body {
  font-size: 1.03rem;
  line-height: 1.95;
  color: var(--text);
  letter-spacing: 0.01em;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body p {
  margin: 0 0 1.5em;
}

.article-body h2 {
  margin: 2.4em 0 0.9em;
  font-size: 1.42rem;
  scroll-margin-top: 84px;
}

.article-body h3 {
  margin: 2em 0 0.7em;
  font-size: 1.14rem;
  scroll-margin-top: 84px;
}

.article-body h4 {
  margin: 1.8em 0 0.6em;
  font-size: 1rem;
  scroll-margin-top: 84px;
}

.article-body h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 16px;
  background: var(--accent);
  opacity: 0.85;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.5em;
  padding-left: 1.4em;
}

.article-body li {
  margin: 0.42em 0;
}

.article-body li::marker {
  color: var(--faint);
}

.article-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body code {
  padding: 0.14em 0.42em;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-strong);
}

.article-body pre {
  margin: 1.7em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  line-height: 1.7;
}

.article-body pre code {
  padding: 0;
  background: none;
  font-size: 0.84rem;
  color: var(--text);
}

.article-body hr {
  height: 1px;
  margin: 2.6em 0;
  border: 0;
  background: var(--border);
}

.article-body img {
  display: block;
  margin: 1.8em auto;
  border-radius: 8px;
}

.article-body strong {
  font-weight: 650;
  color: var(--text-strong);
}

.article-body em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--mark) 62%);
}

/* 目录 */

.toc {
  position: sticky;
  top: 92px;
  font-size: 0.82rem;
}

.toc-title {
  margin: 0 0 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0 0 0 12px;
  list-style: none;
  border-left: 1px solid var(--border);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -13px;
  border-left: 1px solid transparent;
  color: var(--muted);
  line-height: 1.5;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover {
  color: var(--text-strong);
}

.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc li.depth-3 a {
  padding-left: 24px;
  font-size: 0.78rem;
}

/* 上一篇 / 下一篇 */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.post-nav a {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-nav a:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  color: inherit;
}

.post-nav .label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-bottom: 6px;
}

.post-nav .title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-strong);
}

.post-nav .next {
  text-align: right;
}

.post-nav .empty {
  visibility: hidden;
}

/* ---------- 7. 归档 / 标签 / 关于 ---------- */

.page-head {
  padding: 62px 0 40px;
  border-bottom: 1px solid var(--border);
}

.page-head .kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}

.page-head h1 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.page-head h2 {
  margin-top: 10px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.page-head p {
  margin: 14px 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-body {
  padding: 44px 0 80px;
}

.year-group {
  margin-bottom: 44px;
}

.year-group > h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.year-group > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list li a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 11px 0;
  color: inherit;
  border-bottom: 1px dashed transparent;
}

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

.archive-list .d {
  flex: none;
  width: 44px;
  font-size: 0.78rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.archive-list .t {
  font-size: 0.98rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 40px;
}

.tag-cloud a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.tag-cloud a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-cloud a .n {
  margin-left: 6px;
  color: var(--faint);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.tag-cloud a[aria-current="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.prose-page {
  max-width: var(--reading);
  font-size: 1.02rem;
  line-height: 1.95;
}

.prose-page h2 {
  margin: 2.2em 0 0.8em;
  font-size: 1.35rem;
}

.prose-page h2:first-child {
  margin-top: 0;
}

.prose-page p {
  margin: 0 0 1.4em;
}

.prose-page code {
  padding: 0.14em 0.42em;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-strong);
}

.prose-page ul {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.prose-page li {
  margin: 0.4em 0;
}

.card-box {
  padding: 26px 28px;
  margin: 30px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.card-box h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.card-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- 关于页：署名 ---------- */

.mention {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.prose-page .lead-line {
  margin: 0 0 26px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-strong);
}

.prose-page .note {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--faint);
}

/* 稿件改动提示 */

.edit-note {
  margin: 22px 0 6px;
  padding: 15px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  background: var(--accent-soft);
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--muted);
}

/* 平台链接 */

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 4px;
}

.platform {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-strong);
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.platform:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.platform .brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.platform.is-bili .brand-dot {
  background: #00a1d6;
}

.platform.is-xhs .brand-dot {
  background: #ff2442;
}

.platform .arrow {
  margin-left: 2px;
  font-size: 0.82em;
  color: var(--faint);
}

.platform .handle {
  margin-left: 1px;
  color: var(--muted);
  font-size: 0.86em;
}

.platform:hover .handle {
  color: var(--accent);
}

/* 友情链接 */

.friend-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin: 0 0 4px;
}

.friend-links a {
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.friend-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.friend-links-empty,
.placeholder {
  margin: 0;
  padding: 11px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--faint);
  font-size: 0.84rem;
}

/* 免责声明：带编号的条款块 */

.prose-page .disclaimer {
  list-style: none;
  counter-reset: clause;
  margin: 0 0 1.2em;
  padding: 24px 26px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}

.prose-page .disclaimer li {
  counter-increment: clause;
  position: relative;
  margin: 0 0 13px;
  padding-left: 36px;
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--muted);
}

.prose-page .disclaimer li:last-child {
  margin-bottom: 0;
}

.prose-page .disclaimer li::before {
  content: counter(clause, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.prose-page .disclaimer strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* ---------- 8. 状态 ---------- */

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--faint);
  font-size: 0.95rem;
}

.skeleton {
  display: block;
  height: 13px;
  border-radius: 4px;
  background: var(--bg-soft);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62vh;
  text-align: center;
}

.notfound .code {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  color: var(--border-strong);
}

.notfound h1 {
  margin: 18px 0 10px;
  font-size: 1.5rem;
}

.notfound p {
  margin: 0 0 26px;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 0.9rem;
  background: var(--surface);
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* ---------- 表单（投稿页） ---------- */

.form {
  display: grid;
  gap: 18px;
  margin: 30px 0 8px;
  max-width: 620px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  min-height: 190px;
  line-height: 1.8;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.form-actions .btn {
  cursor: pointer;
  font-family: inherit;
}

.form-hint {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--faint);
  margin: 0;
}

/* ---------- 9. 页脚 ---------- */

.site-footer {
  margin-top: 40px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.82rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: baseline;
  justify-content: space-between;
}

.site-footer .links {
  display: flex;
  gap: 18px;
}

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

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

/* ---------- 10. 响应式 ---------- */

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 40px;
  }

  .toc {
    position: static;
    order: -1;
    margin-bottom: 34px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  .toc ol {
    border-left: 0;
    padding-left: 0;
    columns: 2;
    column-gap: 24px;
  }

  .toc a {
    margin-left: 0;
    border-left: 0;
    padding-left: 0;
  }

  .toc li.depth-3 a {
    padding-left: 12px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .wrap {
    padding: 0 20px;
  }

  .site-header .wrap {
    height: 58px;
    gap: 10px;
  }

  .brand {
    font-size: 1.08rem;
  }

  .site-nav {
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    padding: 6px 9px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .site-nav a[aria-current="page"]::after {
    left: 9px;
    right: 9px;
  }

  .hero {
    padding: 52px 0 38px;
  }

  .featured {
    padding: 24px 20px;
  }

  .post-item > a {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .post-item .date {
    padding-top: 0;
    order: 2;
    font-size: 0.75rem;
  }

  .post-item .excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .article-head {
    margin-bottom: 28px;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.28rem;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav .next {
    text-align: left;
  }

  .post-nav .empty {
    display: none;
  }

  .page-head {
    padding: 44px 0 30px;
  }

  .site-footer .wrap {
    flex-direction: column;
  }

  .toc ol {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .post-nav,
  #progress {
    display: none !important;
  }

  .article-layout {
    display: block;
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- 往期 / 视频 ---------- */

.issue {
  padding: 0 0 48px;
  margin: 0 0 48px;
  border-bottom: 1px solid var(--border);
}

.issue:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.issue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: var(--faint);
}

.issue-no {
  padding: 5px 15px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.issue h3 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.45;
  margin: 0 0 12px;
}

.issue-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.85;
}

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.issue-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-size: 0.86rem;
  color: var(--faint);
}

.issue-foot a {
  color: var(--accent);
}


#home,
#archive,
#submit {
  scroll-margin-top: 84px;
}

a.issue-no {
  color: var(--accent);
  transition: background 0.15s ease, color 0.15s ease;
}

a.issue-no:hover {
  background: var(--accent);
  color: #fff;
}
