/* ============================================================
   community.css —— 社区 / 改枪码详情 设计系统
   命名空间：cm-（community），与既有 Tailwind 工具类互不干扰
   ============================================================ */

/* ------------------------------------------------------------
   配色 v5 —— 「青蓝 · 雾白」（与全站 FLUX 主题同源）
   设计意图：
   1. 主色采用深青蓝（cyan-700 #0284c7），白底对比度 5.0:1，
      与全站 FLUX 主题（--flux-cyan）同一色相，深色模式直接用 cyan-400 #38bdf8；
   2. 画布加深一档（#f2f5f8），白卡浮起，形成 bg → surface → surface-3 三级层次；
   3. 强调色由高饱和橙（#f97316）降为橙棕（#c2410c），只在徽章/置顶等
      小面积出现，不再与主色抢视觉焦点；
   4. 文字四级：ink 18.4:1 / ink-2 10.2:1 / muted 6.9:1 / muted-2 4.8:1，
      全部满足 WCAG AA（正文 4.5:1），11px 小字也不掉线。
   ------------------------------------------------------------ */
:root {
  /* 背景层级：画布 → 卡片 → 卡内嵌层 */
  --cm-bg: #f2f5f8;
  --cm-bg-soft: #e9eff5;
  --cm-surface: #ffffff;
  --cm-surface-2: #f7f9fc;
  --cm-surface-3: #edf2f7;
  /* 文字四级 */
  --cm-ink: #0a1522;
  --cm-ink-2: #31425a;
  --cm-muted: #4a5b73;
  --cm-muted-2: #64748b;
  /* 分割线 */
  --cm-line: #e2e9f1;
  --cm-line-strong: #cbd8e5;
  /* 主色（可作前景 / 可作底） */
  --cm-brand: #0284c7;
  --cm-brand-2: #0ea5e9;
  --cm-brand-deep: #0369a1;
  --cm-brand-ink: #0369a1;
  --cm-brand-soft: rgba(56, 189, 248, 0.1);
  /* 强调色（小面积：置顶 / 模式 / 精华角标） */
  --cm-accent: #c2410c;
  --cm-accent-fill: #ea580c;
  --cm-accent-2: #f59e0b;
  --cm-accent-soft: rgba(234, 88, 12, 0.12);
  /* 语义色 */
  --cm-danger: #be123c;
  --cm-danger-soft: rgba(190, 18, 60, 0.09);
  --cm-warn: #a16207;
  --cm-warn-soft: rgba(161, 98, 7, 0.12);
  --cm-focus: rgba(56, 189, 248, 0.35);
  --cm-radius-sm: 10px;
  --cm-radius: 16px;
  --cm-radius-lg: 22px;
  --cm-shadow: 0 1px 2px rgba(10, 21, 34, 0.04), 0 10px 26px -16px rgba(10, 21, 34, 0.18);
  --cm-shadow-hover: 0 2px 6px rgba(10, 21, 34, 0.06), 0 20px 44px -22px rgba(10, 21, 34, 0.26);
  --cm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --cm-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html.dark {
  /* 暗色：墨蓝黑基底，surface 提升两档亮度，卡片不再与背景糊在一起 */
  --cm-bg: #0a1016;
  --cm-bg-soft: #0e161e;
  --cm-surface: #141d26;
  --cm-surface-2: #19232e;
  --cm-surface-3: #1f2c38;
  --cm-ink: #e9eff7;
  --cm-ink-2: #c3d0df;
  --cm-muted: #a9b8c9;
  --cm-muted-2: #8b9cb0;
  --cm-line: #24313f;
  --cm-line-strong: #33465a;
  --cm-brand: #38bdf8;
  --cm-brand-2: #7dd3fc;
  --cm-brand-deep: #0ea5e9;
  --cm-brand-ink: #7dd3fc;
  --cm-brand-soft: rgba(34, 211, 238, 0.14);
  --cm-accent: #fbbf24;
  --cm-accent-fill: #f59e0b;
  --cm-accent-2: #fdba74;
  --cm-accent-soft: rgba(251, 191, 36, 0.14);
  --cm-danger: #fb7185;
  --cm-danger-soft: rgba(251, 113, 133, 0.14);
  --cm-warn: #fdba74;
  --cm-warn-soft: rgba(253, 186, 116, 0.14);
  --cm-focus: rgba(56, 189, 248, 0.4);
  --cm-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 14px 30px -18px rgba(0, 0, 0, 0.85);
  --cm-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 52px -26px rgba(0, 0, 0, 0.95);
}

/* ---------------- 基础 ---------------- */
.cm-page {
  background: var(--cm-bg);
  color: var(--cm-ink);
  font-family: var(--cm-font);
  min-height: 70vh;
  padding-bottom: 64px;
  position: relative;
}
.cm-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 320px;
  background:
    radial-gradient(900px 220px at 18% -10%, var(--cm-brand-soft), transparent 70%),
    radial-gradient(700px 200px at 82% -20%, var(--cm-accent-soft), transparent 70%);
  pointer-events: none;
}
.cm-wrap {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 0;
}
.cm-muted { color: var(--cm-muted); }
.cm-small { font-size: 12px; }
.cm-dot { color: var(--cm-muted-2); margin: 0 2px; }
.cm-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--cm-muted);
  padding: 6px 0 18px;
}
.cm-crumb a { color: var(--cm-muted); text-decoration: none; }
.cm-crumb a:hover { color: var(--cm-brand); }
.cm-crumb-current { color: var(--cm-ink-2); }

/* ---------------- 按钮 ---------------- */
.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  line-height: 1;
}
.cm-btn:active { transform: translateY(1px) scale(0.99); }
.cm-btn--primary {
  background: linear-gradient(135deg, var(--cm-brand) 0%, var(--cm-brand-deep) 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--cm-brand) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.cm-btn--primary:hover { box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--cm-brand) 90%, transparent); filter: brightness(1.06); }
