:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-soft: #1f2937;
  --muted: #64748b;
  --accent: #f97316;
  --accent-strong: #ea580c;
  --accent-soft: rgba(255, 237, 213, 0.9);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 244, 230, 0.7);
  --line: rgba(237, 226, 208, 0.85);
  --shadow: 0 40px 90px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.1);
  --page-bg:
    radial-gradient(920px 540px at 8% -10%, rgba(249, 115, 22, 0.18), transparent 60%),
    radial-gradient(820px 460px at 92% 0%, rgba(251, 191, 36, 0.2), transparent 55%),
    radial-gradient(760px 420px at 50% 100%, rgba(255, 255, 255, 0.9), transparent 62%),
    linear-gradient(180deg, #fffaf3 0%, #f7f2ea 42%, #f5f0ea 100%);
  --hero-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 244, 230, 0.94) 55%, rgba(255, 255, 255, 0.98) 100%);
  --chip-bg: rgba(249, 115, 22, 0.16);
  --chip-text: #9a3412;
  --nav-text: #64748b;
  --nav-hover: #ea580c;
  --code-bg: #0b1020;
  --code-border: #1f2937;
  --code-text: #e2e8f0;
  --code-inline-bg: rgba(15, 23, 42, 0.06);
  --code-inline-border: rgba(15, 23, 42, 0.08);
  --code-copy-bg: rgba(15, 23, 42, 0.55);
  --code-copy-border: rgba(148, 163, 184, 0.4);
  --code-copy-hover: rgba(249, 115, 22, 0.22);
  --code-copy-active: rgba(34, 197, 94, 0.2);
  --font-body: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --ink: #e2e8f0;
  --ink-soft: #cbd5f5;
  --muted: #94a3b8;
  --accent: #fb923c;
  --accent-strong: #f97316;
  --accent-soft: rgba(251, 146, 60, 0.18);
  --surface: rgba(15, 23, 42, 0.82);
  --surface-strong: rgba(15, 23, 42, 0.95);
  --surface-soft: rgba(30, 41, 59, 0.65);
  --line: rgba(51, 65, 85, 0.8);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.4);
  --page-bg:
    radial-gradient(840px 520px at 8% -10%, rgba(249, 115, 22, 0.12), transparent 60%),
    radial-gradient(780px 460px at 92% 0%, rgba(251, 191, 36, 0.12), transparent 55%),
    radial-gradient(680px 360px at 50% 100%, rgba(15, 23, 42, 0.75), transparent 62%),
    linear-gradient(180deg, #0b1020 0%, #0f172a 50%, #111827 100%);
  --hero-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.9) 55%, rgba(15, 23, 42, 0.98) 100%);
  --chip-bg: rgba(249, 115, 22, 0.2);
  --chip-text: #fdba74;
  --nav-text: #cbd5f5;
  --nav-hover: #fb923c;
  --code-bg: #0f172a;
  --code-border: #1f2937;
  --code-text: #e2e8f0;
  --code-inline-bg: rgba(148, 163, 184, 0.16);
  --code-inline-border: rgba(148, 163, 184, 0.2);
  --code-copy-bg: rgba(15, 23, 42, 0.7);
  --code-copy-border: rgba(148, 163, 184, 0.35);
  --code-copy-hover: rgba(249, 115, 22, 0.3);
  --code-copy-active: rgba(34, 197, 94, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page-bg);
  min-height: 100vh;
}

::selection {
  background: rgba(249, 115, 22, 0.22);
}

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

a:hover {
  text-decoration: underline;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

html[data-theme='dark'] .site-header {
  background: rgba(15, 23, 42, 0.75);
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(234, 88, 12, 0.8);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--nav-hover);
  text-decoration: none;
}

.theme-toggle {
  position: relative;
  padding: 8px 14px 8px 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle::before {
  content: '🌙';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

html[data-theme='dark'] .theme-toggle::before {
  content: '☀️';
}

.theme-toggle:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

.post-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 16px 80px;
}

.post-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  border-radius: 28px 28px 0 0;
  padding: 42px 36px 34px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.post-hero::before,
.post-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.post-hero::before {
  width: 240px;
  height: 240px;
  right: -90px;
  top: -100px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
  opacity: 0.8;
}

.post-hero::after {
  width: 200px;
  height: 200px;
  left: -80px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.22) 0%, transparent 70%);
  opacity: 0.7;
}

.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

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

.post-title {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.2;
  margin: 18px 0 14px;
  color: var(--ink);
}

.post-excerpt {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}

.post-category {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--chip-bg);
  color: var(--chip-text);
}

.post-body {
  background: var(--surface);
  border-radius: 0 0 28px 28px;
  padding: 36px 34px 42px;
  border: 1px solid var(--line);
  border-top: none;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.post-loading {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  padding: 18px 0;
}

.post-content {
  line-height: 1.85;
  font-size: 17px;
  color: var(--ink);
  word-break: break-word;
}

.post-content-ready {
  animation: fadeIn 0.3s ease-in;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin-top: 34px;
  margin-bottom: 16px;
  color: var(--ink);
}

.post-content p {
  margin-bottom: 18px;
}

.post-content a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(234, 88, 12, 0.35);
  text-underline-offset: 3px;
}

.post-content a:hover {
  text-decoration-color: rgba(234, 88, 12, 0.75);
}

.post-content ul,
.post-content ol {
  padding-left: 1.4rem;
  margin-bottom: 18px;
}

.post-content li + li {
  margin-top: 8px;
}

.post-content blockquote {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 4px solid rgba(249, 115, 22, 0.5);
  background: var(--surface-soft);
  border-radius: 16px;
  color: var(--ink-soft);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

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

.post-content thead {
  background: var(--surface-soft);
}

.post-content img {
  border-radius: 16px;
  margin: 20px 0;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

.post-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-inline-bg);
  border: 1px solid var(--code-inline-border);
  border-radius: 6px;
  padding: 2px 6px;
}

