﻿/* ==========================================================================
   橘子信息无障碍工作室 · 主题样式
   设计原则：柔和暖色 / 圆润控件 / 高对比度 / 键盘友好 / 尊重系统偏好
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: light;

  --bg: #fff9f3;
  --bg-tint: #fdf1e5;
  --surface: #ffffff;
  --surface-2: #fff4ea;
  --text: #241a13;
  --text-soft: #5c4a3d;
  --text-faint: #6f5a4b;
  --border: #f1dfcf;
  --border-strong: #e2c7ae;

  --brand: #b04a0f;
  --brand-hover: #8e3a08;
  --brand-soft: #fce3d0;
  --brand-soft-text: #7a3300;
  --on-brand: #ffffff;
  --accent: #f2a469;
  --focus: #0f6e7a;
  --code-bg: #ffffff;

  --shadow-sm: 0 1px 2px rgba(74, 40, 12, 0.05);
  --shadow-md: 0 2px 4px rgba(74, 40, 12, 0.04), 0 16px 32px -20px rgba(74, 40, 12, 0.35);
  --shadow-lg: 0 4px 8px rgba(74, 40, 12, 0.05), 0 28px 60px -28px rgba(74, 40, 12, 0.45);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

  --container: 1120px;
  --header-h: 76px;
  --header-offset: 122px;
}

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

    --bg: #15100d;
    --bg-tint: #1b1511;
    --surface: #1f1814;
    --surface-2: #261d17;
    --text: #f7ede5;
    --text-soft: #cbb8a8;
    --text-faint: #a99483;
    --border: #33261e;
    --border-strong: #4a3629;

    --brand: #ffb27c;
    --brand-hover: #ffc79e;
    --brand-soft: #3a2417;
    --brand-soft-text: #ffd0ac;
    --on-brand: #2a1505;
    --accent: #f2a469;
    --focus: #7fe0d4;
    --code-bg: #24292e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 36px -22px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.35), 0 32px 64px -28px rgba(0, 0, 0, 0.85);
  }
}

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

  --bg: #15100d;
  --bg-tint: #1b1511;
  --surface: #1f1814;
  --surface-2: #261d17;
  --text: #f7ede5;
  --text-soft: #cbb8a8;
  --text-faint: #a99483;
  --border: #33261e;
  --border-strong: #4a3629;

  --brand: #ffb27c;
  --brand-hover: #ffc79e;
  --brand-soft: #3a2417;
  --brand-soft-text: #ffd0ac;
  --on-brand: #2a1505;
  --accent: #f2a469;
  --focus: #7fe0d4;
  --code-bg: #24292e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 36px -22px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.35), 0 32px 64px -28px rgba(0, 0, 0, 0.85);
}

/* ---------- 基础与重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(60rem 32rem at 50% -12rem, var(--bg-tint), transparent 70%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

a,
button,
input,
summary {
  touch-action: manipulation;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--brand-soft);
  color: var(--brand-soft-text);
}

/* ---------- 可见焦点 ---------- */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- 工具类 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

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

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-200%);
  transition: transform 160ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--on-brand);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.eyebrow .dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.65rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease,
    border-color 160ms ease;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

/* ---------- 站点头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(140%);
}

/* 顶部工具条：字号与深色模式 */
.utility-bar {
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
  padding-block: 2px;
}

.utility-tagline {
  margin: 0;
  color: var(--text-faint);
  letter-spacing: 0.12em;
}

.utility-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.font-control {
  display: flex;
  align-items: center;
  gap: 2px;
}

.font-btn {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.font-btn:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.font-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.font-btn--label,
.font-btn--label:hover {
  min-width: 0;
  padding: 0 0.2rem;
  border-color: transparent;
  background: transparent;
  color: var(--text-faint);
  font-weight: 500;
  cursor: default;
}

.utility-bar .theme-toggle {
  width: 32px;
  height: 32px;
  border-color: transparent;
  background: transparent;
}

.utility-bar .theme-toggle:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.utility-bar .theme-toggle-icon::before {
  font-size: 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 18px);
  min-height: var(--header-h);
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin-right: auto;
  padding: 4px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(140deg, #ffc08a, var(--brand));
  color: #40210a;
  font-size: 1.08rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), var(--shadow-sm);
}