html.dark .cm-btn--primary { color: #ffffff; }
.cm-btn--ghost {
  background: var(--cm-surface);
  border-color: var(--cm-line);
  color: var(--cm-ink-2);
}
.cm-btn--ghost:hover { border-color: var(--cm-brand); color: var(--cm-brand-ink); background: var(--cm-brand-soft); }
.cm-btn--ghost.is-on { border-color: var(--cm-danger); color: var(--cm-danger); background: var(--cm-danger-soft); }
.cm-btn--ghost.is-done { color: var(--cm-muted); border-color: var(--cm-line); background: var(--cm-surface-3); }
.cm-btn--danger { background: var(--cm-danger-soft); color: var(--cm-danger); border-color: transparent; }
.cm-btn--soft { background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-btn--sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }
.cm-btn--block { width: 100%; }
.cm-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.cm-btn em { font-style: normal; font-size: 11px; opacity: 0.7; }
.cm-btn--ghost-end { margin-left: auto; }
/* 详情页配装图：深底等比展示，点击放大 */
.cm-loadout-img {
  position: relative;
  margin: 14px 0 2px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cm-line);
  background: #0b1220;
  cursor: zoom-in;
  box-shadow: 0 10px 28px -18px rgba(15, 23, 42, 0.5);
}
.cm-loadout-img img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}
.cm-loadout-img-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 8, 20, 0.55);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
/* hero 磨砂玻璃按钮：日间白磨砂+深藏青字（背景图上可读），深色恢复半透明白+亮字 */
.cm-btn--frost {
  background: rgba(255, 255, 255, 0.62);
  color: #0c4a6e;
  border: 1px solid rgba(12, 74, 110, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px -8px rgba(2, 132, 199, 0.4);
}
.cm-btn--frost:hover { background: rgba(255, 255, 255, 0.88); color: #075985; }
html.dark .cm-btn--frost {
  background: rgba(255, 255, 255, 0.1);
  color: #f0fdfa;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.dark .cm-btn--frost:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------------- 头像 / 徽章 ---------------- */
.cm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--cm-brand);
  user-select: none;
}
.cm-lv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  padding: 3.5px 9px 3.5px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  /* 日间：等级色混入深色压字，保证白底可读 */
  color: color-mix(in srgb, var(--lv, var(--cm-brand)) 72%, #0f172a);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lv, var(--cm-brand)) 18%, transparent), color-mix(in srgb, var(--lv, var(--cm-brand)) 6%, transparent)),
    var(--cm-surface-2);
  border: 1px solid color-mix(in srgb, var(--lv, var(--cm-brand)) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
.cm-lv::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--lv, var(--cm-brand));
  box-shadow: 0 0 6px color-mix(in srgb, var(--lv, var(--cm-brand)) 65%, transparent);
}
html.dark .cm-lv {
  color: color-mix(in srgb, var(--lv, var(--cm-brand)) 88%, #ffffff);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lv, var(--cm-brand)) 24%, transparent), color-mix(in srgb, var(--lv, var(--cm-brand)) 10%, transparent));
  border-color: color-mix(in srgb, var(--lv, var(--cm-brand)) 40%, transparent);
  box-shadow: none;
}
.cm-lv-rep { font-weight: 700; opacity: 0.72; font-variant-numeric: tabular-nums; }
.cm-role {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
}
.cm-role--admin { background: var(--cm-danger-soft); color: var(--cm-danger); }
.cm-role--mod { background: var(--cm-accent-soft); color: var(--cm-accent); }
.cm-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.cm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  background: var(--cm-surface-3);
  color: var(--cm-ink-2);
  border: 1px solid transparent;
}
.cm-badge--mode { background: var(--cm-accent-soft); color: var(--cm-accent); }
.cm-badge--ghost:hover { border-color: var(--cm-brand); color: var(--cm-brand-ink); }
.cm-badge--price { background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-badge--private { background: var(--cm-danger-soft); color: var(--cm-danger); }
.cm-badge--warn { background: var(--cm-warn-soft); color: var(--cm-warn); }
.cm-status {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
}
.cm-status--pending { background: var(--cm-warn-soft); color: var(--cm-warn); }

/* ---------------- 卡片 / 空状态 ---------------- */
.cm-card {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow);
}
.cm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 64px 24px;
  color: var(--cm-muted-2);
  background: var(--cm-surface);
  border: 1px dashed var(--cm-line-strong);
  border-radius: var(--cm-radius);
}
.cm-empty--sm { padding: 36px 20px; }
.cm-empty--lg { margin-top: 40px; padding: 80px 24px; }
.cm-empty-title { font-size: 20px; font-weight: 800; color: var(--cm-ink); margin: 4px 0 0; }
.cm-empty p { margin: 0; font-size: 13.5px; }
.cm-empty-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.cm-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--cm-radius-sm);
  font-size: 13px;
  background: var(--cm-surface-3);
  color: var(--cm-ink-2);
  border: 1px solid var(--cm-line);
}
.cm-callout--login { background: var(--cm-brand-soft); border-color: transparent; color: var(--cm-brand-ink); }
.cm-callout--login span { flex: 1; }
.cm-callout--warn { background: var(--cm-warn-soft); border-color: transparent; color: var(--cm-warn); }

/* ============================================================
   社区首页
   ============================================================ */
