/* ============================================================
   NEBULA · 个人网站样式表
   深色科技风 / 玻璃拟态 / 网格光晕
   ============================================================ */

:root {
  --bg: #060a12;
  --bg-2: #080d18;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6edf7;
  --text-2: #b6c4d8;
  --muted: #7f8fa8;
  --faint: #56637a;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.85);
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景光效 ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(80, 140, 200, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 140, 200, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(420px) rotateX(52deg);
  transform-origin: center top;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 72%);
}
.bg-glow-1, .bg-glow-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
}
.bg-glow-1 {
  width: 620px; height: 620px; top: -280px; left: -160px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent 68%);
}
.bg-glow-2 {
  width: 560px; height: 560px; top: 80px; right: -220px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 68%);
}

/* ---------- 布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 800px; }
.wrap-wide { max-width: 1200px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(6, 10, 18, 0.76);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(139, 92, 246, 0.9));
  color: #05080f;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 22px -4px rgba(34, 211, 238, 0.7);
  /* 换成上传的图片后：去掉渐变底与光晕，图自己撑满方块 */
  overflow: hidden;
  flex-shrink: 0;
}
.logo-mark.has-img {
  background: none;
  box-shadow: 0 0 18px -6px rgba(34, 211, 238, 0.45);
  border: 1px solid var(--border);
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-left: 2px;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 13px;
  border-radius: 8px;
  transition: 0.18s;
}
.nav a:hover { color: var(--text); background: var(--panel-hover); }
.nav a.active { color: var(--cyan); background: rgba(34, 211, 238, 0.09); }

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 11px;
  height: 34px;
  transition: 0.2s;
}
.search-box:focus-within { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }
.search-box svg { width: 14px; height: 14px; stroke: var(--faint); flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: var(--sans);
  width: 130px; padding: 0;
}
.search-box input::placeholder { color: var(--faint); }

/* ---------- Hero ---------- */
.hero { padding: 66px 0 44px; position: relative; }

/* 后台配了横幅背景图时，Hero 变成一张圆角横幅：
   图铺底，上面压两层暗色渐变——左侧重（文字在这一侧）、右侧轻（图能露出来），
   底部再渐隐到页面底色，避免横向切成一块生硬的色带。
   浓度由 --hero-dim 控制（后台滑块 0-95，对应 0-0.95）。 */
.hero.has-bg {
  padding: 58px 42px 40px;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow);
}
.hero.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}
.hero.has-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* 1) 文字侧固定压暗：与滑块无关，图再亮也压得住标题 */
    linear-gradient(90deg,
      rgba(6, 10, 18, 0.9) 0%,
      rgba(6, 10, 18, 0.74) 38%,
      rgba(6, 10, 18, 0.28) 64%,
      rgba(6, 10, 18, 0) 90%),
    /* 2) 底部渐隐，横向不留生硬的切边 */
    linear-gradient(180deg,
      rgba(6, 10, 18, 0) 0%,
      rgba(6, 10, 18, 0.06) 52%,
      rgba(6, 10, 18, 0.92) 100%),
    /* 3) 站长可调的整幅蒙层，管整体氛围 */
    linear-gradient(0deg, rgba(6, 10, 18, var(--hero-dim, 0.3)), rgba(6, 10, 18, var(--hero-dim, 0.3)));
}
/* 内容抬到蒙层之上，否则会被 ::after 盖住 */
.hero.has-bg > * { position: relative; z-index: 2; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.07);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
  font-size: 42px;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -1.4px;
  margin: 0 0 16px;
  max-width: 700px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 55%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: 15.5px; max-width: 560px; margin: 0 0 28px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 1px; }
