@charset "UTF-8";
/*!
 * IT365 · 技术知识库主题
 * 明亮卡片式设计，支持深浅色切换
 * 无外部依赖，不加载任何 CDN 资源
 */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */

:root {
  /* 尺寸与节奏 */
  --wrap: 1200px;
  --gap: 28px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --transition: .18s ease;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 分类强调色 */
  --c1: #1668dc;
  --c2: #0d9d9d;
  --c3: #7c4dff;
  --c4: #d4380d;
  --c5: #389e0d;
  --c6: #c47d00;
}

/* 浅色（默认） */
:root:not([data-theme="dark"]),
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f7fa;
  --bg-soft: #eef2f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --text: #1f2937;
  --text-strong: #0f1729;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border: #e5e9ef;
  --border-strong: #d3dae3;

  --brand: #1668dc;
  --brand-strong: #0f52b0;
  --brand-soft: #e9f2fe;
  --brand-inverse: #ffffff;

  --code-bg: #10161f;
  --code-text: #d7e2ee;
  --code-inline-bg: #eef2f7;
  --code-inline-text: #b02a37;

  --shadow-1: 0 1px 2px rgba(15, 23, 41, .06), 0 1px 3px rgba(15, 23, 41, .04);
  --shadow-2: 0 10px 28px -12px rgba(15, 23, 41, .22), 0 2px 8px rgba(15, 23, 41, .06);

  --hero-from: #e9f2fe;
  --hero-to: #f2fbfa;
}

/* 深色：跟随系统 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0f1319;
    --bg-soft: #131922;
    --surface: #171d26;
    --surface-2: #1b222c;
    --text: #cfd8e3;
    --text-strong: #eef3fa;
    --text-muted: #93a1b3;
    --text-faint: #6b7789;
    --border: #242e3c;
    --border-strong: #33405a;

    --brand: #4c9aff;
    --brand-strong: #7ab6ff;
    --brand-soft: #16273f;
    --brand-inverse: #0b1220;

    --code-bg: #0b1017;
    --code-text: #cfd8e3;
    --code-inline-bg: #1e2733;
    --code-inline-text: #ff9a9a;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 12px 30px -14px rgba(0, 0, 0, .8);

    --hero-from: #14243b;
    --hero-to: #10222a;

    --c1: #4c9aff;
    --c2: #35cccc;
    --c3: #a78bfa;
    --c4: #ff7a45;
    --c5: #52c41a;
    --c6: #f0a020;
  }
}

/* 深色：手动指定 */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1319;
  --bg-soft: #131922;
  --surface: #171d26;
  --surface-2: #1b222c;
  --text: #cfd8e3;
  --text-strong: #eef3fa;
  --text-muted: #93a1b3;
  --text-faint: #6b7789;
  --border: #242e3c;
  --border-strong: #33405a;

  --brand: #4c9aff;
  --brand-strong: #7ab6ff;
  --brand-soft: #16273f;
  --brand-inverse: #0b1220;

  --code-bg: #0b1017;
  --code-text: #cfd8e3;
  --code-inline-bg: #1e2733;
  --code-inline-text: #ff9a9a;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 12px 30px -14px rgba(0, 0, 0, .8);

  --hero-from: #14243b;
  --hero-to: #10222a;

  --c1: #4c9aff;
  --c2: #35cccc;
  --c3: #a78bfa;
  --c4: #ff7a45;
  --c5: #52c41a;
  --c6: #f0a020;
}

/* 分类强调色映射 */
.accent-1 { --accent: var(--c1); }
.accent-2 { --accent: var(--c2); }
.accent-3 { --accent: var(--c3); }
.accent-4 { --accent: var(--c4); }
.accent-5 { --accent: var(--c5); }
.accent-6 { --accent: var(--c6); }

