/* =========================================================
   黄帝的技术博客 — 视觉样式
   ========================================================= */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-2: #eef1f6;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-warm: #f3f7ff;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eef4ff;
  --link: #1d4ed8;
  --green: #1f7a3f;
  --danger: #c2381a;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 14px 40px rgba(16, 24, 40, 0.08);
  --shadow-accent: 0 8px 20px rgba(37, 99, 235, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(37, 99, 235, 0.2); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: #d6cec4; color: var(--ink); transform: translateY(-1px); }
.btn-danger {
  background: #fff;
  border-color: #f0c9be;
  color: var(--danger);
}
.btn-danger:hover { background: #fdf1ee; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 10px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag-accent { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; }

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c3cad6;
  display: inline-block;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.24);
}
.brand-text { display: flex; align-items: baseline; gap: 4px; line-height: 1; }
.brand-text strong { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; }
.brand-text span { font-size: 13px; color: var(--muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 100%;
}
.nav-link {
  position: relative;
  height: 100%;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link.is-active { color: var(--ink); font-weight: 600; }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 214px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--faint);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-search:focus-within { border-color: #b9cdf5; background: #fff; }
.nav-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
}
.nav-search input::placeholder { color: var(--faint); }
.nav-search input::-webkit-search-cancel-button { display: none; }

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 9px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span { display: block; height: 1.6px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-search { display: none; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f7faff 0%, #fff 100%);
  border-bottom: 1px solid var(--line-2);
}
.hero::before {
  content: "";
  position: absolute;
  top: -260px;
  left: 50%;
  width: 1000px;
  height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0) 72%);
  pointer-events: none;
}
.hero-orbit {
  position: absolute;
  right: -140px;
  top: 70px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px dashed rgba(37, 99, 235, 0.16);
  pointer-events: none;
}
.hero-orbit::after {
  content: "</>";
  position: absolute;
  left: 30px;
  bottom: 88px;
  font-family: var(--font-mono);
  font-size: 22px;
  color: rgba(37, 99, 235, 0.24);
  letter-spacing: 0.1em;
}
.hero-inner {
  position: relative;
  max-width: 840px;
  padding-top: 92px;
  padding-bottom: 78px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 62px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.hero h1 .accent { color: var(--accent); }
.hero-tagline {
  margin: 22px 0 0;
  font-size: clamp(18px, 2.1vw, 21px);
  font-weight: 550;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.hero-desc {
  max-width: 630px;
  margin: 14px auto 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin: 52px 0 0;
  padding: 0;
}
.hero-stats > div {
  padding: 0 34px;
  text-align: center;
  border-left: 1px solid var(--line);
}
.hero-stats > div:first-child { border-left: 0; }
.hero-stats dd {
  margin: 0;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero-stats dt {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ---------- 通用区块 ---------- */
.section { padding: 82px 0; }
.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.section-heading h2 { margin: 0; }
.section-heading p {
  margin: 9px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}
.section-title {
  position: relative;
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.03em;
  padding-left: 16px;
  line-height: 1.2;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 5px;
  border-radius: 4px;
  background: var(--accent);
}
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--accent-strong);
  white-space: nowrap;
  padding-bottom: 2px;
}
.more-link span { transition: transform 0.18s ease; }
.more-link:hover span { transform: translateX(4px); }

/* ---------- 教程卡片 ---------- */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.tutorial-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.tutorial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.tutorial-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 18px;
  overflow: hidden;
  color: #fff;
}
.tutorial-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 14, 8, 0.02) 30%, rgba(20, 14, 8, 0.3) 100%);
  pointer-events: none;
}
.tutorial-cover::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.tutorial-index {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  opacity: 0.72;
}
.tutorial-glyph {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.12);
}
.tutorial-lang {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tutorial-lines {
  position: absolute;
  right: 18px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0.55;
}
.tutorial-lines i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}
.tutorial-lines i:nth-child(1) { width: 34px; }
.tutorial-lines i:nth-child(2) { width: 22px; }
.tutorial-lines i:nth-child(3) { width: 28px; }

.tutorial-body {
  padding: 17px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tutorial-body h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.tutorial-body p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.tutorial-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--muted);
}
.card-arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 15px;
  transition: transform 0.2s ease;
}
.tutorial-card:hover .card-arrow { transform: translateX(4px); }