.hero-stat b {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.hero-stat span { font-size: 11.5px; color: var(--faint); letter-spacing: 0.6px; text-transform: uppercase; }

/* ---------- 首屏两栏：左文字 / 右 HelloWorld 卡 + 头像 ---------- */
/* 右侧内容由 site.js 按后台设置生成。没内容时不加 has-side，
   栅格回到单栏，避免右侧留一条空白把标题挤窄。 */
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; align-items: center; }
.hero.has-side .hero-inner { grid-template-columns: minmax(0, 1fr) auto; }
.hero-main { min-width: 0; }
.hero-side { display: flex; align-items: center; gap: 14px; }
/* 必须显式写：作者样式的 display 会压过浏览器默认的 [hidden]{display:none}，
   不写的话容器虽空但仍占一个栅格行，关掉两块后首屏会平白多出 gap 那 30px。 */
.hero-side[hidden] { display: none; }

/* 线稿浮层头像：内置图是抠底的，靠径向渐隐融进背景，不留方形边 */
.hero-avatar { flex: none; width: 222px; height: 222px; position: relative; margin-right: -18px; }
.hero-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 62%, rgba(0, 0, 0, 0.5) 78%, transparent 90%);
  mask-image: radial-gradient(circle at 50% 45%, #000 62%, rgba(0, 0, 0, 0.5) 78%, transparent 90%);
  filter: drop-shadow(0 0 30px rgba(34, 211, 238, 0.18));
}
/* 换成自己的图（多半是照片）就用圆形 + 描边环，别套上面那层浮层遮罩 */
.hero-avatar.av-custom { margin-right: 0; }
.hero-avatar.av-custom img {
  -webkit-mask-image: none;
  mask-image: none;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 36px -8px rgba(34, 211, 238, 0.45);
}

/* ---------- HelloWorld 代码卡 ---------- */
/* 文件名、代码内容、底部彩条开关都来自后台设置，这里只管长相 */
.hw { flex: none; font-family: var(--mono); }
.hw .rb {
  background: linear-gradient(100deg, #22d3ee, #34d399 26%, #fbbf24 50%, #fb7185 72%, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hw-card {
  width: 242px;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.014));
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 26px 58px -32px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.hw-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.022);
}
.hw-bar i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.hw-bar i:nth-child(1) { background: var(--rose); box-shadow: 0 0 9px rgba(251, 113, 133, 0.8); }
.hw-bar i:nth-child(2) { background: var(--amber); box-shadow: 0 0 9px rgba(251, 191, 36, 0.75); }
.hw-bar i:nth-child(3) { background: var(--green); box-shadow: 0 0 9px rgba(52, 211, 153, 0.75); }
.hw-bar b { margin-left: auto; font-size: 10px; font-weight: 500; color: var(--faint); letter-spacing: 0.4px; }
.hw-code { padding: 13px 13px 11px; font-size: 13px; line-height: 1.92; color: var(--text-2); }
.hw-code .ln { display: inline-block; width: 14px; color: #37455a; user-select: none; -webkit-user-select: none; }
/* 代码里的缩进要留住，否则美化过的格式会被 HTML 折叠掉 */
.hw-code .cd { white-space: pre-wrap; }
.hw-code .k { color: var(--violet); }
.hw-code .f { color: var(--cyan); }
.hw-code .rb { font-weight: 600; }

/* 「科技向上」：高度递增的彩条，右端加光晕把视线带上去 */
.hw-sig { position: relative; height: 44px; padding: 0 13px 12px; display: flex; align-items: flex-end; justify-content: space-between; }
.hw-sig s { display: block; width: 3px; border-radius: 1.5px; text-decoration: none; }
.hw-sig::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
}

/* 窄屏：右侧整块提到标题之上，卡片撑满余量、头像缩小 */
/* 注意 .hero.has-side .hero-inner 要一并写上：它是两个类，
   优先级高于单类的 .hero-inner，只写后者的话窄屏会仍是两栏，
   卡片被挤成几个像素宽。minmax(0,1fr) 而不是 1fr，避免内容把栅格顶宽。 */
