/* ============================================================
   泰加 TAIGA —— 森林绿 · 构成主义 · 冷色调
   ============================================================ */

:root {
  --bg: #eef2ec;
  --bg-2: #e5ebe1;
  --surface: #f8faf6;
  --surface-2: #ffffff;
  --text: #17231b;
  --text-soft: #3d4c42;
  --muted: #68776c;
  --line: #d4ddd2;
  --line-strong: #b6c3b6;
  --accent: #2f6b43;
  --accent-deep: #1e4d33;
  --accent-soft: #dbe8dd;
  --accent-2: #c2402f;
  --accent-2-soft: #f2dfdb;
  --sage: #87a08c;
  --grid: rgba(23, 35, 27, 0.035);
  --shadow: 0 1px 2px rgba(23, 35, 27, 0.05), 0 10px 30px rgba(23, 35, 27, 0.07);
  --c-keyword: #b83827;
  --c-string: #2f6b43;
  --c-number: #9a6a1f;
  --c-title: #1c6b8c;
  --c-comment: #87948c;
  --c-builtin: #6f4fa8;
  --radius: 3px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas,
    "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0c120e;
  --bg-2: #101712;
  --surface: #141d17;
  --surface-2: #1a241d;
  --text: #dbe5dd;
  --text-soft: #b7c4bb;
  --muted: #7f8f84;
  --line: #223029;
  --line-strong: #34453b;
  --accent: #7fb48f;
  --accent-deep: #aad0b6;
  --accent-soft: #1c2b21;
  --accent-2: #e0604e;
  --accent-2-soft: #38201c;
  --sage: #5c7866;
  --grid: rgba(219, 229, 221, 0.03);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
  --c-keyword: #e06c5e;
  --c-string: #8fc9a1;
  --c-number: #d9b45f;
  --c-title: #7ec3dd;
  --c-comment: #77867c;
  --c-builtin: #b99adf;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
}

.brand-mark span {
  position: absolute;
  inset: 3px;
  background: var(--accent-2);
}

.brand-text strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.brand-text em {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  padding: 10px 12px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.2s;
}

.site-nav a i {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
  vertical-align: super;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a.is-active {
  color: var(--text);
  font-weight: 700;
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--accent-2);
}

.theme-toggle {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.25s, border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  border-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 36px;
  overflow: hidden;
}

.hero-ring {
  position: absolute;
  top: -70px;
  right: -60px;
  width: 360px;
  height: 360px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  opacity: 0.7;
  pointer-events: none;
}

.hero-ring::before,
.hero-ring::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.hero-ring::before {
  inset: 44px;
}

.hero-ring::after {
  inset: 90px;
}

.hero-slash {
  position: absolute;
  top: 48px;
  right: 150px;
  width: 230px;
  height: 12px;
  background: var(--accent-2);
  transform: rotate(-28deg);
  opacity: 0.9;
  pointer-events: none;
}

.hero-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-kicker .sep {
  color: var(--accent-2);
}

.hero-title {
  margin: 10px 0 18px;
  font-size: clamp(58px, 11vw, 132px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero-title-dot {
  color: var(--accent-2);
}

.hero-desc {
  margin: 0;
  max-width: 58ch;
  color: var(--text-soft);
  font-size: 17px;
}

.hero-rule {
  margin-top: 34px;
  height: 6px;
  width: 130px;
  background: var(--accent);
}

/* ---------- Section ---------- */
.section {
  padding-top: 44px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 12px;
  margin-bottom: 26px;
}

.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.section-title .idx {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-right: 10px;
}

.section-more {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

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

/* ---------- 卡片 ---------- */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.25s;
  margin-bottom: 28px;
}

.featured:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.featured-media {
  position: relative;
  min-height: 240px;
  background: var(--bg-2);
  overflow: hidden;
}

.featured-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured:hover .featured-media img {
  transform: scale(1.04);
}

.featured-geo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, var(--accent) 0, var(--accent) 70px, transparent 71px),
    linear-gradient(135deg, var(--bg-2), var(--accent-soft));
}

.featured-body {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  margin: 12px 0 10px;
  font-size: 28px;
  font-weight: 800;
}

.featured-summary {
  margin: 0 0 16px;
  color: var(--text-soft);
}