:root[data-theme="dark"] .brand-mark {
  color: #2a1505;
}

.site-nav {
  margin-right: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  color: var(--text-soft);
  font-size: 0.97rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-soft-text);
  font-weight: 600;
}

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

.nav-link--accent[aria-current="page"] {
  color: var(--brand-soft-text);
}

/* 下拉分类 */
.dropdown {
  position: relative;
}

.dropdown summary {
  list-style: none;
}

.dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown[open] > summary {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown-arrow {
  font-size: 0.7em;
  transition: transform 160ms ease;
}

.dropdown[open] .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 15rem;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.dropdown-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-xs);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
}

.dropdown-list a:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.dropdown-empty {
  padding: 0.6rem 0.8rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.pill-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 搜索 ---------- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  cursor: text;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.search-icon {
  flex: 0 0 auto;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: clamp(8rem, 13vw, 12rem);
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.95rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.search-input:focus {
  outline: none;
}

.search-kbd {
  flex: 0 0 auto;
  padding: 0.1em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.5;
  pointer-events: none;
}

.search-submit {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.search-submit:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-soft-text);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--brand);
  border-color: var(--brand);
}

.theme-toggle-icon::before {
  content: "☾";
  font-size: 1.15rem;
  line-height: 1;
}

:root[data-theme="dark"] .theme-toggle-icon::before {
  content: "☀";
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-icon::before {
    content: "☀";
  }
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 搜索结果面板 */
.search-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  max-height: min(70vh, 34rem);
  overflow-y: auto;
}

.search-panel-inner {
  padding-block: 1.25rem 1.5rem;
}

.search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.search-status {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.search-close {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  min-height: 36px;
  padding: 0 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.search-close:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-soft-text);
}