@media (max-width: 900px) {
  .hero-inner,
  .hero.has-side .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hero-side { order: -1; gap: 12px; }
  .hw { flex: 1 1 auto; min-width: 0; }
  .hw-card { width: auto; }
  .hw-code { font-size: 11px; padding: 10px 10px 8px; }
  .hw-sig { height: 34px; padding: 0 10px 10px; }
  .hw-sig s { width: 2px; }
  .hero-avatar { width: 96px; height: 96px; margin-right: 0; }
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-head h2::before {
  content: "";
  width: 3px; height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
}
.section-head .count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-left: auto;
}

/* ---------- 标签 ---------- */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 4px 11px;
  border-radius: 100px;
  cursor: pointer;
  transition: 0.18s;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-hover); }
.chip.on {
  color: #05080f;
  background: linear-gradient(135deg, var(--cyan), #0ea5b7);
  border-color: transparent;
  font-weight: 600;
}
.chip .n { opacity: 0.6; margin-left: 5px; }

/* ---------- 文章卡片 ---------- */
.article-list { display: grid; gap: 16px; }

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 26px;
  padding: 24px 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(420px circle at 0% 0%, rgba(34, 211, 238, 0.08), transparent 60%);
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
}
.card:hover {
  border-color: rgba(34, 211, 238, 0.34);
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, 0.06);
  background: var(--panel-hover);
}
.card:hover::after { opacity: 1; }

.card.pinned { border-color: rgba(251, 191, 36, 0.28); }
.card.pinned::before {
  content: "PINNED";
  position: absolute;
  top: 0; left: 26px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: #05080f;
  background: linear-gradient(135deg, var(--amber), #f59e0b);
  padding: 2px 9px 3px;
  border-radius: 0 0 6px 6px;
  font-weight: 700;
}

.card-body { min-width: 0; display: flex; flex-direction: column; }
.card-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 0 0 9px;
  line-height: 1.4;
  color: var(--text);
  transition: 0.2s;
}
.card:hover .card-title { color: var(--cyan); }
.card-summary {
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.72;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--faint);
  font-family: var(--mono);
  margin-top: auto;
  flex-wrap: wrap;
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.card-meta .tag-mini { color: var(--cyan); opacity: 0.85; }
.cat-mini {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.075);
  border-radius: 100px;
  padding: 0 9px;
  white-space: nowrap;
}
.card-meta .cat-mini { margin-right: 3px; }
a.cat-mini { text-decoration: none; transition: 0.18s; }
a.cat-mini:hover { background: rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.5); }

.card-cover {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(139, 92, 246, 0.14));
  position: relative;
  min-height: 118px;
  display: grid;
  place-items: center;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover .glyph {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.85), rgba(139, 92, 246, 0.85));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}
.card-cover .scan {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px);
  opacity: 0.6;
}

/* ---------- 文章详情 ---------- */
.article-hero { padding: 52px 0 30px; position: relative; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 22px;
  font-family: var(--mono);
  transition: 0.2s;
}
.back-link:hover { color: var(--cyan); }
.article-hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -1.1px;
  margin: 0 0 18px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--faint);
  font-family: var(--mono);
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

/* Markdown 正文排版 */
.prose { font-size: 16px; line-height: 1.85; color: var(--text-2); }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 2em 0 0.7em;
  line-height: 1.4;
  scroll-margin-top: 80px;
}
.prose h2 {
  font-size: 23px;
  padding-left: 14px;
  border-left: 3px solid var(--cyan);
  margin-left: -3px;
}
.prose h3 { font-size: 18.5px; }
.prose h3::before {
  content: "▸ ";
  color: var(--cyan);
  font-size: 15px;
}
.prose p { margin: 1.1em 0; }
.prose a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  transition: 0.2s;
}
.prose a:hover { border-bottom-color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.prose strong { color: var(--text); font-weight: 650; }
.prose em { color: var(--text); }
.prose code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: rgba(34, 211, 238, 0.1);
  color: #7ee7f7;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(34, 211, 238, 0.16);
}
.prose pre {
  background: #04070d;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  position: relative;
}
.prose pre code {
  background: none; border: none; padding: 0;
  color: #a5f3fc; font-size: 13.2px; line-height: 1.7;
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--violet);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.09), transparent);
  border-radius: 0 9px 9px 0;
  color: var(--text-2);
  font-style: normal;
}
.prose blockquote p { margin: 0.4em 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 1.1em 0; }
.prose li { margin: 0.5em 0; }
.prose ul li::marker { color: var(--cyan); }
.prose ol li::marker { color: var(--cyan); font-family: var(--mono); font-size: 0.9em; }
.prose img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 1.6em 0;
  display: block;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.6em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.prose th { background: rgba(255, 255, 255, 0.035); color: var(--text); font-weight: 600; }