.featured-cta {
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.25s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.post-card-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.post-card:hover .post-card-cover img {
  transform: scale(1.05);
}

.post-card-body {
  padding: 18px 20px 20px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.post-card-meta .dot {
  opacity: 0.6;
}

.post-card-title {
  margin: 10px 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.post-card-summary {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ---------- 列表行（归档/标签/分类） ---------- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.post-row time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 86px;
}

.post-row-title {
  flex: 1;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: color 0.2s;
}

.post-row-title:hover {
  color: var(--accent-deep);
}

.post-row-read {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ---------- 页头 ---------- */
.page-head {
  padding: 48px 0 8px;
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
}

.page-title .idx {
  color: var(--accent-2);
  font-size: 0.45em;
  font-weight: 900;
  margin-right: 12px;
  vertical-align: middle;
  letter-spacing: 0.1em;
}

.page-desc {
  color: var(--muted);
  margin: 8px 0 0;
}

/* ---------- 归档 ---------- */
.archive-group {
  margin-top: 36px;
}

.archive-year {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 26px;
  font-weight: 900;
  margin: 0 0 4px;
  color: var(--text);
}

.archive-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---------- 标签云 ---------- */
.tag-cloud {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-cloud-item a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text-soft);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 14px;
  font-size: calc(13px + var(--scale) * 1.2px);
  font-weight: 600;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.tag-cloud-item a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-2px);
}

.tag-count {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---------- 文章详情 ---------- */
.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 0 40px;
}

.post-header {
  margin-bottom: 30px;
}

.post-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.post-kicker .sep {
  color: var(--accent-2);
}

.post-title {
  margin: 16px 0 14px;
  font-size: clamp(30px, 5.5vw, 46px);
  font-weight: 900;
  line-height: 1.15;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.post-cover {
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.post-body {
  font-size: 16.5px;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}

.post-nav > div {
  max-width: 48%;
}

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

.post-nav-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.post-nav a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 600;
}

.post-nav a:hover {
  text-decoration: underline;
}

/* ---------- 正文排版 ---------- */
.typography {
  line-height: 1.9;
  color: var(--text);
}

.typography p {
  margin: 1.1em 0;
}

.typography h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 2.1em 0 0.7em;
  padding-left: 14px;
  border-left: 5px solid var(--accent);
}

.typography h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 1.9em 0 0.6em;
}

.typography h4 {
  font-size: 16px;
  font-weight: 800;
  margin: 1.6em 0 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.typography a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent-deep) 40%, transparent);
}

.typography a:hover {
  text-decoration-color: var(--accent-deep);
}

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

.typography li {
  margin: 0.35em 0;
}

.typography blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--accent-2);
  background: var(--accent-2-soft);
  color: var(--text-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.typography blockquote p {
  margin: 0.3em 0;
}

.typography hr {
  border: none;
  border-top: 1px solid var(--line-strong);
  margin: 2.4em 0;
}

.typography table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.6em 0;
  font-size: 0.95em;
}

.typography th,
.typography td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

.typography th {
  background: var(--accent-soft);
  font-weight: 700;
}

.typography code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0.14em 0.42em;
  border-radius: 3px;
}

.typography pre.hljs {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 1.6em 0;
}

.typography pre.hljs code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: inherit;
}

.typography pre.hljs::before {
  content: attr(data-lang);
  display: block;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag {
  color: var(--c-keyword);
}

.hljs-string,
.hljs-regexp,
.hljs-attr {
  color: var(--c-string);
}

.hljs-number,
.hljs-symbol {
  color: var(--c-number);
}

.hljs-title,
.hljs-title.function_,
.hljs-title.class_ {
  color: var(--c-title);
}

.hljs-comment,
.hljs-quote {
  color: var(--c-comment);
  font-style: italic;
}

.hljs-built_in,
.hljs-type {
  color: var(--c-builtin);
}

/* ---------- 画廊 ---------- */
.typography figure.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 1.8em 0;
}

