/* ==========================================================================
   DSH-Registry 设计系统 · 简约蓝白
   规则：白底为主，蓝色只用于强调；卡片靠 1px 边框而非重阴影；圆角统一 12px。
   ========================================================================== */

:root {
  color-scheme: light;

  /* 品牌蓝 */
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;

  /* 中性色 */
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface-2: #eef2f8;
  --border: #e4e9f2;
  --border-strong: #cfd8e6;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --subtle: #94a3b8;

  /* 语义色 */
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  /* 活跃度 */
  --active-very: #15803d;
  --active-yes: #2563eb;
  --active-mid: #64748b;
  --active-slow: #b45309;
  --active-stale: #94a3b8;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 64px;
  --container: 1240px;
}

html.dark {
  color-scheme: dark;
  --brand: #60a5fa;
  --brand-strong: #93c5fd;
  --brand-soft: #16283f;
  --brand-border: #2b4a6f;
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #16223a;
  --border: #22304a;
  --border-strong: #33465f;
  --text: #e8eef8;
  --text-2: #b8c4d8;
  --muted: #94a3b8;
  --subtle: #64748b;
  --ok: #4ade80;
  --ok-soft: #10261a;
  --warn: #fbbf24;
  --warn-soft: #2a2010;
  --danger: #f87171;
  --danger-soft: #2a1414;
  --active-very: #4ade80;
  --active-yes: #60a5fa;
  --active-mid: #94a3b8;
  --active-slow: #fbbf24;
  --active-stale: #64748b;
  --shadow: 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(20px, 2.6vw, 26px); }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }
.container-narrow { width: min(880px, calc(100% - 40px)); margin: 0 auto; }
.stack > * + * { margin-top: 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 页头 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav a {
  display: inline-flex; align-items: center; height: 38px; padding: 0 12px;
  border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-search { flex: 1; max-width: 320px; }

/* ---------------------------------------------------------------- 控件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-weight: 600; font-size: 14px;
  /* 按钮文字永不换行：按钮一旦被 flex 挤压，两字标签会竖排成两行，非常难看 */
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; border-color: var(--border); }

.input {
  width: 100%; min-height: 42px; padding: 9px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.input::placeholder { color: var(--subtle); }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.select {
  min-height: 40px; padding: 8px 30px 8px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}

/* 搜索框（带图标）
   注意 .input 的 width:100% 在 flex 行里会把输入框基准宽度撑满容器、把按钮挤到最小宽度，
   导致「搜索」两字竖排 —— 因此这里必须把输入框改成「占据剩余空间」。
   按钮用 align-self 拉满高度，与输入框齐平。 */
.search { position: relative; display: flex; align-items: stretch; gap: 8px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; display: flex; }
.search .input { flex: 1 1 auto; width: auto; min-width: 0; padding-left: 40px; }
.search .btn { flex: none; align-self: stretch; min-height: 44px; }
.search .btn > svg { flex: none; }
.search-lg .input { min-height: 52px; font-size: 16px; }
.search-lg .search-icon { left: 17px; }
.search-lg .btn { min-height: 52px; padding-inline: 22px; font-size: 15px; }

/* 徽标 / 标签 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 24px; padding: 2px 9px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.chip-brand { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand); }
.chip-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); color: var(--ok); }
.chip-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); color: var(--warn); }
.chip-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 活跃度徽标 */
.activity { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.activity[data-level="very-active"] { color: var(--active-very); }
.activity[data-level="active"] { color: var(--active-yes); }
.activity[data-level="moderate"] { color: var(--active-mid); }
.activity[data-level="slow"] { color: var(--active-slow); }
.activity[data-level="stale"] { color: var(--active-stale); }
.activity[data-level="archived"], .activity[data-level="unknown"] { color: var(--subtle); }

/* ---------------------------------------------------------------- 卡片 */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.section { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.eyebrow {
  margin: 0 0 10px; color: var(--brand); font-size: 12px; font-weight: 750;
  letter-spacing: .1em; text-transform: uppercase;
}

/* 插件卡片 */
.plugin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plugin-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plugin-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.plugin-card:hover { border-color: var(--brand-border); box-shadow: var(--shadow); text-decoration: none; }
.plugin-card.is-invalid { opacity: .68; }
.pc-head { display: flex; align-items: flex-start; gap: 10px; }

/* 插件头像：作者头像绝对定位盖在首字母色块之上；
   图片加载失败时由 app.js 移除该 img，色块自然露出，不需要额外状态管理。 */
.avatar {
  position: relative; flex: none; display: grid; place-items: center;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-border));
  color: var(--brand-strong); font-weight: 800; font-size: 15px;
}
.avatar-letter { line-height: 1; }
.avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--surface);
}
.pc-title { min-width: 0; flex: 1; }
.pc-name { font-size: 15px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.pc-repo { font-size: 12px; color: var(--subtle); font-family: var(--mono); margin-top: 1px; }
.pc-desc {
  color: var(--muted); font-size: 13.5px; line-height: 1.55; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--subtle); margin-top: auto;
}
.pc-stat { display: inline-flex; align-items: center; gap: 4px; }
.pc-stat strong { color: var(--text-2); font-weight: 650; }