/* ---------- 上一篇/下一篇 ---------- */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 44px 0 0;
}
.article-nav a {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}
.article-nav a:hover { border-color: rgba(34, 211, 238, 0.34); background: var(--panel-hover); }
.article-nav .lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 5px;
}
.article-nav .txt {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-nav .right { text-align: right; }

/* ---------- 评论区 ---------- */
.comment-section { margin: 52px 0 0; }
.comment-count-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 1px 8px;
  border-radius: 100px;
  margin-left: 9px;
}

.comment-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 26px;
}
.comment-form textarea, .field-input, .field-textarea, .field-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  transition: 0.2s;
  resize: vertical;
}
.comment-form textarea:focus, .field-input:focus, .field-textarea:focus, .field-select:focus {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.07);
}
.comment-form textarea::placeholder, .field-input::placeholder, .field-textarea::placeholder { color: var(--faint); }

/* 下拉框：去掉系统外观自绘箭头，并用暗色 color-scheme，避免深色页面里弹出白色原生控件 */
.field-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%237d8b9c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  color-scheme: dark;
  cursor: pointer;
}
.field-select:disabled { opacity: 0.5; cursor: not-allowed; }
.field-select option { background: #0d1420; color: var(--text); }
.comment-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 11px;
  flex-wrap: wrap;
}
.comment-form-row .nick { width: 170px; }
.comment-form-row .hint { font-size: 12px; color: var(--faint); margin-right: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel-hover);
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(34, 211, 238, 0.45); color: var(--cyan); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0e9bb0);
  border-color: transparent;
  color: #05080f;
  box-shadow: 0 6px 22px -8px rgba(34, 211, 238, 0.75);
}
.btn-primary:hover { filter: brightness(1.1); color: #05080f; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { color: var(--rose); border-color: rgba(251, 113, 133, 0.3); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.1); color: var(--rose); border-color: rgba(251, 113, 133, 0.5); }

/* 评论项 */
.comment-item {
  display: flex;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.comment-item:last-child { border-bottom: none; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--mono);
  color: #05080f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.avatar.admin { background: linear-gradient(135deg, var(--amber), #f97316); }
.comment-main { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.comment-author { font-size: 13.5px; font-weight: 650; color: var(--text); }
.badge-owner {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.8px;
  color: #05080f;
  background: linear-gradient(135deg, var(--amber), #f59e0b);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-pending {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
.comment-time { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.comment-text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  align-items: center;
}
.link-btn {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  font-family: var(--sans);
  transition: 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.link-btn:hover { color: var(--cyan); }
.link-btn.on { color: var(--rose); }

.replies {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
}
.reply-box { margin-top: 11px; display: none; }
.reply-box.open { display: block; }
.reply-box .row { display: flex; gap: 9px; margin-top: 9px; align-items: center; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--faint);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .big { font-size: 30px; margin-bottom: 10px; opacity: 0.4; }

/* ---------- 关于页 ---------- */
.about-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
}
.about-avatar {
  width: 76px; height: 76px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: grid; place-items: center;
  font-size: 30px; font-weight: 800;
  color: #05080f;
  font-family: var(--mono);
  margin-bottom: 18px;
  box-shadow: 0 0 40px -10px rgba(34, 211, 238, 0.7);
}
.about-card h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.5px; }
.about-card .role {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.about-card p { color: var(--muted); font-size: 14.5px; line-height: 1.85; margin: 0 0 12px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 24px; }
.info-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
}
.info-item .k {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.info-item .v { font-size: 14px; color: var(--text); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  background: rgba(0, 0, 0, 0.25);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--faint);
}
.footer-inner .spacer { margin-left: auto; }
.footer-inner a { color: var(--faint); text-decoration: none; transition: 0.2s; }
.footer-inner a:hover { color: var(--cyan); }

/* ---------- 页脚合规公示（备案号 / 协议入口） ---------- */
.footer-legal {
  max-width: 1080px;
  margin: 10px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--faint);
}
.footer-legal a { color: var(--faint); text-decoration: none; transition: 0.2s; }
.footer-legal a:hover { color: var(--cyan); }
.footer-legal .sep { color: rgba(255, 255, 255, 0.14); }

/* ---------- 协议页（隐私政策 / 用户协议） ---------- */
.policy-head {
  padding: 8px 0 4px;
}
.policy-head h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
.policy-meta {
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.policy-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.policy-toc a {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  transition: 0.2s;
}
.policy-toc a:hover { color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); }
.policy-body { font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.policy-body h2 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.policy-body h2:first-child { margin-top: 8px; padding-top: 0; border-top: none; }
.policy-body h3 { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.policy-body p { margin: 10px 0; }
.policy-body ul, .policy-body ol { margin: 10px 0; padding-left: 22px; }
.policy-body li { margin: 6px 0; }
.policy-body strong { color: var(--text); font-weight: 600; }
.policy-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cyan);
}
.policy-note {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(34, 211, 238, 0.05);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.policy-warn {
  border-left-color: var(--amber);
  background: rgba(251, 191, 36, 0.06);
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: rgba(12, 18, 30, 0.96);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: 0.28s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.err { border-color: rgba(251, 113, 133, 0.4); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #04070d; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.11); border-radius: 6px; border: 2px solid #04070d; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); }

/* ---------- 首页：左侧栏目栏 + 右侧文章列表 ---------- */
.home-layout {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 28px;
  align-items: start;
}

.cat-side {
  position: sticky;
  top: 88px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 13px;
}

.cat-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 7px 11px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 9px;
}
.cat-side-head .k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2.4px;
  color: var(--cyan);
  text-transform: uppercase;
}
.cat-side-head .v { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.cat-list { display: flex; flex-direction: column; gap: 2px; }

.cat-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 8px 9px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: 0.18s;
}
.cat-item:hover { background: var(--panel-hover); color: var(--text); }
.cat-item.on {
  background: rgba(34, 211, 238, 0.075);
  border-color: rgba(34, 211, 238, 0.28);
  color: var(--text);
}
.cat-item img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--border);
}
.cat-item.on img { border-color: rgba(34, 211, 238, 0.45); }
.cat-item .cat-txt { min-width: 0; }
.cat-item .cat-txt b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.45;
}
.cat-item .cat-txt i {
  display: block;
  font-style: normal;
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-item .cat-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 100px;
  padding: 1px 7px;
}
.cat-item.on .cat-n { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }
.cat-item.empty .cat-txt b { color: var(--muted); font-weight: 500; }

/* 选中子栏目时，父栏目保留一层「路径高亮」，让人看清自己落在哪一支（比选中态淡一档） */
.cat-item.on-path {
  color: var(--text);
  background: rgba(34, 211, 238, 0.035);
  border-color: rgba(34, 211, 238, 0.16);
}
.cat-item.on-path .cat-txt b { color: var(--text); }
.cat-item.on-path .cat-n { color: var(--cyan); background: rgba(34, 211, 238, 0.08); }

/* ---------- 子栏目（二级 / 三级）：逐级缩进挂在上级栏目下 ---------- */
.cat-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px 18px;
  padding-left: 11px;
  border-left: 1px solid var(--border);
}
.cat-sub-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 12.5px;
  transition: 0.18s;
}
.cat-sub-item:hover { background: var(--panel-hover); color: var(--text); }
.cat-sub-item.on { background: rgba(34, 211, 238, 0.075); color: var(--cyan); }
.cat-sub-item img {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: block;
  border: 1px solid var(--border);
}
.cat-sub-item.on img { border-color: rgba(34, 211, 238, 0.4); }
.cat-sub-item b {
  font-weight: 500;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-sub-item .n { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.cat-sub-item.on .n { color: var(--cyan); }
.cat-sub-item.empty b { color: var(--faint); }

/* 三级栏目：再缩进一档，字号与图标收小，视觉上明确比二级更靠里 */
.cat-sub-item.lv3 {
  margin-left: 14px;
  grid-template-columns: 16px 1fr auto;
  padding: 4px 8px;
  font-size: 12px;
}
.cat-sub-item.lv3 img { width: 16px; height: 16px; border-radius: 5px; }
.cat-sub-item.lv3 b { font-size: 12px; }

/* 选中后代栏目时，沿途祖先保留一层「路径高亮」，比选中态淡一档 */
.cat-sub-item.on-path {
  color: var(--text);
  background: rgba(34, 211, 238, 0.035);
}
.cat-sub-item.on-path .n { color: var(--cyan); }

/* 正文页栏目面包屑：祖先用弱化样式，末级保持高亮 */
.cat-mini.cat-anc {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}
.cat-meta .sep,
#articleMeta .sep {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  margin: 0 5px 0 1px;
}

.home-main { min-width: 0; }

.sk-cat {
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 37%, rgba(255, 255, 255, 0.03) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 37%, rgba(255, 255, 255, 0.03) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.sk-card { height: 168px; border-radius: var(--radius); }

/* ---------- 评论身份：身份条 ---------- */
.idbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  font-size: 12.5px;
  color: var(--muted);
}
.idbar .spacer { margin-left: auto; }
.idbar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 8px rgba(86, 99, 122, 0.8);
}
.idbar.on { border-color: rgba(34, 211, 238, 0.24); background: rgba(34, 211, 238, 0.05); color: var(--text-2); }
.idbar.on b { color: var(--text); font-size: 13px; }
.idbar.on .idbar-dot { background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.9); }
.idbar.need { border-color: rgba(251, 191, 36, 0.26); background: rgba(251, 191, 36, 0.06); color: var(--amber); }
.idbar.need .idbar-dot { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.idbar.banned { border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.07); color: var(--rose); }
.idbar.banned .idbar-dot { background: var(--rose); }
.idbar-av {
  width: 24px; height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #05080f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}
.idbar-av.has-img { background-size: cover; background-position: center; }
.idbar-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.avatar.has-img { background-size: cover; background-position: center; }
.badge-me {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.32);
  background: rgba(34, 211, 238, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------- 评论身份：弹窗 ---------- */
body.modal-open { overflow: hidden; }
.idm-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: idmFade 0.16s ease-out;
}
@keyframes idmFade { from { opacity: 0; } to { opacity: 1; } }
.idm {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: #0b111c;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.idm-head {
  display: flex;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #0b111c;
  z-index: 1;
}
.idm-head h3 { font-size: 15px; font-weight: 650; color: var(--text); }
.idm-x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: 0.18s;
}
.idm-x:hover { color: var(--text); background: var(--panel-hover); }
.idm-body { padding: 16px 18px 18px; }
.idm-tip { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.idm-note { font-size: 11.5px; color: var(--faint); line-height: 1.65; margin-top: 10px; }
.idm-hint { font-size: 11px; color: var(--faint); margin-top: 5px; }
.idm-field { margin-top: 13px; }
.idm-field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.idm-field label b { color: var(--cyan); }
.idm-av-row { display: flex; align-items: center; gap: 14px; }
.idm-av {
  width: 62px; height: 62px;
  border-radius: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: #05080f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.idm-av.has-img { background-size: cover; background-position: center; }
.idm-av-btns { display: flex; gap: 8px; }
.idm-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}
.idm-actions .spacer { margin-left: auto; }
/* ---------- 认领弹窗里的协议同意项（必勾） ---------- */
.idm-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}
.idm-consent:hover { border-color: var(--border-strong); }
.idm-consent input[type="checkbox"] {
  margin: 3px 0 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--cyan);
  cursor: pointer;
}
.idm-consent a { color: var(--cyan); text-decoration: none; }
.idm-consent a:hover { text-decoration: underline; }