.cm-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  /* V6 浅蓝：背景图 + 轻遮罩，浅色模式深藏青文字（对比 8.5:1） */
  background:
    radial-gradient(660px 260px at 88% 4%, rgba(56, 189, 248, 0.2), transparent 62%),
    radial-gradient(520px 220px at 4% 100%, rgba(234, 88, 12, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(240, 249, 255, 0.34)),
    url("../img/community-hero.jpg") center / cover no-repeat;
  color: #0c4a6e;
  padding: 34px 34px 28px;
  margin-bottom: 22px;
  box-shadow: 0 24px 56px -32px rgba(2, 132, 199, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
html.dark .cm-hero {
  background:
    radial-gradient(660px 260px at 88% 4%, rgba(56, 189, 248, 0.14), transparent 62%),
    radial-gradient(520px 220px at 4% 100%, rgba(234, 88, 12, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(7, 22, 38, 0.88), rgba(6, 17, 30, 0.92)),
    url("../img/community-hero.jpg") center / cover no-repeat;
  color: #eaf6ff;
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.cm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(12, 74, 110, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 74, 110, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.9), transparent 70%);
  pointer-events: none;
}
html.dark .cm-hero::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}
.cm-hero-inner { position: relative; z-index: 1; }
.cm-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(12, 74, 110, 0.24);
  margin-bottom: 14px;
}
html.dark .cm-hero-eyebrow {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(125, 211, 252, 0.28);
}
.cm-hero h1 {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.cm-hero h1 span { color: #0284c7; }
html.dark .cm-hero h1 span { color: #7dd3fc; }
.cm-hero-sub { font-size: 14px; color: #075985; margin: 0 0 22px; max-width: 620px; }
html.dark .cm-hero-sub { color: rgba(234, 246, 255, 0.78); }
.cm-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.cm-hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(12, 74, 110, 0.22);
  border-radius: 12px;
  padding: 4px 4px 4px 14px;
  max-width: 520px;
  backdrop-filter: blur(6px);
}
.cm-hero-search svg { color: rgba(12, 74, 110, 0.78); flex: 0 0 auto; }
html.dark .cm-hero-search { background: rgba(56, 189, 248, 0.1); border-color: rgba(125, 211, 252, 0.24); }
html.dark .cm-hero-search svg { color: rgba(234, 246, 255, 0.6); }
.cm-hero-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #0c4a6e;
  font-size: 13.5px;
  height: 36px;
  font-family: inherit;
}
.cm-hero-search input::placeholder { color: rgba(12, 74, 110, 0.72); }
html.dark .cm-hero-search input { color: #eaf6ff; }
html.dark .cm-hero-search input::placeholder { color: rgba(234, 246, 255, 0.5); }
.cm-hero-search button {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  border: 0;
  background: #fbbf24;
  color: #451a03;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.cm-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.cm-hero-stat {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 74, 110, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
}
.cm-hero-stat b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.cm-hero-stat span { font-size: 11.5px; color: #0c4a6e; }
html.dark .cm-hero-stat { background: rgba(56, 189, 248, 0.1); border-color: rgba(125, 211, 252, 0.2); }
html.dark .cm-hero-stat span { color: rgba(234, 246, 255, 0.72); }

.cm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 22px;
  align-items: start;
}
.cm-main { min-width: 0; }

/* 类目导航 */
.cm-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.cm-cats::-webkit-scrollbar { display: none; }
.cm-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  color: var(--cm-ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}
.cm-cat:hover { border-color: var(--cm-brand); color: var(--cm-brand-ink); }
.cm-cat-count { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.cm-cat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cat-color, var(--cm-brand)); }

/* 工具栏 */
.cm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cm-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--cm-surface-3); border-radius: 11px; }
.cm-tab {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cm-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cm-tab:hover { color: var(--cm-ink-2); }
.cm-tab.is-active { background: var(--cm-surface); color: var(--cm-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.cm-toolbar-right { display: flex; align-items: center; gap: 8px; }

/* 帖子列表 */
.cm-posts { display: flex; flex-direction: column; gap: 12px; }
.cm-post {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cm-post:hover { border-color: color-mix(in srgb, var(--cm-brand) 45%, var(--cm-line)); box-shadow: var(--cm-shadow-hover); transform: translateY(-1px); }
.cm-post.is-pinned { border-left: 3px solid var(--cm-accent); }
.cm-post-av { flex: 0 0 auto; }
.cm-post-body { flex: 1; min-width: 0; }
.cm-post-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 7px; }
.cm-post-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--cat-soft, var(--cm-brand-soft));
  color: var(--cat-ink, var(--cm-brand-ink));
}
.cm-post-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
}
.cm-post-flag--essence { background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-post-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 6px;
  color: var(--cm-ink);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cm-post:hover .cm-post-title { color: var(--cm-brand-ink); }
.cm-post-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--cm-muted);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cm-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--cm-muted-2);
}
.cm-post-meta b { color: var(--cm-ink-2); font-weight: 600; }
.cm-post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cm-post-cover {
  flex: 0 0 148px;
  width: 148px;
  height: 96px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--cm-surface-3);
  align-self: center;
}
.cm-post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cm-post-tag { font-size: 11px; color: var(--cm-muted); }
.cm-post-tag:hover { color: var(--cm-brand); }

/* 侧栏 */
.cm-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.cm-side-card {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 16px 18px;
  box-shadow: var(--cm-shadow);
}
.cm-side-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--cm-ink);
}
.cm-side-title svg { color: var(--cm-brand); }
.cm-side-list { display: flex; flex-direction: column; gap: 10px; }
.cm-side-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--cm-ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.cm-side-item:hover { color: var(--cm-brand-ink); }
.cm-side-rank {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--cm-surface-3);
  color: var(--cm-muted);
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-side-item:nth-child(1) .cm-side-rank { background: var(--cm-accent); color: #fff; }
.cm-side-item:nth-child(2) .cm-side-rank { background: var(--cm-accent-soft); color: var(--cm-accent); }
.cm-side-item:nth-child(3) .cm-side-rank { background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-side-user { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.cm-side-user-name { font-size: 12.5px; font-weight: 600; color: var(--cm-ink-2); }
.cm-side-user-rep { font-size: 11px; color: var(--cm-muted-2); }
.cm-rule-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--cm-muted); }
.cm-rule-list li { display: flex; gap: 7px; line-height: 1.55; }
.cm-rule-list li::before { content: ""; flex: 0 0 5px; height: 5px; margin-top: 7px; border-radius: 50%; background: var(--cm-brand); opacity: 0.6; }
.cm-stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--cm-line); }
.cm-stat-row:last-child { border-bottom: 0; }
.cm-stat-row span { color: var(--cm-muted); }
.cm-stat-row b { color: var(--cm-ink); font-variant-numeric: tabular-nums; }