/* 分类卡片 */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cat-card {
  display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow-sm); color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cat-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.cat-card-name { font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-card-count { font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: var(--radius-pill); }
.cat-card-desc { margin-top: 7px; font-size: 13px; color: var(--muted); }

/* 统计条 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-num { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- 首页 */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { max-width: 780px; margin: 0 auto; }
.hero-sub { max-width: 620px; margin: 14px auto 26px; color: var(--muted); font-size: 16px; }
.hero .search { max-width: 640px; margin: 0 auto; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--subtle); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.hero-grad {
  background: linear-gradient(180deg, var(--brand-soft), transparent 70%);
  border-bottom: 1px solid var(--border);
}

/* ---------------------------------------------------------------- 三栏布局 */
.layout-3 {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr) 296px;
  gap: 28px;
  padding: 32px 0 64px;
  align-items: start;
}
.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 28px;
  padding: 32px 0 64px;
  align-items: start;
}
.layout-list { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; padding: 32px 0 64px; align-items: start; }
.side-sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.side-sticky-stack { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; }

/* 左分类导航 */
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav-title { font-size: 12px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; padding: 0 10px 8px; }
.sidenav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 36px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px;
}
.sidenav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidenav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.sidenav-count { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.sidenav-more { margin-top: 10px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--brand); }

/* 友情链接卡片（关于页） */
.friends-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.friend-card {
  display: block; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.friend-card:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.friend-name { font-weight: 700; font-size: 15px; }
.friend-desc { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* 分类说明块 */
.guide-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.guide-cat { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guide-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.guide-cat-head a { font-weight: 700; font-size: 15px; color: var(--text); }
.guide-cat-head a:hover { color: var(--brand); }
.guide-cat-count { font-size: 12px; color: var(--subtle); white-space: nowrap; }
.guide-cat p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* 锚点跳转时给吸顶页头留出空间 */
.prose h2[id], .prose h3[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* 筛选状态提示条 */
.filter-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--brand-border); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-strong); font-size: 13.5px; }
.filter-banner button { border: 0; background: none; color: inherit; font-weight: 650; text-decoration: underline; }

/* 加载更多（客户端筛选模式下代替静态分页，避免结果被截断） */
.load-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 26px 0 8px; text-align: center; }
.load-more-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.load-more-top { font-size: 12.5px; color: var(--muted); }
.load-more-top:hover { color: var(--brand); text-decoration: none; }

/* 侧栏区块 */
.side-block { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.side-block-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item { display: block; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; }
.side-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-item-name { font-weight: 600; }
.side-item-meta { font-size: 12px; color: var(--subtle); margin-top: 2px; }

/* 广告位（预留） */
.ad-slot {
  display: grid; place-items: center; min-height: 200px; padding: 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--subtle); text-align: center;
}
.ad-slot-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.ad-slot-hint { font-size: 12px; margin-top: 6px; }
.ad-slot-wide { min-height: 96px; }