/* ==========================================================================
   2. 基础
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

:target { scroll-margin-top: 84px; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.35;
}

p { margin: 0; }
ul, ol { margin: 0; }

button { font: inherit; cursor: pointer; }

::selection { background: var(--brand); color: var(--brand-inverse); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

/* ==========================================================================
   3. 布局骨架
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap);
  padding-block: 32px 48px;
  align-items: start;
}

.layout__main { min-width: 0; }

/* ==========================================================================
   4. 顶部导航
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

@supports ((backdrop-filter: blur(1px))) {
  .site-header {
    background-color: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    backdrop-filter: saturate(1.6) blur(12px);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brand:hover { color: var(--brand); }

.brand__mark {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding-inline: 4px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--c2));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.06em;
}

.site-footer__brand .brand__mark { margin-right: 8px; vertical-align: -6px; }

.brand__logo { max-height: 32px; display: block; }

.site-nav { flex: 1; min-width: 0; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu li { list-style: none; }

.nav-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition), background-color var(--transition);
}

.nav-menu a:hover {
  color: var(--brand);
  background-color: var(--bg-soft);
}

.nav-menu a.is-active {
  color: var(--brand);
  background-color: var(--brand-soft);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 搜索框 */
.search { position: relative; display: flex; align-items: center; }

.search__icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.search__input {
  width: 190px;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition),
              width var(--transition), background-color var(--transition);
}

.search__input::placeholder { color: var(--text-faint); }

.search__input:focus {
  width: 240px;
  outline: none;
  border-color: var(--brand);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition),
              background-color var(--transition), transform var(--transition);
}

.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background-color: var(--brand-soft);
}

.icon-btn:active { transform: scale(.94); }

.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.nav-toggle { display: none; }

/* ==========================================================================
   5. 首页横幅
   ========================================================================== */

.hero {
  background-image: linear-gradient(135deg, var(--hero-from), var(--hero-to) 70%);
  border-bottom: 1px solid var(--border);
}

.hero__inner { padding-block: 44px 40px; }

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

.hero__title {
  max-width: 22em;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  letter-spacing: -.015em;
}

.hero__desc {
  max-width: 46em;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 15.5px;
}

.hero__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

/* 分类胶囊 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition),
              box-shadow var(--transition);
}

.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent, var(--brand));
}

.chip:hover {
  color: var(--accent, var(--brand));
  border-color: var(--accent, var(--brand));
  box-shadow: var(--shadow-1);
}

.chip__count {
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-soft);
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   6. 文章卡片列表
   ========================================================================== */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background-color: var(--accent, var(--brand));
  opacity: .85;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.entry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background-color: color-mix(in srgb, var(--accent, var(--brand)) 12%, var(--surface));
  color: var(--accent, var(--brand));
  font-size: 12px;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition);
}

.badge:hover {
  background-color: var(--accent, var(--brand));
  color: #fff;
}

.entry-title {
  font-size: 1.32rem;
  letter-spacing: -.01em;
}

.entry-title a { color: var(--text-strong); }
.entry-title a:hover { color: var(--brand); }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 10px 0 0;
  padding: 0;
  color: var(--text-faint);
  font-size: 13px;
  list-style: none;
}

.entry-meta li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
}

.entry-meta li::before {
  content: "";
  width: 13px;
  height: 13px;
  background-color: currentColor;
  opacity: .7;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.meta-date::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E");
}

.meta-author::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}

.meta-reading::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E");
}

.meta-comments::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a8 8 0 0 1-8 8H7l-4 3V12a8 8 0 0 1 8-8h2a8 8 0 0 1 8 8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a8 8 0 0 1-8 8H7l-4 3V12a8 8 0 0 1 8-8h2a8 8 0 0 1 8 8z'/%3E%3C/svg%3E");
}

.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--brand); }

.card__excerpt {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14.8px;
  line-height: 1.8;
}

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
}

.card__more svg {
  width: 15px;
  height: 15px;
  transition: transform var(--transition);
}

.card__more:hover svg { transform: translateX(3px); }

/* 归档页头部 */
.archive-header { margin-bottom: 22px; }