.search-panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.search-all {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.search-all:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.search-results {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-result a {
  display: block;
  padding: 0.6rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
}

.search-result a:hover,
.search-result a:focus-visible {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.search-result-title {
  display: block;
  font-weight: 600;
  line-height: 1.45;
}

.search-result-snippet {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.88rem;
  line-height: 1.65;
}

.search-results mark {
  padding: 0 0.15em;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-soft-text);
  font-weight: 700;
}

.search-help {
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.search-help kbd,
.search-panel-foot kbd,
.search-page kbd {
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.78em;
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(1.75rem, 4vw, 3rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-title {
  margin-bottom: 1rem;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.hero-lead {
  max-width: 34em;
  margin-bottom: 1.75rem;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-actions--center {
  justify-content: center;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 4vw, 2.75rem);
  margin: 2.25rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-strong);
}

.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.hero-stats dt {
  color: var(--text-faint);
  font-size: 0.83rem;
  letter-spacing: 0.03em;
}

.hero-stats dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 装饰卡片（纯视觉，已 aria-hidden） */
.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 22rem;
}

.hero-stage {
  position: relative;
  width: clamp(14rem, 22vw, 17rem);
}

.hero-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #ffe4cd 0%, #ffc79b 55%, #f2a469 100%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: rotate(-4deg);
}

.hero-orange {
  font-size: clamp(5rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  background: linear-gradient(150deg, #b04a0f, #7a3300);
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0.9;
}

.hero-card-tag {
  position: absolute;
  bottom: 1.1rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  color: #7a3300;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-bubble {
  position: absolute;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.hero-bubble--one {
  top: -0.25rem;
  right: -2.5rem;
  transform: rotate(5deg);
}

.hero-bubble--two {
  bottom: 1rem;
  left: -2.75rem;
  transform: rotate(-5deg);
}

.hero-bubble--three {
  top: 44%;
  left: -3.25rem;
  transform: rotate(3deg);
}

/* ---------- 通用区块 ---------- */
.section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--tight {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.section--tint {
  background: linear-gradient(180deg, transparent, var(--bg-tint) 18%, var(--bg-tint) 82%, transparent);
}

.section--center {
  text-align: center;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.section-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.35rem 0.2rem;
  color: var(--brand);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.link-more .arrow,
.link-more span[aria-hidden] {
  transition: transform 160ms ease;
}

.link-more:hover .arrow,
.link-more:hover span[aria-hidden] {
  transform: translateX(3px);
}

.empty-state {
  padding: 2.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  color: var(--text-faint);
  text-align: center;
}

/* ---------- 文章列表 ---------- */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.post-item {
  padding-block: clamp(1.4rem, 3vw, 2.1rem);
  border-bottom: 1px solid var(--border);
}

.post-item-top {
  margin: 0 0 0.55rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.18rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-soft-text);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}

.chip--link:hover {
  background: var(--brand);
  color: var(--on-brand);
}

.chip--pinned {
  background: var(--brand);
  color: var(--on-brand);
}

.post-item-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.35;
}

.post-item-title a {
  color: var(--text);
  text-decoration: none;
}

.post-item-title a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

.post-item-desc {
  max-width: 60ch;
  margin: 0 0 0.65rem;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.75;
}

.post-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0;
  color: var(--text-faint);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

/* 置顶文章区 */
.pinned-box {
  margin-bottom: clamp(1.8rem, 4vw, 2.75rem);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-tint));
  box-shadow: var(--shadow-sm);
}

.pinned-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.pinned-heading::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}

.pinned-box .post-list {
  border-top: 0;
}

.pinned-box .post-item {
  padding-block: 1rem;
}

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

/* 分类胶囊列表 */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list--large .chip {
  padding: 0.55rem 1.1rem;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.chip-list--large .chip:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-soft-text);
}

.chip-list--inline {
  display: inline-flex;
  gap: 0.4rem;
  vertical-align: middle;
}

.chip-list--inline .chip {
  padding: 0.08rem 0.6rem;
  font-size: 0.76rem;
}

/* 赞赏横幅 */
.support-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(28rem 16rem at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.support-band-copy {
  max-width: 44rem;
}

.support-band-copy p:last-child {
  margin-bottom: 0;
  color: var(--text-soft);
}

.support-band .section-title {
  margin-bottom: 0.6rem;
}

/* ---------- 页头 ---------- */
.page-head {
  position: relative;
  padding-block: clamp(2rem, 4vw, 3.25rem) clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-tint), transparent);
}

.page-head-inner {
  max-width: 56rem;
}

.page-title {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-lead {
  max-width: 42em;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.4vw, 1.08rem);
}

.page-intro {
  margin-top: 1rem;
  color: var(--text-soft);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45em;
  margin-bottom: 0.9rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* ---------- 文章页（大卡片） ---------- */
.article-page {
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem);
}

.article-card {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1.25rem, 4vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}

.article-card-title {
  margin-bottom: 0.85rem;
  font-size: clamp(1.75rem, 4.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: clamp(1.25rem, 3vw, 1.75rem);
  border-bottom: 1px dashed var(--border-strong);
  color: var(--text-faint);
  font-size: 0.88rem;
}

.article-card-body {
  max-width: 100%;
}

.article-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid var(--border);
}

.article-card-footer .btn {
  min-height: 44px;
  padding-inline: 1.15rem;
  font-size: 0.92rem;
}

/* ---------- 文章页 ---------- */
.page-head--article {
  border-bottom: 0;
  background: none;
  padding-block: clamp(1.75rem, 4vw, 3rem) 0.5rem;
}

.article-head-inner {
  max-width: 52rem;
}

.article-title {
  margin-bottom: 0.75rem;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.article-lead {
  max-width: 40em;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.5vw, 1.12rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border-strong);
  color: var(--text-faint);
  font-size: 0.88rem;
}

.meta-sep {
  color: var(--border-strong);
}

.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, 46rem) 15rem;
  gap: clamp(2rem, 5vw, 4rem);
  justify-content: center;
  padding-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem);
}

.article-wrap--plain {
  grid-template-columns: minmax(0, 46rem);
}

.article-aside {
  order: 2;
}