.tutorial-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.tutorial-card-lg .tutorial-cover { aspect-ratio: 16 / 8.4; padding: 22px; }
.tutorial-card-lg .tutorial-glyph { font-size: 56px; left: 22px; bottom: 18px; }
.tutorial-card-lg .tutorial-body { padding: 20px 22px 19px; }
.tutorial-card-lg .tutorial-body h3 { font-size: 19px; }
.tutorial-card-lg .tutorial-body p { font-size: 13.5px; min-height: 46px; }

/* ---------- 博客列表 ---------- */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 58px;
  align-items: start;
}
.blog-layout--list { grid-template-columns: minmax(0, 1fr) 300px; gap: 52px; }
.post-list { min-width: 0; }
.post-row {
  display: flex;
  gap: 26px;
  padding: 26px 8px 26px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.post-row:first-child { padding-top: 6px; }
.post-row:hover h3 { color: var(--accent-strong); }
.post-date {
  flex-shrink: 0;
  width: 62px;
  padding-top: 2px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.post-day {
  display: block;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.post-ym {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.03em;
}
.post-main { min-width: 0; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.post-main h3 {
  margin: 8px 0 0;
  font-size: 19.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.015em;
  transition: color 0.15s ease;
}
.post-main p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 侧栏 ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.about-card { text-align: center; }
.avatar {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}
.avatar-sm { width: 40px; height: 40px; font-size: 17px; margin: 0; }
.avatar-xl { width: 96px; height: 96px; font-size: 40px; margin: 0; flex-shrink: 0; }
.about-card h3 { margin: 14px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.side-role { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); }
.side-text { margin: 12px 0 0; font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.side-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
}
.side-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.side-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.side-tutorials, .related-list, .popular-posts, .about-links { list-style: none; margin: 0; padding: 0; }
.side-tutorials li + li, .related-list li + li { border-top: 1px solid var(--line-2); }
.side-tutorials a, .related-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.side-tutorials a:hover, .related-list a:hover { color: var(--accent-strong); }
.side-glyph {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.side-tutorial-name { flex: 1; }
.side-arrow { margin-left: auto; color: var(--faint); font-size: 12px; }
.popular-posts li + li { border-top: 1px solid var(--line-2); }
.popular-posts a {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.popular-posts a:hover { color: var(--accent-strong); }
.popular-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); flex-shrink: 0; padding-top: 2px; }
.side-card--link { background: var(--bg-warm); border-color: #d8e4f7; }

/* ---------- CTA / 页脚 ---------- */
.cta-band {
  background: #0f172a;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.28), transparent 70%);
}
.cta-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 58px;
  padding-bottom: 58px;
}
.cta-kicker { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 0.16em; color: #93c5fd; text-transform: uppercase; }
.cta-inner h2 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.02em; }
.cta-inner p:last-child { margin: 8px 0 0; font-size: 14px; color: #b8c4d6; }

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding-top: 54px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 44px;
}
.footer-brand p { margin: 16px 0 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.footer-col h4 {
  margin: 4px 0 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--accent-strong); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}
.footer-bottom p { margin: 0; font-size: 12.5px; color: var(--faint); }

/* ---------- 页面头部 ---------- */
.page-hero {
  background: linear-gradient(180deg, var(--bg-warm), #fff);
  border-bottom: 1px solid var(--line-2);
  padding: 44px 0 46px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-strong); }
.page-hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.page-desc {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--muted);
}
.page-note { margin: 18px 0 0; font-size: 13px; color: var(--faint); }

.tag-filter { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  transition: all 0.15s ease;
}
.filter-chip span { font-size: 11px; color: var(--faint); }
.filter-chip:hover { border-color: #e3c5b1; color: var(--accent-strong); }
.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-chip.is-active span { color: rgba(255, 255, 255, 0.75); }

.empty-text { color: var(--muted); font-size: 14px; }
.empty-state {
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.empty-title { margin: 0; font-size: 19px; font-weight: 700; }
.empty-state p { color: var(--muted); font-size: 14px; margin: 8px 0 18px; }

/* ---------- 教程详情 ---------- */
.series-hero {
  background: linear-gradient(180deg, var(--bg-warm), #fff);
  border-bottom: 1px solid var(--line-2);
  padding: 40px 0 62px;
}
.series-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 64px;
  align-items: center;
}
.series-info h1 {
  margin: 16px 0 0;
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
}
.series-subtitle { margin: 14px 0 0; font-size: 18px; font-weight: 550; color: var(--ink-2); }
.series-desc { margin: 14px 0 0; font-size: 15px; line-height: 1.85; color: var(--muted); max-width: 620px; }
.series-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.series-info .btn { margin-top: 26px; }

.series-cover {
  position: relative;
  aspect-ratio: 4 / 3.1;
  border-radius: 22px;
  padding: 30px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(45, 33, 20, 0.16);
}
.series-cover::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.series-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 45%);
}
.cover-brand {
  position: absolute;
  top: 26px;
  left: 30px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  opacity: 0.78;
}
.cover-glyph {
  position: absolute;
  left: 28px;
  bottom: 52px;
  font-size: clamp(76px, 9vw, 118px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.06em;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.18);
}
.cover-language { position: absolute; left: 32px; bottom: 26px; font-size: 16px; font-weight: 650; }
.cover-chapters { position: absolute; right: 28px; bottom: 30px; font-size: 10.5px; letter-spacing: 0.12em; opacity: 0.75; }

.series-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 58px;
  align-items: start;
}
.chapter-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.panel-count { font-size: 12.5px; color: var(--faint); }
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-list li + li { border-top: 1px solid var(--line-2); }
.chapter-list a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 19px 26px;
  transition: background 0.15s ease;
}
.chapter-list a:hover { background: var(--bg-warm); }
.chapter-no { font-family: var(--font-mono); font-size: 12px; color: var(--faint); width: 26px; flex-shrink: 0; }
.chapter-info { flex: 1; min-width: 0; }
.chapter-info strong { display: block; font-size: 15.5px; font-weight: 600; }
.chapter-info small {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-meta { font-size: 11.5px; color: var(--faint); flex-shrink: 0; }
.chapter-go { color: var(--accent); font-size: 15px; transition: transform 0.18s ease; }
.chapter-list a:hover .chapter-go { transform: translateX(4px); }
.series-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }
.tips { list-style: none; margin: 0; padding: 0; }
.tips li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* ---------- 阅读页 ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}
.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, var(--accent));
}
.reading-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 186px;
  gap: 50px;
  padding-top: 38px;
  padding-bottom: 92px;
  align-items: start;
}
.chapter-nav {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #d5dbe5 transparent;
}
.chapter-nav::-webkit-scrollbar { width: 4px; }
.chapter-nav::-webkit-scrollbar-thumb { background: #d5dbe5; border-radius: 4px; }
.chapter-nav-series { display: flex; align-items: center; gap: 10px; padding: 2px 0 4px; }
.series-mini-cover {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.chapter-nav-series-text strong { display: block; font-size: 13.5px; line-height: 1.4; }
.chapter-nav-series-text small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.chapter-nav-list { list-style: none; margin: 18px 0 0; padding: 0; border-left: 1px solid var(--line); }
.chapter-nav-list a {
  display: block;
  padding: 8px 10px 8px 13px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.8px;
  line-height: 1.6;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chapter-nav-list a span { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.55; margin-right: 6px; }
.chapter-nav-list a:hover { color: var(--ink); }
.chapter-nav-list a.is-active {
  color: var(--accent-strong);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.article { min-width: 0; max-width: 780px; }
.article-head { margin-bottom: 34px; }
.article-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  text-transform: uppercase;
}
.article h1 {
  margin: 0;
  font-size: clamp(30px, 3.5vw, 37px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.035em;
}
.article-lead {
  margin: 16px 0 0;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--muted);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--faint);
}
.post-shell .article-head { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.post-shell .post-meta .tag { margin-right: 2px; }

/* 正文排版 */
.prose {
  font-size: 16.5px;
  line-height: 1.92;
  color: #2b3444;
  overflow-wrap: break-word;
}
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  position: relative;
  margin: 2.3em 0 0.75em;
  font-size: 25px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-right: 11px;
  border-radius: 3px;
  background: var(--accent);
  vertical-align: -1px;
}
.prose h3 {
  margin: 1.9em 0 0.6em;
  font-size: 19.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose p { margin: 1.05em 0; }
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { color: var(--accent-strong); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { margin: 1.05em 0; padding-left: 1.45em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-warm);
  color: var(--ink-2);
  font-size: 15.5px;
}
.prose blockquote p { margin: 0.35em 0; }
.prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef4ff;
  color: #1d4ed8;
  font-family: var(--font-mono);
  font-size: 0.87em;
  border: 1px solid #dbe6f8;
}
.code-shell { position: relative; margin: 1.55em 0; }
.prose pre.code-block {
  margin: 0;
  padding: 20px 22px;
  border-radius: 12px;
  background: #1e1d23;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.75;
  tab-size: 2;
}
.prose pre.code-block code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  border: 0;
  color: #c8c6d1;
  font-size: inherit;
}
.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfccd8;
  font-size: 11.5px;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.code-shell:hover .code-copy { opacity: 1; }
.code-copy:hover { background: rgba(255, 255, 255, 0.14); }
.table-scroll { overflow-x: auto; margin: 1.6em 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.7;
}
.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { background: #f7f9fc; font-weight: 650; color: var(--ink); }
.prose tbody tr:nth-child(even) { background: #fafbfe; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose img { border-radius: 10px; margin: 1.6em 0; }
.video-block { margin: 1.6em 0; border-radius: 12px; overflow: hidden; background: #0f172a; }
.video-block video { display: block; width: 100%; max-height: 70vh; }
.video-block.video-embed { position: relative; padding-top: 56.25%; }
.video-block.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 代码高亮 */
.hljs-comment, .hljs-quote { color: #7d818c; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #c678dd; }
.hljs-string, .hljs-doctag, .hljs-regexp, .hljs-addition { color: #98c379; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id { color: #61afef; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #d19a66; }
.hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-attribute { color: #e06c75; }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title { color: #e6c07b; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #56b6c2; }
.hljs-params { color: #b8b6c2; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* 目录 */
.toc { position: sticky; top: 96px; }
.toc-inner h3 {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-transform: uppercase;
}
.toc-inner ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc-inner li a {
  display: block;
  padding: 5px 0 5px 13px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-inner li.toc-level-3 a { padding-left: 25px; font-size: 12px; }
.toc-inner li a:hover { color: var(--ink); }
.toc-inner li a.is-active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }
.toc--post .author-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.author-mini strong { display: block; font-size: 13.5px; }
.author-mini p { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); }

/* 上下篇 */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 54px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.pager-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.pager-card:hover { border-color: #b9cdf5; transform: translateY(-2px); }
.pager-label { font-size: 11.5px; color: var(--faint); }
.pager-card strong { font-size: 14px; font-weight: 600; line-height: 1.55; }
.pager-next { text-align: right; }
.pager-disabled { opacity: 0.55; pointer-events: none; background: var(--bg-soft); }
.pager-disabled strong { font-weight: 500; color: var(--muted); }

.mobile-chapters { display: none; }
.related-posts { margin-top: 56px; padding-top: 34px; border-top: 1px solid var(--line); }
.related-posts h2 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.related-card:hover { border-color: #b9cdf5; background: #fff; }
.related-card strong { font-size: 13.5px; line-height: 1.6; }
.related-date { font-size: 11.5px; color: var(--faint); margin-top: auto; }

/* 博客详情 */
.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 780px) 206px;
  gap: 64px;
  justify-content: center;
  padding-top: 38px;
  padding-bottom: 92px;
  align-items: start;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 38px;
}
.page-btn {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
}
.page-btn:hover { border-color: #b9cdf5; color: var(--accent-strong); }
.page-btn.is-disabled { color: var(--faint); background: var(--bg-soft); pointer-events: none; }
.page-numbers { display: flex; gap: 6px; }
.page-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.page-num:hover { background: var(--bg-soft); }
.page-num.is-active { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 搜索 ---------- */
.search-hero { padding-bottom: 40px; }
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin-top: 26px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.search-form svg { color: var(--faint); flex-shrink: 0; }
.search-form input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  min-width: 0;
  padding: 8px 0;
}
.search-form button {
  border: 0;
  border-radius: 9px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.search-form button:hover { background: var(--accent-strong); }
.search-suggestions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: var(--faint); align-items: center; }
.search-suggestions a { color: var(--muted); border-bottom: 1px dashed #cbd3e0; padding-bottom: 1px; }
.search-suggestions a:hover { color: var(--accent-strong); border-color: var(--accent); }
.search-results { max-width: 880px; }
.search-summary { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.search-summary strong { color: var(--ink); }
.result-group { margin-top: 40px; }
.result-group h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.result-group h2 span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
}
.result-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.result-item:hover { background: var(--bg-soft); }
.result-glyph {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.result-date {
  width: 46px;
  flex-shrink: 0;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.result-body { flex: 1; min-width: 0; }
.result-kicker { display: block; font-size: 11.5px; color: var(--faint); }
.result-body strong { display: block; margin-top: 3px; font-size: 16px; font-weight: 650; line-height: 1.5; }
.result-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-arrow { color: var(--faint); padding-top: 10px; font-size: 14px; }

/* ---------- 关于 ---------- */
.about-hero {
  background: radial-gradient(900px 400px at 20% -50px, #e8f1ff, transparent 70%), var(--bg-warm);
  border-bottom: 1px solid var(--line-2);
  padding: 70px 0 62px;
}
.about-hero-inner { display: flex; align-items: center; gap: 42px; }
.about-intro h1 { margin: 0; font-size: clamp(32px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.04em; }
.about-lead { max-width: 680px; margin: 16px 0 0; font-size: 16px; line-height: 1.85; color: var(--muted); }
.about-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.about-chips span {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
}
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 68px;
  align-items: start;
}
.about-content.prose { font-size: 16px; }
.about-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }
.about-facts { margin: 0; }
.about-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.about-facts > div:last-child { border-bottom: 0; }
.about-facts dt { color: var(--muted); }
.about-facts dd { margin: 0; color: var(--ink-2); font-weight: 550; text-align: right; }
.about-links li + li { border-top: 1px solid var(--line-2); }
.about-links a {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
  color: var(--ink-2);
}
.about-links a span { color: var(--accent); }
.about-links a:hover { color: var(--accent-strong); }
.about-mail { margin: 10px 0 0; font-family: var(--font-mono); font-size: 13px; color: var(--accent-strong); }

/* ---------- 错误页 ---------- */
.error-page { padding: 96px 0 120px; }
.error-inner { text-align: center; max-width: 620px; }
.error-code {
  margin: 0;
  font-size: 96px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.06em;
  color: #c7d7ef;
}
.error-inner h1 { margin: 18px 0 0; font-size: 28px; font-weight: 750; letter-spacing: -0.02em; }
.error-desc { margin: 12px auto 0; max-width: 460px; font-size: 14.5px; line-height: 1.8; color: var(--muted); }
.error-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.error-detail {
  margin: 20px auto 0;
  padding: 14px;
  max-width: 560px;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--danger);
  white-space: pre-wrap;
}

/* =========================================================
   后台
   ========================================================= */
.admin-body { background: #f4f6fa; font-size: 14px; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: #0f172a;
  color: #c3ccd9;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 32px; }
.admin-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #aab4c2;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.admin-nav a.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-sidebar-foot { margin-top: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar-foot a, .admin-logout {
  font-size: 12.5px;
  color: #8894a6;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.admin-sidebar-foot a:hover, .admin-logout:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid #eef1f6;
}
.admin-crumb { margin: 0; font-size: 12.5px; color: var(--faint); }
.admin-crumb span { margin: 0 6px; color: #ccd4e0; }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.admin-user-dot { width: 7px; height: 7px; border-radius: 50%; background: #35a05a; }
.admin-content { padding: 30px 32px 60px; max-width: 1320px; width: 100%; }

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-page-head h2 { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -0.02em; }
.admin-page-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }
.admin-actions { display: flex; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: 19px 20px;
  display: flex;
  flex-direction: column;
}
.stat-label { font-size: 11.5px; letter-spacing: 0.06em; color: var(--faint); text-transform: uppercase; }
.stat-value { margin-top: 6px; font-size: 31px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.stat-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.admin-two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-panel {
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  overflow: hidden;
}
.admin-panel-pad { padding: 20px; }
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid #eef1f6;
}
.admin-panel-head--inline { padding: 0 0 14px; margin-bottom: 4px; }
.admin-panel-head h3, .admin-panel-title { margin: 0; font-size: 14.5px; font-weight: 650; }
.admin-panel-head a { font-size: 12.5px; color: var(--accent-strong); }
.admin-panel-title { margin-bottom: 14px; }

/* 数据备份 */
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.backup-stack { display: grid; gap: 18px; }
.backup-card p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.backup-total { font-size: 12px; color: var(--muted); }
.backup-table-name { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.backup-code {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #0f172a;
  border-radius: 8px;
  color: #d7e3f5;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}
.backup-note { margin: 0; font-size: 12px; line-height: 1.75; color: var(--faint); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: #f7f9fc;
  border-bottom: 1px solid #eef1f6;
}
.admin-table td { padding: 13px 20px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fafbfe; }
.admin-table-full { background: #fff; }
.admin-table .ta-right { text-align: right; }
.admin-search {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.admin-search input {
  flex: 1;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  font-size: 13px;
}
.admin-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.op-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: #eef4ff;
  color: #1d4ed8;
}
.op-tag.op-default { background: #f1f4f9; color: #566172; }
.op-tag.op-create { background: #e6f7ea; color: #1f7a3d; }
.op-tag.op-update { background: #fff3e0; color: #c2650a; }
.op-tag.op-delete { background: #fde8e8; color: #b32626; }
.op-tag.op-login { background: #eef4ff; color: #1d4ed8; }
.op-tag.op-logout { background: #f1f4f9; color: #566172; }
.op-tag.op-backup { background: #f3e8ff; color: #7d3fb5; }
.op-tag.op-config { background: #e6f0ff; color: #1d4ed8; }
.target-type {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  font-size: 10.5px;
  color: #566172;
  background: #f1f4f9;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.target-title { font-weight: 600; color: var(--ink); }
.target-id { margin-left: 4px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.log-detail {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
  max-width: 280px;
}
.admin-pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f4f9;
}
.admin-pager a {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e4e7ec;
  color: var(--ink);
  font-size: 13px;
}
.admin-pager a:hover { background: #f3f7ff; border-color: var(--accent); color: var(--accent-strong); }
.admin-pager .pager-info { color: var(--muted); font-size: 12px; }
.admin-title-link { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.admin-title-link:hover { color: var(--accent-strong); }
.admin-slug { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.muted { color: var(--muted); }
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.status-on { background: #eaf5ec; color: var(--green); }
.status-off { background: #eff2f7; color: var(--muted); }
.status-hidden { background: #fdf3e3; color: #b25e09; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.row-actions a, .row-actions button {
  font-size: 12px;
  color: var(--accent-strong);
  border: 0;
  background: none;
  padding: 0;
}
.row-actions a:hover, .row-actions button:hover { text-decoration: underline; text-underline-offset: 2px; }
.row-actions .link-danger { color: var(--danger); }
.row-actions form { display: inline-flex; }

.admin-tutorial-list { list-style: none; margin: 0; padding: 4px 20px 14px; }
.admin-tutorial-list li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f1f4f9; }
.admin-tutorial-list li:last-child { border-bottom: 0; }
.admin-tutorial-name { flex: 1; min-width: 0; }
.admin-tutorial-name a { font-size: 13px; font-weight: 600; color: var(--ink); }
.admin-tutorial-name small { display: block; margin-top: 1px; font-size: 11px; color: var(--faint); }
.admin-tutorial-name a:hover { color: var(--accent-strong); }
.admin-mini-link { font-size: 11.5px; color: var(--accent-strong); flex-shrink: 0; }
.admin-tutorial-cell { display: flex; align-items: center; gap: 10px; }

.admin-form { margin-top: 4px; }
.admin-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.admin-editor-main { display: flex; flex-direction: column; gap: 16px; }
.admin-editor-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 550; color: var(--ink-2); }
.field input[type="text"], .field input[type="number"], .field input[type="datetime-local"], .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.6;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.field .code-input { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 12.5px; color: var(--ink-2); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--accent); }

.admin-chapter-list { list-style: none; margin: 0; padding: 0; }
.admin-chapter-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #f1f4f9;
  font-size: 13px;
}
.admin-chapter-list li:last-child { border-bottom: 0; }
.admin-chapter-no { font-family: var(--font-mono); font-size: 11px; color: var(--faint); width: 22px; }
.admin-chapter-list .row-actions { gap: 10px; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 12.5px;
  border: 1px solid transparent;
}
.flash-success { background: #eef7f0; border-color: #d5ebda; color: var(--green); }
.flash-error { background: #fdf0ed; border-color: #f5d5cc; color: var(--danger); }
.post-preview-notice { background: #fdf3e3; border-color: #f2ddbd; color: #8a5306; }

/* 后台登录 */
.admin-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(800px 480px at 50% -10%, #e6f0ff, transparent 65%), #f2f6fd;
}
.admin-login { width: 100%; max-width: 400px; }
.admin-login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 34px 28px;
  box-shadow: 0 24px 60px rgba(74, 55, 36, 0.1);
}
.admin-login-brand { justify-content: center; }
.admin-login-card h1 { margin: 26px 0 0; font-size: 23px; font-weight: 750; letter-spacing: -0.02em; text-align: center; }
.admin-login-desc { margin: 7px 0 22px; font-size: 12.5px; color: var(--muted); text-align: center; }
.admin-login-form label { display: block; margin-bottom: 14px; }
.admin-login-form label span { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); }
.admin-login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.admin-login-form .btn { margin-top: 6px; }
.admin-login-foot { margin: 18px 0 0; text-align: center; font-size: 12px; }
.admin-login-foot a { color: var(--muted); }
.admin-login-foot a:hover { color: var(--accent-strong); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1120px) {
  .reading-shell { grid-template-columns: 208px minmax(0, 1fr); }
  .reading-shell .toc { display: none; }
  .post-shell { grid-template-columns: minmax(0, 780px); }
  .post-shell .toc { display: none; }
  .series-body { gap: 36px; }
}

@media (max-width: 1024px) {
  .tutorial-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tutorial-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-layout, .blog-layout--list { grid-template-columns: minmax(0, 1fr) 270px; gap: 34px; }
  .series-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 0.7fr); gap: 40px; }
  .about-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 40px; }
  .footer-top { grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
}

@media (max-width: 900px) {
  .tutorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-layout, .blog-layout--list { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .side-card { flex: 1 1 260px; }
  .series-layout { grid-template-columns: minmax(0, 1fr); }
  .series-cover { max-width: 420px; }
  .series-body { grid-template-columns: minmax(0, 1fr); }
  .series-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .series-aside .side-card { flex: 1 1 260px; }
  .about-layout { grid-template-columns: minmax(0, 1fr); }
  .about-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .about-aside .side-card { flex: 1 1 250px; }
  .reading-shell { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .chapter-nav { display: none; }
  .mobile-chapters {
    display: block;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .mobile-chapters summary {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .mobile-chapters summary::-webkit-details-marker { display: none; }
  .mobile-chapters summary::after { content: "▾"; float: right; color: var(--faint); }
  .mobile-chapters[open] summary { border-bottom: 1px solid var(--line-2); }
  .mobile-chapters ol { margin: 0; padding: 8px 16px 12px; list-style: none; }
  .mobile-chapters li a { display: block; padding: 7px 0; font-size: 12.5px; color: var(--muted); }
  .mobile-chapters li.is-active a { color: var(--accent-strong); font-weight: 600; }
  .post-shell { padding-top: 24px; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { display: block; }
  .admin-sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px; }
  .admin-nav { flex-direction: row; margin-top: 0; flex: 1; }
  .admin-sidebar-foot { margin-top: 0; flex-direction: row; padding: 0; gap: 14px; }
  .admin-topbar { padding: 0 20px; }
  .admin-content { padding: 22px 20px 50px; }
  .admin-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-editor-side { position: static; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-two-col { grid-template-columns: minmax(0, 1fr); }
  .backup-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .container, .container-wide { padding: 0 20px; }
  .header-inner { height: 62px; gap: 16px; }
  .brand-text span { display: none; }
  .nav-toggle { display: flex; }
  .nav-search { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(40, 30, 18, 0.06);
    padding: 10px 20px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
  }
  .nav-open .site-nav { display: flex; }
  .nav-link { height: auto; padding: 11px 2px; border-bottom: 1px solid var(--line-2); font-size: 15px; }
  .nav-link.is-active::after { display: none; }
  .mobile-search { display: flex; margin-top: 14px; }
  .mobile-search input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    outline: 0;
    min-width: 0;
  }
  .mobile-search button {
    border: 0;
    border-radius: 8px;
    margin-left: 8px;
    padding: 0 16px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
  }
  .hero-inner { padding-top: 62px; padding-bottom: 56px; }
  .hero h1 { font-size: 40px; }
  .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; margin-top: 40px; }
  .hero-stats > div { border-left: 0; padding: 0 10px; }
  .hero-stats > div:nth-child(even) { border-left: 1px solid var(--line); }
  .hero-orbit { display: none; }
  .section { padding: 58px 0; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .section-title { font-size: 25px; }
  .tutorial-grid, .tutorial-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .tutorial-card-lg .tutorial-body p { min-height: 44px; }
  .tutorial-cover { aspect-ratio: 16 / 11; padding: 14px; }
  .tutorial-glyph { font-size: 38px; left: 14px; bottom: 12px; }
  .tutorial-lang { top: 11px; left: 12px; font-size: 10px; }
  .tutorial-index { top: 12px; right: 13px; }
  .tutorial-lines { display: none; }
  .tutorial-body { padding: 14px; }
  .tutorial-body h3 { font-size: 15.5px; }
  .tutorial-body p { font-size: 12.5px; min-height: 0; -webkit-line-clamp: 2; }
  .tutorial-meta { margin-top: 12px; padding-top: 10px; flex-wrap: wrap; gap: 6px; }
  .post-row { gap: 16px; padding: 20px 0; }
  .post-date { width: 46px; }
  .post-day { font-size: 22px; }
  .post-main h3 { font-size: 17px; }
  .post-main p { font-size: 13px; }
  .cta-inner { flex-direction: column; align-items: flex-start; padding-top: 44px; padding-bottom: 44px; }
  .cta-inner h2 { font-size: 23px; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .page-hero { padding: 30px 0 34px; }
  .breadcrumb { margin-bottom: 16px; }
  .series-hero { padding: 28px 0 42px; }
  .series-layout { gap: 30px; }
  .series-info h1 { font-size: 34px; }
  .series-subtitle { font-size: 16px; }
  .series-cover { aspect-ratio: 16 / 10; width: 100%; }
  .cover-glyph { font-size: 72px; bottom: 42px; }
  .chapter-list a { padding: 16px 18px; gap: 12px; }
  .chapter-info small, .chapter-meta { display: none; }
  .panel-head { padding: 18px; }
  .reading-shell, .post-shell { padding-bottom: 64px; }
  .article h1 { font-size: 28px; }
  .article-lead { font-size: 15.5px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 22px; }
  .prose h3 { font-size: 18px; }
  .prose pre.code-block { font-size: 12.5px; padding: 16px; }
  .pager { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 40px; }
  .pager-next { text-align: left; }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
  .search-form { flex-wrap: wrap; padding: 10px 12px; }
  .search-form input { flex-basis: calc(100% - 36px); }
  .search-form button { width: 100%; margin-top: 4px; }
  .result-date { display: none; }
  .about-hero { padding: 46px 0 42px; }
  .about-hero-inner { flex-direction: column; align-items: flex-start; gap: 22px; }
  .avatar-xl { width: 76px; height: 76px; font-size: 32px; }
  .about-lead { font-size: 15px; }
  .about-aside { flex-direction: column; }
  .admin-page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-table { min-width: 640px; }
  .admin-panel { overflow-x: auto; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { align-items: flex-start; }
  .admin-nav { flex-wrap: wrap; }
  .admin-sidebar-foot { width: 100%; justify-content: space-between; }
}

@media (max-width: 520px) {
  .tutorial-grid, .tutorial-grid-wide { grid-template-columns: minmax(0, 1fr); }
  .tutorial-cover { aspect-ratio: 16 / 8.5; }
  .hero h1 { font-size: 34px; }
  .hero-tagline { font-size: 16.5px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .post-main p { -webkit-line-clamp: 2; }
  .post-meta { gap: 7px; }
  .section-title { font-size: 23px; }
}