/* 分页 */
.cm-pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.cm-pager a, .cm-pager span {
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface);
  color: var(--cm-ink-2);
  font-size: 13px;
  text-decoration: none;
}
.cm-pager a:hover { border-color: var(--cm-brand); color: var(--cm-brand-ink); }
.cm-pager .is-current { background: var(--cm-ink); border-color: var(--cm-ink); color: var(--cm-surface); font-weight: 700; }
.cm-pager .is-disabled { opacity: 0.45; }

/* ============================================================
   帖子详情
   ============================================================ */
.cm-post-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.cm-article {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 26px 30px 22px;
  box-shadow: var(--cm-shadow);
}
.cm-article-head { margin-bottom: 18px; }
.cm-article-title {
  font-size: 26px;
  line-height: 1.32;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
  color: var(--cm-ink);
  word-break: break-word;
}
.cm-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cm-line);
  font-size: 12px;
  color: var(--cm-muted-2);
}
.cm-article-author { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.cm-article-author-name { font-size: 13px; font-weight: 700; color: var(--cm-ink); }
.cm-article-author-sub { font-size: 11px; color: var(--cm-muted-2); }
.cm-article-cover {
  margin: 18px 0;
  border-radius: 12px;
  overflow: hidden;
  max-height: 380px;
  background: var(--cm-surface-3);
}
.cm-article-cover img { width: 100%; height: auto; display: block; object-fit: cover; }
.cm-prose {
  font-size: 15px;
  line-height: 1.85;
  color: var(--cm-ink-2);
  word-break: break-word;
  white-space: pre-wrap;
}
.cm-article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--cm-line);
}
.cm-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface);
  color: var(--cm-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cm-action-btn:hover { border-color: var(--cm-brand); color: var(--cm-brand-ink); }
.cm-action-btn.is-on { background: var(--cm-danger-soft); border-color: transparent; color: var(--cm-danger); }
.cm-action-btn--warn:hover { border-color: var(--cm-warn); color: var(--cm-warn); }

.cm-best {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--cm-brand-soft);
  color: var(--cm-brand-ink);
  font-size: 12.5px;
  margin-top: 18px;
}

/* ============================================================
   评论（社区 + 改枪码共用）
   ============================================================ */
.cm-comments {
  margin-top: 18px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 22px 24px;
  box-shadow: var(--cm-shadow);
}
.cm-comments-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cm-block-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 0; color: var(--cm-ink); }
.cm-block-title svg { color: var(--cm-brand); }
.cm-count {
  display: inline-flex;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--cm-surface-3);
  color: var(--cm-muted);
  font-size: 11px;
  font-weight: 700;
}
.cm-editor { margin-bottom: 20px; }
.cm-editor-row { display: flex; gap: 10px; align-items: flex-start; }
.cm-editor-input { flex: 1; min-width: 0; }
.cm-editor textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface-2);
  color: var(--cm-ink);
  font-size: 13.5px;
  line-height: 1.7;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.cm-editor textarea:focus { border-color: var(--cm-brand); box-shadow: 0 0 0 3px var(--cm-focus); }
.cm-editor textarea::placeholder { color: var(--cm-muted-2); }
.cm-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cm-reply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--cm-brand-soft);
  color: var(--cm-brand-ink);
  font-size: 12px;
}
.cm-reply-hint button { border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; font-size: 12px; text-decoration: underline; }

.cm-comment-list { display: flex; flex-direction: column; }
.cm-cmt { display: flex; gap: 11px; padding: 16px 0; border-top: 1px solid var(--cm-line); }
.cm-comment-list > .cm-cmt:first-child { border-top: 0; }
.cm-cmt-av { flex: 0 0 auto; }
.cm-cmt-main { flex: 1; min-width: 0; }
.cm-cmt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.cm-cmt-name { font-size: 13px; font-weight: 700; color: var(--cm-ink); text-decoration: none; }
.cm-cmt-name:hover { color: var(--cm-brand-ink); }
.cm-cmt-replyto { font-size: 11.5px; color: var(--cm-muted); }
.cm-cmt-replyto b { color: var(--cm-brand-ink); font-weight: 600; }
.cm-cmt-time { font-size: 11px; color: var(--cm-muted-2); margin-left: auto; white-space: nowrap; }
.cm-cmt-body { font-size: 13.5px; line-height: 1.72; color: var(--cm-ink-2); word-break: break-word; }
.cm-cmt.is-deleted .cm-cmt-body { color: var(--cm-muted-2); font-style: italic; }
.cm-cmt-actions { display: flex; align-items: center; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.cm-cmt-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cm-muted-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}
.cm-cmt-act:hover { background: var(--cm-surface-3); color: var(--cm-ink-2); }
.cm-cmt-act.is-on { color: var(--cm-danger); }
.cm-cmt-act--danger:hover { color: var(--cm-danger); background: var(--cm-danger-soft); }
.cm-cmt-children {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--cm-line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cm-cmt--reply { padding: 11px 0; border-top: 1px dashed var(--cm-line); }
.cm-cmt--reply:first-child { border-top: 0; }
.cm-cmt--reply .cm-cmt-body { font-size: 13px; }
.cm-loadmore { display: flex; justify-content: center; margin-top: 14px; }

/* ============================================================
   发帖编辑器
   ============================================================ */
.cm-compose { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.cm-compose-card { background: var(--cm-surface); border: 1px solid var(--cm-line); border-radius: var(--cm-radius); box-shadow: var(--cm-shadow); overflow: hidden; }
.cm-compose-head { padding: 20px 24px 0; }
.cm-compose-title { font-size: 20px; font-weight: 900; margin: 0 0 4px; }
.cm-compose-body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.cm-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--cm-ink-2); margin-bottom: 7px; }
.cm-field label em { font-style: normal; color: var(--cm-danger); margin-left: 2px; }
.cm-field-hint { font-size: 11.5px; color: var(--cm-muted-2); font-weight: 400; margin-left: 6px; }
.cm-input, .cm-select, .cm-textarea {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface-2);
  color: var(--cm-ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.cm-input, .cm-select { height: 42px; padding: 0 13px; }
.cm-textarea { padding: 13px 14px; min-height: 300px; line-height: 1.8; resize: vertical; }
.cm-input:focus, .cm-select:focus, .cm-textarea:focus { border-color: var(--cm-brand); box-shadow: 0 0 0 3px var(--cm-focus); }
.cm-cat-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-cat-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface);
  color: var(--cm-ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cm-cat-option input { position: absolute; opacity: 0; pointer-events: none; }
.cm-cat-option:has(input:checked) { border-color: var(--cm-brand); background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--cm-line); background: var(--cm-surface-2); }
.cm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.cm-switch { position: relative; width: 40px; height: 22px; flex: 0 0 auto; }
.cm-switch input { position: absolute; opacity: 0; }
.cm-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--cm-line-strong); cursor: pointer; transition: background 0.18s; }
.cm-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.18s; }
.cm-switch input:checked + span { background: var(--cm-brand); }
.cm-switch input:checked + span::after { transform: translateX(18px); }