.toc {
  position: sticky;
  top: calc(var(--header-offset) + 8px);
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.toc-title {
  margin: 0 0 0.6rem;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  line-height: 1.6;
}

.toc-list .toc-list {
  margin-top: 0.3rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
}

.toc-list li + li {
  margin-top: 0.35rem;
}

.toc-list a {
  display: block;
  padding: 0.18rem 0;
  color: var(--text-soft);
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.article-body {
  min-width: 0;
}

.article-footer {
  max-width: 46rem;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.article-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-tags {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.post-nav-item:hover {
  border-color: var(--brand);
  color: var(--text);
  transform: translateY(-2px);
}

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

.post-nav-label {
  color: var(--text-faint);
  font-size: 0.8rem;
}

.post-nav-title {
  font-weight: 600;
  line-height: 1.45;
}

/* ---------- 正文排版 ---------- */
.prose {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.85;
}

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

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  scroll-margin-top: var(--header-offset);
}

.prose h2 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.5rem;
}

.prose h3 {
  font-size: 1.22rem;
}

.prose h4 {
  font-size: 1.06rem;
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 1.15em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--brand);
}

.prose strong {
  font-weight: 700;
}

.prose a {
  text-decoration: underline;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2);
  color: var(--text-soft);
}

.prose blockquote > *:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose pre {
  margin: 1.5em 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
  line-height: 1.65;
  tab-size: 2;
}

/* Zola 的代码高亮用 light-dark() 输出，需要让代码块跟随站点主题而不是只看系统 */
:root[data-theme="light"] .prose pre {
  color-scheme: light !important;
}

:root[data-theme="dark"] .prose pre {
  color-scheme: dark !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose pre {
    color-scheme: dark !important;
  }
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.87rem;
}

/* 代码块工具栏：复制 / 展开收起 */
.code-block {
  position: relative;
  margin: 1.5em 0;
}

.code-block pre {
  margin: 0;
}

.code-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.code-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.code-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-soft-text);
}

.code-block.is-collapsed pre {
  max-height: 9.4rem;
  overflow-y: hidden;
}

.code-block.is-collapsed::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  left: 1px;
  height: 2.5rem;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: linear-gradient(to bottom, transparent, var(--code-bg, var(--surface)));
  pointer-events: none;
}

.prose img {
  display: block;
  margin: 1.75em auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose kbd {
  padding: 0.1em 0.45em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.prose table {
  display: block;
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--surface-2);
  font-weight: 600;
}

.prose :target {
  scroll-margin-top: var(--header-offset);
}

/* ---------- 分类总览 ---------- */
.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.term-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.term-name {
  font-size: 1.12rem;
  font-weight: 700;
}

.term-count {
  color: var(--text-faint);
  font-size: 0.86rem;
}

.term-arrow {
  margin-top: 0.6rem;
  color: var(--brand);
}

/* ---------- 赞赏页 ---------- */
.page-head--support {
  border-bottom: 0;
  background: none;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 22rem));
  justify-content: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 46rem;
  margin-inline: auto;
}

.support-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.support-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  font-size: 1.05rem;
}

.support-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
}

.support-dot--wechat {
  background: #1aad19;
}

.support-dot--alipay {
  background: #1677ff;
}

.qr {
  display: grid;
  place-items: center;
  gap: 0.3rem;
  width: min(100%, 13rem);
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--surface-2);
}

img.qr {
  object-fit: contain;
  border: 1px solid var(--border);
}

.qr--placeholder {
  padding: 1rem;
  border: 2px dashed var(--border-strong);
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.6;
}

.qr-placeholder-title {
  color: var(--text-soft);
  font-weight: 600;
}

.support-card-hint {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.86rem;
}

.support-note {
  max-width: 46rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
}

.notice {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ---------- 搜索页 ---------- */
.search-page {
  max-width: 46rem;
}

.search-page-form {
  margin-bottom: 1.5rem;
}

.search-page-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
}

.search-page-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.search-page-row .search-input {
  flex: 1 1 14rem;
  width: auto;
  min-height: 48px;
  padding: 0 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
}

.search-page-row .search-input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.search-results--page .search-result a {
  padding: 1rem 1.15rem;
  border-color: var(--border);
  background: var(--surface);
}