/* 筛选栏 */
.filters { display: flex; flex-direction: column; gap: 18px; }
.filter-group-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.filter-option { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.filter-option input { width: 16px; height: 16px; accent-color: var(--brand); }
.filter-option-count { margin-left: auto; font-size: 12px; color: var(--subtle); }

/* 结果头 */
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.result-head h1 { font-size: clamp(22px, 3vw, 30px); }
.result-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.result-tools { display: flex; align-items: center; gap: 10px; }

/* 加载更多（列表不做分页，按批追加） */
.load-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 26px 0 8px; text-align: center; }
.load-more-status { font-size: 13.5px; color: var(--text-2); }
.load-more-status.is-loading { color: var(--brand); font-weight: 600; }
.load-more-status.is-loading::after { content: "…"; animation: loading-dots 1.2s steps(4) infinite; }
.load-more-status.is-done { color: var(--muted); }
.load-more-count { font-size: 12.5px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.load-more-top { font-size: 12.5px; color: var(--muted); }
.load-more-top:hover { color: var(--brand); text-decoration: none; }
@keyframes loading-dots { 0% { opacity: .2 } 50% { opacity: 1 } 100% { opacity: .2 } }

/* ---------------------------------------------------------------- 详情页 */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.detail-title { display: flex; align-items: flex-start; gap: 14px; }
.detail-title h1 { font-size: clamp(22px, 3.2vw, 32px); overflow-wrap: anywhere; }
/* 详情页用同一套 .avatar，只是尺寸更大 */
.detail-title .avatar { border-radius: 13px; font-size: 21px; }
.detail-repo { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 4px; }
.detail-desc { margin: 14px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { padding: 12px 14px; background: var(--bg); }
.fact-label { font-size: 12px; color: var(--subtle); }
.fact-value { font-weight: 650; margin-top: 3px; overflow-wrap: anywhere; }

.notice { padding: 12px 15px; border-radius: var(--radius); font-size: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); color: var(--warn); }
.notice-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--danger); }
.notice-info { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-strong); }

.code-block { position: relative; display: flex; gap: 8px; align-items: stretch; }
.code {
  flex: 1; min-width: 0; margin: 0; padding: 13px 15px; overflow-x: auto;
  border-radius: var(--radius-sm); background: #0f172a; color: #e2e8f0;
  font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
html.dark .code { background: #060b14; border: 1px solid var(--border); }

.prose { color: var(--text-2); font-size: 15px; line-height: 1.75; }
.prose h2 { margin: 30px 0 12px; color: var(--text); font-size: 20px; }
.prose h3 { margin: 24px 0 10px; color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: 5px 0; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.prose pre { padding: 14px; overflow: auto; border-radius: var(--radius-sm); background: #0f172a; color: #e2e8f0; font-size: 13px; }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1em; }
.prose th, .prose td { padding: 8px 11px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--surface); }
.prose blockquote { margin: 0 0 1em; padding: 2px 0 2px 15px; border-left: 3px solid var(--brand-border); color: var(--muted); }

/* 详情正文分区 */
.detail-section { padding: 26px 0; border-top: 1px solid var(--border); }
.detail-section:first-of-type { border-top: 0; }
.detail-section > h2 { font-size: 19px; margin-bottom: 14px; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.faq-item summary {
  padding: 13px 15px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 18px; flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); background: var(--surface); }
.faq-answer { padding: 13px 15px; color: var(--text-2); font-size: 14px; line-height: 1.7; }

/* 文章卡片 */
.post-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.post-card { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-sm); }
.post-card:hover { border-color: var(--brand-border); box-shadow: var(--shadow); text-decoration: none; }
.post-card h3 { font-size: 16px; color: var(--text); }
.post-card p { margin: 9px 0 12px; color: var(--muted); font-size: 13.5px; }
.post-meta { margin-top: auto; font-size: 12px; color: var(--subtle); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 文章页（CSDN 式版式） */
/* 左侧悬浮目录 + 中间正文 + 右侧栏 */
.article-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 280px;
  gap: 32px;
  padding: 32px 0 72px;
  align-items: start;
}

/* 目录 */
.toc-panel { border-left: 2px solid var(--border); padding-left: 2px; }
.toc-title {
  margin-bottom: 10px; padding-left: 12px;
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: .04em;
}
.toc-list { display: flex; flex-direction: column; max-height: calc(100vh - 190px); overflow-y: auto; }
.toc-item {
  display: block; padding: 5px 12px;
  border-left: 2px solid transparent; margin-left: -2px;
  color: var(--muted); font-size: 13px; line-height: 1.5;
  transition: color .15s, border-color .15s;
}
.toc-item:hover { color: var(--brand); text-decoration: none; border-left-color: var(--brand-border); }
.toc-item.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 650; }
.toc-level-3 { padding-left: 26px; font-size: 12.5px; color: var(--subtle); }

/* 正文栏 */
.article-main { min-width: 0; }
.article-title { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.3; margin-bottom: 14px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
  color: var(--subtle); font-size: 13px;
}
.article-meta span { display: inline-flex; align-items: center; gap: 5px; }
.article-tags { margin-top: 14px; }

/* 正文排版：标题带下边框、段落宽松，接近技术博客的阅读密度 */
.article-body { margin-top: 26px; font-size: 16px; line-height: 1.85; color: var(--text-2); }
.article-body > h2 {
  margin: 40px 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 21px; color: var(--text);
}
.article-body > h3 {
  margin: 28px 0 12px; padding-left: 11px;
  border-left: 3px solid var(--brand); font-size: 17.5px; color: var(--text);
}
.article-body > p { margin: 0 0 18px; }
.article-body > ul, .article-body > ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin: 7px 0; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--brand-border); }
.article-body a:hover { text-decoration-color: var(--brand); }
.article-body code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.article-body pre { position: relative; margin: 0 0 20px; }
.article-body pre code { background: none; border: 0; padding: 0; }