.post-content pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 52px 20px 20px;
  border-radius: 18px;
  overflow-x: auto;
  font-size: 15px;
  border: 1px solid var(--code-border);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  margin: 26px 0;
}

.post-content pre code {
  font-family: var(--font-mono);
  display: block;
}

.post-content pre code.hljs {
  display: block;
  color: var(--code-text);
}

.post-content pre.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 16px;
  left: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.8);
}

.code-copy {
  position: absolute;
  top: 12px;
  right: 14px;
  border-radius: 999px;
  border: 1px solid var(--code-copy-border);
  background: var(--code-copy-bg);
  color: var(--code-text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-copy:hover {
  background: var(--code-copy-hover);
  border-color: rgba(249, 115, 22, 0.45);
  color: #fff;
}

.code-copy.is-copied {
  background: var(--code-copy-active);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.code-copy:disabled {
  cursor: default;
  opacity: 0.75;
}

.post-content pre .hljs-comment,
.post-content pre .hljs-quote {
  color: #94a3b8;
}

.post-content pre .hljs-keyword,
.post-content pre .hljs-selector-tag,
.post-content pre .hljs-type {
  color: #fb7185;
}

.post-content pre .hljs-title,
.post-content pre .hljs-title.function_,
.post-content pre .hljs-title.class_,
.post-content pre .hljs-section {
  color: #a78bfa;
}

.post-content pre .hljs-attr,
.post-content pre .hljs-attribute,
.post-content pre .hljs-symbol,
.post-content pre .hljs-bullet,
.post-content pre .hljs-number,
.post-content pre .hljs-literal {
  color: #38bdf8;
}

.post-content pre .hljs-string,
.post-content pre .hljs-regexp {
  color: #fcd34d;
}

.post-content pre .hljs-built_in,
.post-content pre .hljs-template-tag,
.post-content pre .hljs-template-variable {
  color: #34d399;
}

.post-content pre .hljs-name,
.post-content pre .hljs-tag,
.post-content pre .hljs-selector-class,
.post-content pre .hljs-selector-id {
  color: #22d3ee;
}

.post-content pre .hljs-meta,
.post-content pre .hljs-meta .hljs-keyword {
  color: #f472b6;
}

.post-content pre .hljs-params,
.post-content pre .hljs-subst,
.post-content pre .hljs-operator,
.post-content pre .hljs-punctuation {
  color: #e2e8f0;
}

.post-content pre .hljs-addition {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.post-content pre .hljs-deletion {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.post-noscript {
  margin-top: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 820px) {
  .post-layout {
    padding: 20px 14px 64px;
  }

  .post-hero {
    padding: 32px 24px 26px;
  }

  .post-body {
    padding: 28px 22px 32px;
  }

  .post-title {
    font-size: 30px;
  }

  .post-excerpt {
    font-size: 17px;
  }
}

@media (max-width: 600px) {
  .site-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-content-ready {
    animation: none;
  }
}


.page-shell { padding-bottom: 64px; }
.container { max-width: 1120px; margin: 0 auto; padding: 32px 20px 0; }
.container.narrow { max-width: 840px; }
.hero-panel, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-soft); padding: 28px; margin-bottom: 24px; }
.section-kicker { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-strong); }
.section-title { margin: 0; font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: 1.05; }
.section-description { margin: 16px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.8; max-width: 760px; }
.hero-meta { margin: 16px 0 0; padding: 0; list-style: none; display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.post-list { display: grid; gap: 18px; }
.post-card { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-strong); box-shadow: var(--shadow-soft); }
.post-card-date { color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.post-card-title { margin: 0 0 10px; font-size: 1.5rem; }
.post-card-title a { color: var(--ink); text-decoration: none; }
.post-card-title a:hover { color: var(--accent-strong); }
.post-card-excerpt { margin: 0 0 12px; color: var(--muted); line-height: 1.8; }
.post-card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 0; flex-wrap: wrap; }
.pager-link { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-strong); text-decoration: none; }
.pager-link.is-primary { background: linear-gradient(135deg, #f97316 0%, #fb923c 100%); color: white; border-color: transparent; }
.pager-status { color: var(--muted); font-size: 14px; }
.category-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.category-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-strong); }
.category-item a { color: var(--ink); font-weight: 600; text-decoration: none; }
.category-item span { color: var(--muted); font-size: 14px; }
.search-bar { display: grid; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.search-bar input { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-strong); color: var(--ink); padding: 12px 16px; font: inherit; }
.archive-block-head, .archive-year-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.archive-month-list, .archive-year-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.archive-month-list li, .archive-year-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.archive-month-list li:last-child, .archive-year-item:last-child { border-bottom: 0; }
.article-hero { margin-bottom: 18px; }
.article-meta-line { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.article-body { overflow-wrap: anywhere; }
.prose-block { line-height: 1.85; font-size: 1.05rem; }
.prose-block h2, .prose-block h3, .prose-block h4 { margin-top: 2em; }
.prose-block pre { overflow: auto; padding: 18px; border-radius: 16px; background: var(--code-bg); color: var(--code-text); }
.prose-block code { font-family: var(--font-mono); }
.empty-state { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 22px; }
.site-footer { padding: 32px 20px 56px; }
.site-footer-inner { max-width: 1120px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.site-footer-links { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-link.is-active { color: var(--nav-hover); }
@media (max-width: 900px) {
  .post-card { grid-template-columns: 1fr; }
  .site-header-inner { flex-direction: column; align-items: stretch; }
  .site-actions { justify-content: space-between; }
}