.search-results--page .search-result + .search-result {
  margin-top: 0.6rem;
}

.search-results--page .search-result-title {
  font-size: 1.05rem;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 0.75rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-num {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

a.page-num:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.page-num--current {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.page-gap {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  color: var(--text-faint);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.page-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.page-btn--disabled {
  opacity: 0.5;
  cursor: default;
}

.page-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* 页码跳转 */
.page-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.page-jump-input {
  width: 4.25rem;
  min-height: 42px;
  padding: 0 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  text-align: center;
}

.page-jump-btn {
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.page-jump-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-soft-text);
}

.page-jump-error {
  flex-basis: 100%;
  margin: 0;
  color: #b42318;
  font-size: 0.82rem;
  text-align: center;
}

:root[data-theme="dark"] .page-jump-error {
  color: #ffb4a8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-jump-error {
    color: #ffb4a8;
  }
}

/* ---------- 页脚 ---------- */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-tint);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  padding-block: 2rem 1.75rem;
  text-align: center;
}

.footer-follow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.footer-follow-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-qr {
  width: 132px;
  height: auto;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.copyright {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.88rem;
}

/* ---------- 404 ---------- */
.not-found {
  max-width: 40rem;
  padding-block: clamp(3rem, 10vw, 7rem);
}

.not-found .page-lead {
  margin-inline: auto;
  margin-bottom: 2rem;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    order: 2;
    min-height: 15rem;
    margin-top: 0.5rem;
  }

  .hero-stage {
    width: 11.5rem;
  }

  .article-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-aside {
    display: none;
  }
}

@media (max-width: 1120px) {
  .site-header {
    position: static;
    background: var(--bg);
    backdrop-filter: none;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 12px;
  }

  .search-field {
    height: 48px;
  }

  .search-input {
    font-size: 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    order: 5;
    width: 100%;
    margin: 0;
    padding-top: 4px;
  }

  .site-nav[data-open="true"] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }

  .nav-link {
    justify-content: space-between;
    border-radius: var(--r-sm);
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown > summary {
    width: 100%;
  }

  .dropdown-list {
    position: static;
    min-width: 0;
    margin: 0.3rem 0 0.5rem;
    padding: 6px;
    box-shadow: none;
    background: var(--surface-2);
  }

  .header-tools {
    order: 4;
    width: 100%;
  }

  .search-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .search-field {
    flex: 1 1 auto;
    min-width: 0;
  }

  .search-input {
    width: 100%;
  }

  .search-kbd {
    display: none;
  }
}

@media (max-width: 420px) {
  .footer-qr {
    width: 112px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }

  .utility-tagline {
    display: none;
  }

  .brand-name {
    font-size: 0.95rem;
    white-space: nowrap;
    max-width: none;
  }

  .brand {
    gap: 0.5rem;
  }

  .nav-toggle {
    padding: 0 0.7rem;
  }

  .nav-toggle-text {
    display: none;
  }

  .search-submit {
    padding: 0 0.9rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .hero-bubble--two,
  .hero-bubble--three {
    display: none;
  }

  .article-card {
    border-radius: var(--r-lg);
  }

  .article-page {
    padding-top: 1rem;
  }

  .article-footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

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

/* ---------- 偏好：减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .post-card-link:hover,
  .btn:hover,
  .term-card:hover,
  .post-nav-item:hover,
  .brand:hover {
    transform: none;
  }
}

/* ---------- 偏好：更高对比度 ---------- */
@media (prefers-contrast: more) {
  :root {
    --text-soft: #3d2f25;
    --text-faint: #4a382b;
    --border: #c9a887;
    --border-strong: #a97d55;
  }

  :root[data-theme="dark"] {
    --text-soft: #f0e2d6;
    --text-faint: #dccbbd;
    --border: #6b543f;
    --border-strong: #8d7156;
  }

  .post-card-link,
  .term-card,
  .search-field,
  .btn-ghost {
    border-width: 2px;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .post-nav,
  .article-aside,
  .hero-actions,
  .pagination {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .article-wrap {
    display: block;
  }

  .article-body a {
    color: #000;
  }
}