/* ============================================================
   用户主页 / 个人中心
   ============================================================ */
.cm-profile {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(560px 240px at 92% 0%, rgba(56, 189, 248, 0.18), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(240, 249, 255, 0.32)),
    url("../img/community-hero.jpg") center / cover no-repeat;
  color: #0c4a6e;
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: 0 22px 52px -32px rgba(2, 132, 199, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
html.dark .cm-profile {
  background:
    radial-gradient(560px 240px at 92% 0%, rgba(56, 189, 248, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(7, 22, 38, 0.88), rgba(6, 17, 30, 0.92)),
    url("../img/community-hero.jpg") center / cover no-repeat;
  color: #eaf6ff;
}
html.dark .cm-profile-sub, html.dark .cm-profile-stat span { color: rgba(234, 246, 255, 0.72); }
html.dark .cm-profile .cm-btn--ghost { background: rgba(56, 189, 248, 0.1); border-color: rgba(125, 211, 252, 0.26); color: #eaf6ff; }
.cm-profile-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cm-profile-name { font-size: 24px; font-weight: 900; margin: 0; }
.cm-profile-sub { font-size: 12.5px; color: #075985; margin-top: 4px; }
.cm-profile-stats { display: flex; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.cm-profile-stat b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.cm-profile-stat span { font-size: 11.5px; color: #0c4a6e; }
.cm-profile-side { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cm-profile .cm-btn--ghost { background: rgba(255, 255, 255, 0.6); border-color: rgba(12, 74, 110, 0.22); color: #0c4a6e; }
/* 日间 hero 是浅底：悬浮加深底色并保持深青文字（纯白文字对比度不足）；夜间深底保留白字 */
.cm-profile .cm-btn--ghost:hover { background: rgba(255, 255, 255, 0.9); border-color: rgba(2, 132, 199, 0.45); color: #075985; }
html.dark .cm-profile .cm-btn--ghost:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
/* 头部等级进度条（背景图上需比页面内进度条更强的双模式对比） */
.cm-profile-progress { background: rgba(12, 74, 110, 0.16); }
.cm-profile-progress > span { background: linear-gradient(90deg, #0284c7, #0ea5e9); box-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
.cm-profile-progress-label { color: #075985; font-weight: 600; }
html.dark .cm-profile-progress { background: rgba(255, 255, 255, 0.16); }
html.dark .cm-profile-progress > span { background: linear-gradient(90deg, var(--cm-brand), var(--cm-brand-2)); }
html.dark .cm-profile-progress-label { color: rgba(234, 246, 255, 0.78); font-weight: 500; }
/* 头部限制状态标签（禁言/禁帖等）：日间深玫红、深色浅粉 */
.cm-restrict-tag { color: #be123c; font-weight: 700; }
html.dark .cm-restrict-tag { color: #fecdd3; font-weight: 500; }

.cm-me-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.cm-me-nav { background: var(--cm-surface); border: 1px solid var(--cm-line); border-radius: var(--cm-radius); padding: 10px; position: sticky; top: 84px; }
.cm-me-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cm-muted);
  text-decoration: none;
}
.cm-me-nav a:hover { background: var(--cm-surface-3); color: var(--cm-ink-2); }
.cm-me-nav a.is-active { background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-me-nav .cm-nav-badge { margin-left: auto; background: var(--cm-danger); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; }

.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-list-item {
  display: block;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.cm-list-item:hover { border-color: color-mix(in srgb, var(--cm-brand) 40%, var(--cm-line)); }
.cm-list-title { display: block; font-size: 14.5px; font-weight: 700; color: var(--cm-ink); margin-bottom: 5px; }
.cm-list-meta { font-size: 11.5px; color: var(--cm-muted-2); display: flex; gap: 12px; flex-wrap: wrap; }
.cm-list-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.cm-notify { display: flex; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--cm-line); background: var(--cm-surface); }
.cm-notify.is-unread { background: color-mix(in srgb, var(--cm-brand) 4%, var(--cm-surface)); }
.cm-notify-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--cm-surface-3); color: var(--cm-muted); flex: 0 0 auto; }
.cm-notify-body { flex: 1; min-width: 0; font-size: 13px; color: var(--cm-ink-2); }
.cm-notify-time { font-size: 11px; color: var(--cm-muted-2); margin-top: 3px; }

/* ============================================================
   改枪码详情
   ============================================================ */
.cm-detail { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
.cm-detail-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cm-detail-head {
  background: linear-gradient(160deg, var(--cm-surface) 0%, var(--cm-surface-2) 100%);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 16px 20px 14px;
  box-shadow: var(--cm-shadow);
  position: relative;
  overflow: hidden;
}
.cm-detail-head::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cm-accent), var(--cm-brand));
  opacity: 0.85;
}
.cm-detail-title { font-size: 28px; line-height: 1.32; font-weight: 900; letter-spacing: -0.02em; margin: 12px 0 12px; color: var(--cm-ink); }
.cm-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--cm-muted-2); }
.cm-detail-author { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: inherit; }
.cm-detail-author-name { font-size: 13px; font-weight: 700; color: var(--cm-ink); }
.cm-code-card {
  background: linear-gradient(160deg, var(--cm-surface) 0%, var(--cm-surface-2) 100%);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 18px 20px 16px;
  box-shadow: var(--cm-shadow);
}
.cm-code-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cm-code-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--cm-brand-ink); }
.cm-code-len { font-size: 11.5px; color: var(--cm-muted-2); }
.cm-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--cm-ink);
  color: #d1fae5;
  font-family: var(--cm-mono);
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
html.dark .cm-code { background: #060a0e; color: #a7f3d0; }
.cm-code-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.cm-block {
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 20px 22px;
  box-shadow: var(--cm-shadow);
}
.cm-block > .cm-block-title { margin-bottom: 12px; }
.cm-prose-plain { font-size: 14px; line-height: 1.85; color: var(--cm-ink-2); }
.cm-spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.cm-spec { background: var(--cm-surface-2); border: 1px solid var(--cm-line); border-radius: 10px; padding: 10px 12px; }
.cm-spec-k { display: block; font-size: 11px; color: var(--cm-muted-2); margin-bottom: 3px; }
.cm-spec-v { font-size: 13px; font-weight: 700; color: var(--cm-ink); }
.cm-detail-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.cm-author-card { padding: 18px; }
.cm-author-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cm-author-meta { min-width: 0; }
.cm-author-name { display: block; font-size: 15px; font-weight: 800; color: var(--cm-ink); text-decoration: none; }
.cm-author-name:hover { color: var(--cm-brand-ink); }
.cm-author-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.cm-author-progress { margin-bottom: 12px; }
.cm-progress { height: 6px; border-radius: 999px; background: var(--cm-surface-3); overflow: hidden; }
.cm-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cm-brand), var(--cm-brand-2)); }
.cm-progress-label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--cm-muted-2); margin-top: 5px; }
.cm-author-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.cm-author-stats > div { background: var(--cm-surface-2); border-radius: 9px; padding: 8px 6px; text-align: center; }
.cm-author-stats b { display: block; font-size: 15px; font-weight: 800; color: var(--cm-ink); }
.cm-author-stats span { font-size: 10.5px; color: var(--cm-muted-2); }
.cm-tips { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.7; color: var(--cm-muted); display: flex; flex-direction: column; gap: 7px; }
.cm-related { display: flex; flex-direction: column; gap: 4px; }
.cm-related-item { display: block; padding: 9px 0; border-bottom: 1px dashed var(--cm-line); text-decoration: none; }
.cm-related-item:last-child { border-bottom: 0; }
.cm-related-title { font-size: 12.5px; font-weight: 600; color: var(--cm-ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-related-item:hover .cm-related-title { color: var(--cm-brand-ink); }
.cm-related-meta { display: flex; gap: 10px; font-size: 10.5px; color: var(--cm-muted-2); margin-top: 3px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .cm-layout, .cm-post-detail, .cm-detail, .cm-compose { grid-template-columns: minmax(0, 1fr); }
  .cm-side, .cm-detail-side { position: static; }
  .cm-me-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .cm-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .cm-wrap { padding: 16px 14px 0; }
  .cm-hero { padding: 24px 20px 20px; border-radius: 18px; }
  .cm-hero h1 { font-size: 26px; }
  .cm-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-post { padding: 15px 15px; gap: 12px; }
  .cm-post-cover { display: none; }
  .cm-post-title { font-size: 15.5px; }
  .cm-article { padding: 18px 16px; border-radius: 14px; }
  .cm-article-title, .cm-detail-title { font-size: 21px; }
  .cm-comments { padding: 16px 14px; border-radius: 14px; }
  .cm-detail-head { padding: 13px 15px 12px; border-radius: 14px; }
  .cm-detail-meta { gap: 6px; }
  .cm-me-grid { grid-template-columns: minmax(0, 1fr); }
  .cm-me-nav { position: static; display: flex; gap: 4px; overflow-x: auto; }
  .cm-me-nav a { white-space: nowrap; padding: 8px 11px; }
  .cm-me-nav .cm-nav-badge { display: none; }
  .cm-profile { padding: 20px; border-radius: 18px; }
  .cm-profile-side { margin-left: 0; width: 100%; }
  .cm-toolbar { align-items: flex-start; }
  .cm-toolbar-right { width: 100%; justify-content: space-between; }
  .cm-cmt-time { margin-left: 0; }
  .cm-comments-head .cm-muted { display: none; }
  .cm-editor-foot { flex-direction: column; align-items: flex-end; gap: 6px; }
  .cm-code { font-size: 11.5px; }
  .cm-btn--ghost-end { display: none; }
}

/* ---------------- 弹窗 / 表单控件 ---------------- */
.cm-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cm-modal[hidden] { display: none; }
.cm-modal-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 23, 0.55); backdrop-filter: blur(3px); }
.cm-modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.cm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--cm-line); }
.cm-modal-head h3 { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 800; margin: 0; }
.cm-modal-close { border: 0; background: transparent; color: var(--cm-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.cm-modal-body { padding: 16px 20px; }
.cm-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--cm-line); background: var(--cm-surface-2); }
.cm-radio-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cm-radio {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--cm-line);
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--cm-ink-2);
  cursor: pointer;
}
.cm-radio:has(input:checked) { border-color: var(--cm-danger); background: var(--cm-danger-soft); color: var(--cm-danger); }
.cm-radio input { accent-color: var(--cm-danger); }