.archive-header__eyebrow {
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.archive-title {
  font-size: 1.6rem;
  letter-spacing: -.015em;
}

.archive-title .mark {
  padding: 0 4px;
  border-radius: 4px;
  background-color: var(--brand-soft);
  color: var(--brand);
}

.archive-header__desc {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.archive-header__count {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 13.5px;
}

.archive-header__count strong { color: var(--brand); }

/* ==========================================================================
   7. 文章详情
   ========================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-faint);
  font-size: 13px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb__sep { color: var(--border-strong); }
.breadcrumb__current {
  overflow: hidden;
  max-width: 32em;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.entry {
  position: relative;
  padding: 28px 30px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
}

.entry::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background-color: var(--accent, var(--brand));
  opacity: .9;
}

.entry-header { margin-bottom: 20px; }

.entry .entry-title { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }

/* 目录 */
.toc {
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-soft);
}

.toc__summary {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.toc__summary::-webkit-details-marker { display: none; }

.toc__summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border: 5px solid transparent;
  border-left-color: var(--brand);
  transform-origin: 30% 50%;
  transition: transform var(--transition);
}

.toc[open] .toc__summary::before { transform: rotate(90deg); }

.toc__list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc__list a {
  display: block;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 13.8px;
  line-height: 1.5;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: color var(--transition), border-color var(--transition);
}

.toc__list a:hover,
.toc__list a.is-active {
  color: var(--brand);
  border-left-color: var(--brand);
}

.toc__list .toc__item--h3 a { padding-left: 24px; font-size: 13.2px; }

/* 正文排版 */
.entry-content {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text);
  word-wrap: break-word;
}

.entry-content > * + * { margin-top: 18px; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 34px;
  scroll-margin-top: 84px;
}

.entry-content h2 {
  padding-left: 12px;
  border-left: 4px solid var(--accent, var(--brand));
  font-size: 1.32em;
}

.entry-content h3 { font-size: 1.13em; }
.entry-content h4 { font-size: 1.02em; color: var(--text); }

.entry-content a {
  color: var(--brand);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  transition: border-color var(--transition), color var(--transition);
}

.entry-content a:hover {
  border-bottom-color: var(--brand);
  color: var(--brand-strong);
}

.entry-content strong { color: var(--text-strong); }

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content li + li { margin-top: 7px; }

.entry-content ul li::marker { color: var(--accent, var(--brand)); }
.entry-content ol li::marker { color: var(--brand); font-weight: 600; }

.entry-content blockquote {
  margin: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent, var(--brand));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background-color: var(--bg-soft);
  color: var(--text-muted);
}

.entry-content blockquote > * + * { margin-top: 12px; }

.entry-content hr {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background-color: var(--border);
}

.entry-content img {
  display: block;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}