/* 标题锚点：悬停才出现，不干扰阅读 */
.heading-anchor {
  margin-left: 8px; color: var(--brand-border); font-weight: 400;
  text-decoration: none; opacity: 0; transition: opacity .15s;
}
.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor { opacity: 1; }
.article-body h2, .article-body h3 { scroll-margin-top: calc(var(--header-h) + 20px); }

/* 文章尾部 */
.article-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.article-foot-block { margin-bottom: 28px; }
.article-foot-title { font-size: 16px; margin-bottom: 14px; }
.article-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.article-nav-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.article-nav-item:hover { border-color: var(--brand); text-decoration: none; }
.article-nav-label { font-size: 12px; color: var(--subtle); }
.article-nav-title { font-size: 14px; font-weight: 600; }
.article-source { line-height: 1.7; }

@media (max-width: 1200px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
  .article-toc { display: none; }
}
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { position: static; }
}
@media (max-width: 720px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-body { font-size: 15.5px; }
}

/* ---------------------------------------------------------------- 页脚 */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0 44px; margin-top: 40px; font-size: 13px; color: var(--muted); }
/* 5 列：品牌 + 浏览 + 插件分类 + 友情链接 + 数据来源 */
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1.2fr 1fr; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; margin-bottom: 10px; }
.footer-col h3 { font-size: 13px; margin-bottom: 10px; color: var(--text); }
.footer-col a { display: block; padding: 3px 0; color: var(--muted); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.attribution { background: var(--brand-soft); border: 1px solid var(--brand-border); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text-2); font-size: 12.5px; margin-bottom: 20px; }
.attribution a { font-weight: 600; }

/* 404 首屏：以搜索框为中心，不用 .empty 的虚线框（那是列表空态用的） */
.error-hero { padding: 26px 0 34px; text-align: center; }
.error-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.error-hero p { max-width: 560px; margin: 14px auto 0; }
.error-hero .search { max-width: 620px; margin: 22px auto 0; }
.error-hero .hero-actions { justify-content: center; }

/* 空态 */
.empty { padding: 56px 24px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-icon { font-size: 34px; margin-bottom: 10px; }
.empty h2 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 18px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.error-box { padding: 32px; text-align: center; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); }

/* 主题切换按钮图标 */
.icon-moon::before { content: "☾"; }
.icon-sun::before { content: "☀"; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1200px) {
  .layout-3 { grid-template-columns: minmax(0, 1fr) 284px; }
  .layout-3 > .layout-3-nav { display: none; }
  .cat-grid, .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .plugin-grid, .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2, .layout-list { grid-template-columns: minmax(0, 1fr); }
  .side-sticky, .side-sticky-stack { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search { display: none; }
}
@media (max-width: 720px) {
  .guide-cats { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .container, .container-narrow, .container-narrow { width: calc(100% - 28px); }
  .nav { display: none; }
  .plugin-grid, .plugin-grid-2, .cat-grid, .stats, .post-list { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 0 28px; }
  .section { padding: 32px 0; }
  .layout-3, .layout-2, .layout-list { padding-top: 22px; }
  .detail-actions .btn { flex: 1; }
  .code-block { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .cat-grid { grid-template-columns: 1fr; }
  .brand span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .side-sticky-stack { display: none; }
}