/* 评论区内的空状态弱化为纯文字 */
.cm-comments .cm-empty { background: transparent; border: 0; padding: 30px 12px; }

/* ============================================================
   富文本编辑器（发帖正文）
   命名空间 cm-rte-*，与评论区轻量输入框（cm-editor）互不影响
   ============================================================ */
.cm-rte {
  border: 1px solid var(--cm-line-strong);
  border-radius: 14px;
  background: var(--cm-surface);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cm-rte.is-focused {
  border-color: var(--cm-brand);
  box-shadow: 0 0 0 3px var(--cm-focus);
}
.cm-rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 8px;
  background: linear-gradient(180deg, var(--cm-surface-2), var(--cm-surface));
  border-bottom: 1px solid var(--cm-line);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cm-rte-toolbar::-webkit-scrollbar { height: 4px; }
.cm-rte-toolbar::-webkit-scrollbar-thumb { background: var(--cm-line-strong); border-radius: 4px; }
.cm-rte-toolbar button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--cm-muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.cm-rte-toolbar button svg { width: 17px; height: 17px; }
.cm-rte-toolbar button:hover { background: var(--cm-surface-3); color: var(--cm-ink); }
.cm-rte-toolbar button.is-on {
  background: var(--cm-brand-soft);
  color: var(--cm-brand-ink);
  border-color: color-mix(in srgb, var(--cm-brand) 28%, transparent);
}
.cm-rte-toolbar button:focus-visible { outline: 2px solid var(--cm-brand); outline-offset: 1px; }
.cm-rte-block {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--cm-line);
  background: var(--cm-surface);
  color: var(--cm-ink-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 2px;
}
.cm-rte-block:focus { outline: none; border-color: var(--cm-brand); box-shadow: 0 0 0 3px var(--cm-focus); }
.cm-rte-sep { flex: 0 0 auto; width: 1px; height: 18px; background: var(--cm-line); margin: 0 5px; }
.cm-rte-surface { position: relative; }
.cm-rte-area {
  min-height: 320px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 16px 18px 20px;
  outline: none;
  font-size: 15px;
  line-height: 1.8;
  color: var(--cm-ink-2);
  word-break: break-word;
  white-space: normal;
}
.cm-rte-area:empty { min-height: 320px; }
.cm-rte.is-empty .cm-rte-area::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  color: var(--cm-muted-2);
  font-size: 14.5px;
  line-height: 1.8;
  white-space: pre-line;
  pointer-events: none;
}
.cm-rte-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--cm-line);
  background: var(--cm-surface-2);
  font-size: 11.5px;
  color: var(--cm-muted-2);
}
.cm-rte-hint { display: inline-flex; align-items: center; gap: 5px; }
.cm-rte-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.cm-rte-count.is-over { color: var(--cm-danger); }