/* ---------- 评论区合规提示 / 举报 ---------- */
.comment-policy {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.85;
  color: var(--faint);
}
.comment-policy a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: 0.2s;
}
.comment-policy a:hover { color: var(--cyan); }
.comment-actions .report-btn:hover { color: var(--rose); }
.idm-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  font-size: 11px;
  color: var(--faint);
}
.idm-sep::before, .idm-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.idm-providers { display: flex; flex-direction: column; gap: 8px; }
.idm-provider {
  width: 100%;
  justify-content: flex-start;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-2);
  font-weight: 500;
}
.idm-provider .idm-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}
.idm-provider .idm-tag.ok { color: var(--green); border-color: rgba(52, 211, 153, 0.35); }
.idm-provider:disabled { cursor: not-allowed; }
.idm-provider:disabled:hover { border-color: var(--border-strong); color: var(--text-2); }
.dot-wx, .dot-gh {
  width: 16px; height: 16px;
  border-radius: 5px;
  flex-shrink: 0;
  display: inline-block;
}
.dot-wx { background: linear-gradient(135deg, #4ade80, #16a34a); }
.dot-gh { background: linear-gradient(135deg, #cbd5e1, #64748b); }
.idm-code {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 3px;
  text-align: center;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  user-select: all;
}
.field-input.mono { font-family: var(--mono); letter-spacing: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .wrap, .header-inner, .footer-inner { padding: 0 18px; }
  .card { grid-template-columns: 1fr; gap: 16px; }
  .card-cover { min-height: 150px; order: -1; }
  .hero { padding: 44px 0 30px; }
  .hero.has-bg { padding: 36px 22px 28px; border-radius: 16px; }
  .hero h1 { font-size: 30px; letter-spacing: -0.9px; }
  .hero-stats { gap: 24px; }
  .article-hero h1 { font-size: 27px; }
  .prose { font-size: 15.5px; }
  .article-nav { grid-template-columns: 1fr; }
  .nav a:not(.keep) { display: none; }
  .search-box input { width: 90px; }
  .header-inner { gap: 12px; }
  .comment-form-row .nick { width: 100%; }
}

/* ---------- 响应式：单栏时栏目栏降级为横向滑动条 ---------- */
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; gap: 16px; }
  /* min-width: 0 是必须的：栅格子项与内部横向滚动条默认按内容撑到最小宽度，
     栏目一多就会把整个页面顶宽（实测 430px 视口下被撑到 588px，
     页头搜索框因此被挤出屏幕）。加上它，滚动才真正发生在栏目条内部。 */
  .cat-side { position: static; padding: 12px 12px 10px; min-width: 0; }
  .cat-side-head { padding-bottom: 9px; margin-bottom: 9px; }
  .cat-list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    min-width: 0;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat-item {
    flex: 0 0 auto;
    grid-template-columns: 30px auto;
    gap: 9px;
    padding: 7px 13px 7px 7px;
    border-color: var(--border);
    background: var(--panel);
  }
  .cat-item img { width: 30px; height: 30px; border-radius: 9px; }
  .cat-item .cat-txt i,
  .cat-item .cat-n { display: none; }
  /* 单栏时二级/三级栏目与一级栏目并列横排，用 display:contents 抹掉中间层容器，
     层级只靠名字前缀的「· / ··」区分，缩进在横排里没有意义 */
  .cat-sub { display: contents; }
  .cat-sub-item {
    flex: 0 0 auto;
    grid-template-columns: 16px auto;
    gap: 7px;
    padding: 7px 12px 7px 8px;
    border: 1px solid var(--border);
    background: var(--panel);
  }
  .cat-sub-item img { width: 16px; height: 16px; border-radius: 5px; }
  .cat-sub-item b::before { content: '· '; color: var(--faint); }
  .cat-sub-item .n { display: none; }
  .cat-sub-item.lv3,
  .cat-sub-item.lv3 b { font-size: 12.5px; }
  .cat-sub-item.lv3 { margin-left: 0; }
  .cat-sub-item.lv3 b::before { content: '·· '; }
  .cat-sub-item.on-path { background: var(--panel); color: var(--muted); }
  .sk-cat { height: 46px; flex: 0 0 150px; }
}

/* ---------- 响应式：窄屏下的身份条与弹窗 ---------- */
@media (max-width: 560px) {
  .idbar { padding: 9px 11px; }
  .idbar .spacer { display: none; }
  .idbar > .btn { flex: 1 1 auto; }
  .idm { max-width: 100%; }
  .idm-av { width: 54px; height: 54px; border-radius: 14px; font-size: 19px; }
  .idm-code { font-size: 20px; letter-spacing: 2px; }
}

/* ============================================================
   栏目访问密码（v202610011550）
   加锁栏目的锁标识、列表内的解锁提示、解锁弹窗
   ============================================================ */

/* 栏目右侧的锁：替掉原来的篇数位（篇数也是内容量的信息，未解锁就不给） */
.cat-item .cat-n.locked,
.cat-sub-item .n.locked {
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  padding: 0 5px;
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.22);
}
/* 加锁未解锁时把名称压淡一档，与能直接看的栏目区分开 */
.cat-item.locked .cat-txt b { color: var(--text-2); font-weight: 500; }
.cat-item.locked:hover .cat-txt b,
.cat-item.locked.on .cat-txt b { color: var(--text); }
.cat-sub-item.locked b { color: var(--muted); }

/* ---------- 列表内的解锁提示（首页 ?cat=X、文章详情） ---------- */
.lock-gate {
  text-align: center;
  padding: 46px 24px 50px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
}
.lock-gate-ico { font-size: 30px; line-height: 1; margin-bottom: 14px; opacity: 0.85; }
.lock-gate h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--text); }
/* 文章页的解锁卡片挂在 .prose 里，会继承正文 h3 的「▸」装饰，与卡片式版面不搭，去掉 */
.lock-gate h3::before { content: none; }
.lock-gate p { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); }
.lock-gate .btn { min-width: 150px; }

/* ---------- 解锁弹窗 ---------- */
.cat-lock-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cat-lock-mask.on { opacity: 1; }
.cat-lock-box {
  width: 100%;
  max-width: 380px;
  padding: 26px 24px 22px;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}
.cat-lock-mask.on .cat-lock-box { transform: translateY(0); }
.cat-lock-ico { font-size: 26px; line-height: 1; margin-bottom: 12px; }
.cat-lock-box h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.cat-lock-sub { margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
/* 密码框必须同时带 field-input：style.css 里 input 的文字色挂在那个类上，
   只写自己的类会回落成浏览器默认黑字，在深色底上等于看不见 */
.cat-lock-input { width: 100%; text-align: center; letter-spacing: 1px; }
.cat-lock-err { min-height: 18px; margin: 8px 0 4px; font-size: 12.5px; color: var(--rose); }
.cat-lock-actions { display: flex; gap: 10px; margin-top: 6px; }
.cat-lock-actions .btn { flex: 1 1 0; justify-content: center; }