.entry-content figcaption {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

/* 行内代码 */
.entry-content :not(pre) > code {
  padding: .14em .4em;
  border-radius: 5px;
  background-color: var(--code-inline-bg);
  color: var(--code-inline-text);
  font-family: var(--font-mono);
  font-size: .875em;
}

/* 代码块 */
.entry-content pre {
  position: relative;
  margin: 0;
  padding: 40px 18px 18px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background-color: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 13.6px;
  line-height: 1.75;
  tab-size: 4;
  /* 关闭连字，避免 -- 被渲染成长横线等误导性显示 */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

.entry-content pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* 评论中的代码同样处理 */
.comment-content :not(pre) > code {
  padding: .14em .4em;
  border-radius: 5px;
  background-color: var(--code-inline-bg);
  color: var(--code-inline-text);
  font-family: var(--font-mono);
  font-size: .875em;
}

.comment-content pre {
  margin: 12px 0;
  padding: 14px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background-color: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

/* 代码块顶部条（由脚本补齐语言标签与复制按钮） */
.code-bar {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding-inline: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.code-bar__lang {
  color: rgba(255, 255, 255, .42);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.code-copy {
  padding: 2px 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, .6);
  font-size: 11.5px;
  transition: color var(--transition), border-color var(--transition);
}

.code-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.code-copy.is-done { color: #52c41a; border-color: #52c41a; }

/* 表格 */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.entry-content th,
.entry-content td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.entry-content th {
  background-color: var(--bg-soft);
  color: var(--text-strong);
  font-weight: 600;
}

.entry-content tbody tr:nth-child(even) { background-color: var(--surface-2); }

/* 标签 */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.entry-tags-label {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 3px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: 12.8px;
  transition: color var(--transition), border-color var(--transition),
              background-color var(--transition);
}

.tag:hover {
  color: var(--brand);
  border-color: var(--brand);
  background-color: var(--brand-soft);
}

.entry-updated {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
}

/* 上一篇 / 下一篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.post-nav__item {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.post-nav__item:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }

.post-nav__item--next { text-align: right; }

.post-nav__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.post-nav__item a { color: var(--text); font-size: 14.5px; font-weight: 500; }
.post-nav__item a:hover { color: var(--brand); }
.post-nav__none { color: var(--text-faint); font-size: 14px; }

.divider {
  height: 1px;
  margin: 24px 0;
  background-color: var(--border);
}

/* ==========================================================================
   8. 分页
   ========================================================================== */

.pager { margin-top: 24px; }

.pager__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager__list li { list-style: none; }

.pager__list a,
.pager__list span {
  display: inline-block;
  min-width: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
  transition: color var(--transition), border-color var(--transition),
              background-color var(--transition);
}

.pager__list a:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.pager__list .current a {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--brand-inverse);
  font-weight: 600;
}

/* ==========================================================================
   9. 评论
   ========================================================================== */

.comments { margin-top: 26px; }

.comments__title,
.respond__title {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list li { list-style: none; }

.comment-body {
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.comment-body:hover { border-color: var(--border-strong); }

.comment-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.comment-author > span[itemprop="image"] { display: inline-flex; }

.comment-author .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.comment-author cite,
.comment-author cite a {
  color: var(--text-strong);
  font-size: 14.5px;
  font-style: normal;
  font-weight: 600;
}

.comment-meta {
  color: var(--text-faint);
  font-size: 12.8px;
}

.comment-meta a { color: inherit; }

.comment-by-author > .comment-author cite::after {
  content: "作者";
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}

.comment-content {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.8;
}

.comment-content > * + * { margin-top: 12px; }

.comment-content p { margin: 0; }

.comment-reply {
  margin-top: 10px;
  text-align: right;
  font-size: 13px;
}

.comment-reply a { color: var(--text-faint); }
.comment-reply a:hover { color: var(--brand); }

.comment-children { margin-top: 12px; }

.comment-children .comment-list { padding-left: 0; }

.comment-children .comment-body {
  background-color: var(--bg-soft);
  border-style: dashed;
}

.comment-awaiting-moderation {
  display: inline-block;
  margin-left: 6px;
  color: #d4380d;
  font-size: 12.5px;
  font-style: normal;
}

.comments__closed {
  padding: 16px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 14px;
  text-align: center;
}

/* 评论表单 */
.respond {
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.respond__cancel { font-size: 13px; }
.respond__cancel a { color: var(--text-faint); }

.respond__identity {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.dot { margin-inline: 6px; color: var(--border-strong); }

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field { display: block; margin-bottom: 14px; }

.field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.field__required { margin-left: 3px; color: #d4380d; font-style: normal; }

.field input,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color var(--transition), box-shadow var(--transition),
              background-color var(--transition);
}

.field textarea { line-height: 1.8; resize: vertical; min-height: 130px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.respond__actions { display: flex; justify-content: flex-end; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition);
}

.btn--primary {
  background-color: var(--brand);
  color: var(--brand-inverse);
}

.btn--primary:hover { background-color: var(--brand-strong); color: var(--brand-inverse); }

/* ==========================================================================
   10. 侧边栏
   ========================================================================== */

.sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
}

.widget__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14.5px;
}

.widget__title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background-color: var(--brand);
}

.widget--about { text-align: center; }

.widget__avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--c2));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.06em;
}

.widget__title-plain {
  font-size: 16px;
  font-weight: 700;
}

.widget__text {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.widget__stat {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.widget__stat-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
}

.widget__stat-item strong {
  color: var(--brand);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.widget__stat-item:hover { background-color: var(--brand-soft); }

.widget__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget__list li { list-style: none; }

.widget__list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-inline: -8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition), background-color var(--transition);
}

.widget__list a:hover {
  color: var(--brand);
  background-color: var(--bg-soft);
}

.dot-mark {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--accent, var(--border-strong));
}

.widget__count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-soft);
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.widget__list--posts a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.widget__post-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget__list--posts time {
  flex-shrink: 0;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.widget__comment a { display: block; }

.widget__comment strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
}