/* 编辑器弹窗 */
.cm-rte-modal .cm-modal-box { max-width: 480px; }
.cm-rte-dialog .cm-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cm-rte-dialog .cm-field label { margin-bottom: 6px; }
.cm-rte-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--cm-surface-3); border-radius: 10px; align-self: flex-start; }
.cm-rte-tabs button {
  border: 0;
  background: transparent;
  color: var(--cm-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.cm-rte-tabs button.is-on { background: var(--cm-surface); color: var(--cm-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.cm-rte-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 16px;
  border: 1.5px dashed var(--cm-line-strong);
  border-radius: 12px;
  background: var(--cm-surface-2);
  color: var(--cm-muted);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.cm-rte-drop:hover, .cm-rte-drop.is-drag { border-color: var(--cm-brand); background: var(--cm-brand-soft); color: var(--cm-brand-ink); }
.cm-rte-tip { margin: 0; font-size: 11.5px; color: var(--cm-muted-2); }
.cm-rte-preview { border-radius: 10px; overflow: hidden; background: var(--cm-surface-3); }
.cm-rte-preview img { display: block; width: 100%; max-height: 200px; object-fit: contain; }
.cm-rte-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--cm-danger-soft);
  color: var(--cm-danger);
  font-size: 12.5px;
}
html.cm-rte-lock { overflow: hidden; }

/* 富文本正文（详情页 / 编辑器共用） */
.cm-prose--html { white-space: normal; }
.cm-prose--html > *:first-child { margin-top: 0; }
.cm-prose--html > *:last-child { margin-bottom: 0; }
.cm-prose--html p, .cm-prose--html div { margin: 0 0 14px; }
.cm-prose--html h2 {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--cm-ink);
  margin: 28px 0 12px;
  padding-left: 11px;
  border-left: 3px solid var(--cm-brand);
  letter-spacing: -0.01em;
}
.cm-prose--html h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--cm-ink);
  margin: 22px 0 10px;
}
.cm-prose--html h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--cm-ink-2);
  margin: 18px 0 8px;
}
.cm-prose--html strong, .cm-prose--html b { color: var(--cm-ink); font-weight: 700; }
.cm-prose--html ul, .cm-prose--html ol { margin: 0 0 14px; padding-left: 22px; }
.cm-prose--html li { margin: 5px 0; }
.cm-prose--html ul li::marker { color: var(--cm-brand); }
.cm-prose--html ol li::marker { color: var(--cm-brand); font-weight: 700; }
.cm-prose--html blockquote {
  margin: 16px 0;
  padding: 11px 16px;
  border-left: 3px solid var(--cm-brand);
  background: var(--cm-surface-2);
  border-radius: 0 10px 10px 0;
  color: var(--cm-ink-2);
}
.cm-prose--html blockquote p:last-child { margin-bottom: 0; }
.cm-prose--html pre {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 11px;
  background: #0f1c2b;
  color: #dbe7f5;
  font-family: var(--cm-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
html.dark .cm-prose--html pre { background: #0a131d; border: 1px solid var(--cm-line); }
.cm-prose--html code {
  font-family: var(--cm-mono);
  font-size: 0.92em;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--cm-surface-3);
  color: var(--cm-brand-ink);
}
.cm-prose--html pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.cm-prose--html a { color: var(--cm-brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cm-prose--html a:hover { color: var(--cm-brand); }
.cm-prose--html img { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 12px 0; background: var(--cm-surface-3); }
.cm-prose--html hr { border: 0; height: 1px; background: var(--cm-line); margin: 24px 0; }
.cm-prose--html table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.cm-prose--html th, .cm-prose--html td { border: 1px solid var(--cm-line); padding: 8px 10px; text-align: left; }
.cm-prose--html th { background: var(--cm-surface-2); color: var(--cm-ink); font-weight: 700; }
.cm-prose--html mark { background: rgba(250, 204, 21, 0.35); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ============================================================
   视觉打磨：统一色彩层级、阴影与交互反馈
   （配色令牌已统一收敛到文件顶部 :root / html.dark，此处只做组件级增强）
   ============================================================ */
.cm-page { -webkit-font-smoothing: antialiased; }
.cm-page ::selection { background: color-mix(in srgb, var(--cm-brand) 24%, transparent); color: var(--cm-ink); }

/* Hero：文字投影 + 玻璃层（日间白色微光 / 深色暗投影，均不压文字） */
.cm-hero h1 { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65); } html.dark .cm-hero h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22); }
.cm-hero-eyebrow { backdrop-filter: blur(6px); }
.cm-hero-stat {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(12, 74, 110, 0.16);
  border-radius: 12px;
  padding: 11px 14px;
  backdrop-filter: blur(6px);
  transition: background 0.18s ease, transform 0.18s ease;
}
.cm-hero-stat:hover { background: rgba(255, 255, 255, 0.78); transform: translateY(-1px); } html.dark .cm-hero-stat:hover { background: rgba(56, 189, 248, 0.16); }
.cm-hero-search {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(12, 74, 110, 0.22);
  backdrop-filter: blur(8px);
}
.cm-hero-search:focus-within { background: rgba(255, 255, 255, 0.78); border-color: rgba(56, 189, 248, 0.55); }
html.dark .cm-hero-search:focus-within { background: rgba(56, 189, 248, 0.16); border-color: rgba(125, 211, 252, 0.45); }

/* 分区导航：hover 抬升；选中态统一用品牌渐变（分区色只保留在小圆点上，避免导航出现彩虹色） */
.cm-cat { border-radius: 11px; transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease; }
.cm-cat:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -12px rgba(10, 21, 34, 0.45); }
.cm-cat.is-active {
  background: linear-gradient(135deg, var(--cm-brand) 0%, var(--cm-brand-deep) 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--cm-brand) 75%, transparent);
}
.cm-cat.is-active .cm-cat-dot { background: rgba(255, 255, 255, 0.9); }
.cm-cat.is-active .cm-cat-count { opacity: 0.85; }
html.dark .cm-cat.is-active { color: #ffffff; }

/* 排序标签 */
.cm-tabs { border-radius: 12px; padding: 5px; background: var(--cm-surface-3); }
.cm-tab { border-radius: 9px; transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease; }
.cm-tab.is-active { box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.3); color: var(--cm-brand-ink); }