.typography figure.gallery[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.typography figure.gallery[data-count="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.typography figure.photo {
  margin: 1.8em 0;
}

.gallery-item {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  cursor: zoom-in;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  transition: transform 0.5s ease;
}

.typography figure.photo .gallery-item img {
  aspect-ratio: auto;
  height: auto;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* ---------- 数学公式 ---------- */
.katex-display {
  margin: 1.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.3em 0;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 12, 9, 0.92);
  display: grid;
  place-items: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #cfd8d0;
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: none;
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

/* ---------- 搜索 ---------- */
.search-form {
  display: flex;
  gap: 10px;
  margin: 26px 0 30px;
  max-width: 640px;
}

.search-form input {
  flex: 1;
  padding: 13px 16px;
  font-size: 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-form button {
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.search-form button:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.search-count {
  color: var(--muted);
  font-size: 14px;
}

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

.search-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 4px;
}

.search-item a {
  text-decoration: none;
  color: inherit;
}

.search-item-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.search-item h3 {
  margin: 6px 0 8px;
  font-size: 19px;
  font-weight: 700;
}

.search-item:hover h3 {
  color: var(--accent-deep);
}

.search-snippet {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 42px 0 8px;
}

.page-btn {
  text-decoration: none;
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 9px 18px;
  font-size: 14px;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

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

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

.page-info {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 关于 ---------- */
.about-body {
  max-width: 720px;
  margin-top: 26px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0;
}

/* ---------- 通用 ---------- */
.tag {
  display: inline-block;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.muted {
  color: var(--muted);
}

.link-block {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.link-block:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ---------- 错误页 ---------- */
.error-page {
  padding: 90px 0 110px;
  text-align: center;
}

.error-deco {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 30px;
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.error-deco span {
  position: absolute;
  inset: 18px;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
}

.error-code {
  font-size: clamp(80px, 18vw, 180px);
  font-weight: 900;
  line-height: 0.9;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

.error-msg {
  color: var(--text-soft);
  margin: 0 0 30px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  padding: 52px 0 60px;
}

.footer-mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent);
  margin-bottom: 16px;
  position: relative;
}

.footer-mark::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: var(--accent-2);
}

.footer-tagline {
  color: var(--text-soft);
  margin: 0 0 10px;
}

.footer-meta {
  color: var(--muted);
  font-size: 13px;
}

.footer-col h4 {
  margin: 6px 0 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  display: block;
  margin: 8px 0;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s, transform 0.2s;
}

.footer-col a:hover {
  color: var(--accent-deep);
  transform: translateX(2px);
}

/* ---------- 顶部搜索框 ---------- */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 6px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.header-search-icon {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.header-search input {
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  width: 150px;
}

.header-search input::placeholder {
  color: var(--muted);
}

.header-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.header-search-drop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 62vh;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  padding: 6px;
  z-index: 90;
}

.header-search-drop[hidden] {
  display: none;
}

.drop-hint {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.drop-item {
  display: block;
  padding: 9px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

.drop-item:hover {
  background: var(--accent-soft);
}

.drop-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.drop-item:hover strong {
  color: var(--accent-deep);
}

.drop-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.drop-snippet {
  display: block;
  font-size: 12.5px;
  color: var(--text-soft);
}

.drop-more {
  display: block;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--accent-deep);
  text-decoration: none;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.drop-more:hover {
  text-decoration: underline;
}

/* ---------- 归档侧栏 ---------- */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 44px;
  align-items: start;
  margin-top: 12px;
}

.archive-sidebar {
  position: sticky;
  top: 90px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.sidebar-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
}

.sidebar-title .idx {
  color: var(--accent-2);
  font-size: 10px;
  letter-spacing: 0.24em;
  margin-right: 8px;
  font-weight: 900;
}

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

.tag-bar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  text-decoration: none;
  color: var(--text-soft);
  border-radius: 3px;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

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

.tag-bar a.is-active {
  background: var(--accent);
  color: #fff;
}

.tag-bar a.is-active .tag-bar-count {
  color: rgba(255, 255, 255, 0.85);
}

.tag-bar-name {
  font-weight: 600;
}

.tag-bar-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.tag-bar-clear {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.tag-bar-clear:hover {
  color: var(--accent-2);
}

/* ---------- 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.6, 0.2, 1),
    transform 0.65s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured {
    grid-template-columns: 1fr;
  }
  .featured-media {
    min-height: 200px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .site-nav a i {
    display: none;
  }
  .header-search input {
    width: 110px;
  }
  .archive-layout {
    grid-template-columns: 1fr;
  }
  .archive-sidebar {
    position: static;
    margin-top: 24px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .site-nav {
    gap: 0;
  }
  .site-nav a {
    padding: 10px 7px;
    font-size: 13px;
  }
  .header-search {
    display: none;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }
  .post-row {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .post-row time {
    min-width: 0;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 48px;
  }
  .hero-ring {
    width: 240px;
    height: 240px;
    right: -80px;
  }
}

/* ---------- 文内目录 ---------- */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 44px;
  align-items: start;
}

.post-toc {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  font-size: 13.5px;
}

.toc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.toc-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.toc-progress {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-deep);
}

.toc-nav {
  display: flex;
  flex-direction: column;
}

.toc-item {
  display: block;
  padding: 5px 10px;
  color: var(--text-soft);
  text-decoration: none;
  line-height: 1.5;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.toc-item:hover {
  color: var(--accent-deep);
}

.toc-item.toc-h3 {
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--muted);
}

.toc-item.is-active {
  color: var(--accent-deep);
  border-left-color: var(--accent-2);
  font-weight: 600;
}

/* ---------- 进度条 ---------- */
.read-progress,
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 80;
  pointer-events: none;
}

.read-progress span,
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.1s linear;
}

.read-progress span {
  background: var(--accent);
}

.scroll-progress span {
  background: var(--accent);
}

/* 标题锚点避开吸顶栏 */
.typography h2,
.typography h3,
.typography h4 {
  scroll-margin-top: 92px;
}

/* ---------- 首页下滑提示 ---------- */
.hero-scroll {
  position: absolute;
  right: 24px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.hero-scroll-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  writing-mode: vertical-rl;
}

.hero-scroll-line {
  display: block;
  width: 1px;
  height: 44px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--accent-2);
  animation: heroScroll 1.8s ease-in-out infinite;
}

@keyframes heroScroll {
  0% {
    top: -40%;
  }
  100% {
    top: 110%;
  }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-toc {
    position: static;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
    margin-top: 24px;
  }
  .hero-scroll {
    display: none;
  }
}