.widget__comment span {
  display: block;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 12.8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   11. 页脚
   ========================================================================== */

.site-footer {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
  background-color: var(--surface);
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 26px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
}

.site-footer__desc {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.site-footer__heading {
  margin-bottom: 12px;
  color: var(--text-strong);
  font-size: 13.5px;
  font-weight: 600;
}

.site-footer__col ul { margin: 0; padding: 0; list-style: none; }
.site-footer__col li { list-style: none; margin-bottom: 7px; }
.site-footer__col a { color: var(--text-muted); font-size: 13.5px; }
.site-footer__col a:hover { color: var(--brand); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 0 26px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
}

.site-footer__meta { display: flex; align-items: center; }

/* ==========================================================================
   12. 全局工具
   ========================================================================== */

.reading-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  height: 2px;
  pointer-events: none;
}

.reading-progress__bar {
  width: 0;
  height: 100%;
  background-image: linear-gradient(90deg, var(--brand), var(--c2));
  transition: width .1s linear;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  width: 42px;
  height: 42px;
  background-color: var(--surface);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition),
              visibility var(--transition), color var(--transition),
              border-color var(--transition);
}

.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

.empty {
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background-color: var(--surface);
  text-align: center;
}

.empty__title { color: var(--text-strong); font-size: 1.05rem; font-weight: 600; }
.empty__desc { margin-top: 8px; color: var(--text-muted); font-size: 14px; }

.empty__cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.error-page {
  padding: 56px 24px 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-1);
}

.error-page__code {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  opacity: .32;
}

.error-page__title { margin-top: 10px; font-size: 1.5rem; }

.error-page__desc {
  max-width: 34em;
  margin: 12px auto 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

.error-page__cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.error-page__home { margin-top: 24px; }

/* 页面内的整行搜索表单 */
.search--block {
  max-width: 460px;
  margin-top: 16px;
}

.search--block .search__input,
.search--block .search__input:focus {
  width: 100%;
  height: 44px;
  padding-right: 100px;
  padding-left: 38px;
  font-size: 14.5px;
}

.search--block .search__icon { left: 13px; width: 17px; height: 17px; }

.search__submit {
  position: absolute;
  right: 4px;
  height: 36px;
  padding-inline: 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: var(--brand);
  color: var(--brand-inverse);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color var(--transition);
}

.search__submit:hover { background-color: var(--brand-strong); }

/* ==========================================================================
   13. 响应式
   ========================================================================== */

@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .search__input { width: 150px; }
  .search__input:focus { width: 190px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 20px 36px;
  }

  .sidebar { position: static; }

  .nav-toggle { display: grid; }

  .site-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    display: none;
    padding: 10px 20px 16px;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface);
  }

  .site-nav.is-open { display: block; }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-menu a { padding: 10px 12px; font-size: 15px; }

  /* 无 JS 时保证导航仍可用 */
  html.no-js .site-nav { position: static; display: block; padding: 0; border: 0; background: transparent; }
  html.no-js .nav-menu { flex-direction: row; flex-wrap: wrap; }

  .site-header__inner { flex-wrap: wrap; }
  .search { order: 3; width: 100%; }
  .search__input,
  .search__input:focus { width: 100%; }

  .hero__inner { padding-block: 30px 28px; }

  .entry { padding: 22px 20px; }
  .respond { padding: 18px 18px; }
  .field-row { grid-template-columns: 1fr; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { text-align: left; }

  .site-footer__cols { grid-template-columns: 1fr; gap: 20px; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .wrap { padding-inline: 15px; }

  .card { padding: 18px 18px 16px; }
  .entry { padding: 20px 16px; }
  .widget { padding: 16px; }

  .entry-content { font-size: 16px; }
  .entry-content pre { padding-inline: 14px; font-size: 13px; }

  .comment-children .comment-body { margin-left: -6px; }

  .archive-title { font-size: 1.35rem; }

  .back-to-top { right: 15px; bottom: 15px; }
}

@media (max-width: 400px) {
  .brand__text { display: none; }
}

/* ==========================================================================
   14. 动效降级与打印
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
  .card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .sidebar, .post-nav, .comments,
  .back-to-top, .reading-progress, .toc, .code-bar { display: none !important; }

  body { background: #fff; color: #000; }
  .layout { display: block; }
  .entry { border: 0; box-shadow: none; padding: 0; }
  .entry::before { display: none; }
  .entry-content a { border: 0; color: #000; }
}