/* 帖子卡片：hover 出现主色渐变描边与左侧光条 */
.cm-post { overflow: hidden; }
.cm-post::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cm-brand), var(--cm-brand-2));
  opacity: 0;
  transition: opacity 0.18s ease;
}
.cm-post:hover::before { opacity: 1; }
.cm-post:hover .cm-post-title { color: var(--cm-brand-ink); }
.cm-post-title { transition: color 0.16s ease; }

/* 按钮：主按钮更细腻的高光 */
.cm-btn--primary { position: relative; overflow: hidden; }
.cm-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}
.cm-btn:focus-visible, .cm-action-btn:focus-visible {
  outline: 2px solid var(--cm-brand);
  outline-offset: 2px;
}

/* 侧栏卡片 */
.cm-side-card { transition: box-shadow 0.18s ease, border-color 0.18s ease; }
.cm-side-card:hover { border-color: var(--cm-line-strong); box-shadow: var(--cm-shadow-hover); }

/* 分页 */
.cm-pager .is-current {
  background: linear-gradient(135deg, var(--cm-brand) 0%, var(--cm-brand-deep) 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--cm-brand) 85%, transparent);
}
html.dark .cm-pager .is-current { color: #ffffff; }

/* 内容区入场动画（尊重系统「减少动态效果」设置） */
@keyframes cm-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.cm-main > *, .cm-detail-main > *, .cm-me-content > * { animation: cm-fade-up 0.28s ease both; }
@media (prefers-reduced-motion: reduce) {
  .cm-main > *, .cm-detail-main > *, .cm-me-content > * { animation: none; }
  .cm-post, .cm-cat, .cm-hero-stat, .cm-btn { transition: none; }
}

/* 编辑器移动端：按钮放大、状态栏换行 */
@media (max-width: 767px) {
  .cm-rte-toolbar { padding: 6px; gap: 1px; }
  .cm-rte-toolbar button { width: 36px; height: 36px; }
  .cm-rte-toolbar button svg { width: 18px; height: 18px; }
  .cm-rte-block { height: 36px; font-size: 12px; }
  .cm-rte-area { min-height: 260px; padding: 14px; font-size: 15px; }
  .cm-rte.is-empty .cm-rte-area::before { top: 14px; left: 14px; right: 14px; }
  .cm-rte-status { padding: 8px 12px; }
  .cm-rte-hint { display: none; }
  .cm-rte-modal .cm-modal-box { max-width: 100%; }
  .cm-rte-modal .cm-modal-foot { flex-direction: column-reverse; }
  .cm-rte-modal .cm-modal-foot .cm-btn { width: 100%; }
  .cm-prose--html h2 { font-size: 18.5px; margin-top: 22px; }
  .cm-prose--html h3 { font-size: 16px; }
}
