@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 210 20% 98%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;
    --primary: 152 72% 36%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 20% 96%;
    --secondary-foreground: 222 47% 11%;
    --muted: 210 20% 96%;
    --muted-foreground: 215 16% 47%;
    --accent: 152 45% 95%;
    --accent-foreground: 152 72% 28%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --border: 214 20% 91%;
    --input: 214 20% 91%;
    --ring: 152 72% 36%;
    --radius: 0.375rem;
    /* 兼容旧样式里的文本色变量 */
    --color-text-1: hsl(var(--foreground));
    --color-text-2: hsl(215 16% 35%);
    --color-text-3: hsl(var(--muted-foreground));
    --color-text-4: hsl(215 12% 65%);
    --color-fill-3: hsl(210 20% 94%);
  }

  .dark {
    --background: 240 6% 10%;
    --foreground: 0 0% 95%;
    --card: 240 5% 13%;
    --card-foreground: 0 0% 95%;
    --popover: 240 5% 13%;
    --popover-foreground: 0 0% 95%;
    --primary: 152 58% 46%;
    --primary-foreground: 0 0% 100%;
    --secondary: 240 4% 16%;
    --secondary-foreground: 0 0% 95%;
    --muted: 240 4% 16%;
    --muted-foreground: 240 5% 65%;
    --accent: 152 30% 14%;
    --accent-foreground: 152 58% 55%;
    --destructive: 0 63% 45%;
    --destructive-foreground: 0 0% 95%;
    --border: 240 4% 18%;
    --input: 240 4% 18%;
    --ring: 152 58% 46%;
    --color-text-1: hsl(0 0% 96%);
    --color-text-2: hsl(240 5% 82%);
    --color-text-3: hsl(240 5% 70%);
    --color-text-4: hsl(240 5% 56%);
    --color-fill-3: hsl(240 4% 20%);
    --muted-foreground: 240 5% 70%;
    --foreground: 0 0% 96%;
  }
}

/* 姜十三论坛 - 清新现代主题 */
:root {
  /* 中文优先字体栈：避免 Inter 等西文字体回退导致中文发虚 */
  --j13-font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", "WenQuanYi Micro Hei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --j13-green: #18a058;
  --j13-green-hover: #138f4c;
  --j13-green-bg: rgba(24, 160, 88, 0.08);
  --j13-green-soft: #edfbf3;
  --j13-border: #e8edf2;
  --j13-border-light: #f0f3f7;
  --j13-sidebar-w: 210px;
  --j13-aside-w: 280px;
  --j13-header-h: 56px;
  --j13-max-w: 1400px;
  --j13-article-read-w: 820px;
  /* 层次：浅灰画布 → 工作区底 → 白色/淡色区块 */
  --j13-bg-page: #f5f7fa;
  --j13-bg-workspace: #f8fafc;
  --j13-bg-surface: #ffffff;
  --j13-bg-block: #ffffff;
  --j13-bg-block-muted: #f1f4f8;
  --j13-bg-block-accent: #f0faf5;
  --j13-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04);
  --j13-shadow-card: 0 2px 8px rgba(15, 23, 42, 0.05);
  /* 板块色标（8 色槽，按 board id 取模） */
  --board-0-color: #18a058;
  --board-0-bg: rgba(24, 160, 88, 0.1);
  --board-1-color: #3498db;
  --board-1-bg: rgba(52, 152, 219, 0.1);
  --board-2-color: #9b59b6;
  --board-2-bg: rgba(155, 89, 182, 0.1);
  --board-3-color: #e67e22;
  --board-3-bg: rgba(230, 126, 34, 0.1);
  --board-4-color: #e74c3c;
  --board-4-bg: rgba(231, 76, 60, 0.1);
  --board-5-color: #1abc9c;
  --board-5-bg: rgba(26, 188, 156, 0.1);
  --board-6-color: #6366f1;
  --board-6-bg: rgba(99, 102, 241, 0.1);
  --board-7-color: #f59e0b;
  --board-7-bg: rgba(245, 158, 11, 0.12);
}

.dark {
  --j13-green: #23c36b;
  --j13-green-hover: #1fb35f;
  --j13-green-bg: rgba(35, 195, 107, 0.12);
  --j13-green-soft: rgba(35, 195, 107, 0.08);
  --j13-border: #2e2e32;
  --j13-border-light: #262629;
  --j13-bg-page: #141416;
  --j13-bg-workspace: #18181b;
  --j13-bg-surface: #1f1f23;
  --j13-bg-block: #232328;
  --j13-bg-block-muted: #1c1c20;
  --j13-bg-block-accent: rgba(35, 195, 107, 0.06);
  --j13-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.2);
  --j13-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.28);
  --board-0-color: #23c36b;
  --board-0-bg: rgba(35, 195, 107, 0.14);
  --board-1-color: #5dade2;
  --board-1-bg: rgba(93, 173, 226, 0.14);
  --board-2-color: #bb86fc;
  --board-2-bg: rgba(187, 134, 252, 0.14);
  --board-3-color: #f0a050;
  --board-3-bg: rgba(240, 160, 80, 0.14);
  --board-4-color: #ff7b72;
  --board-4-bg: rgba(255, 123, 114, 0.14);
  --board-5-color: #3dd6b5;
  --board-5-bg: rgba(61, 214, 181, 0.14);
  --board-6-color: #818cf8;
  --board-6-bg: rgba(129, 140, 248, 0.14);
  --board-7-color: #fbbf24;
  --board-7-bg: rgba(251, 191, 36, 0.14);
}

.dark .app-shell {
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(35, 195, 107, 0.08), transparent 70%),
    var(--j13-bg-page);
}

* { box-sizing: border-box; }

html {
  /* 预留滚动条槽位，避免页面切换时因滚动条出现/消失导致布局抖动 */
  scrollbar-gutter: stable;
  /* 覆盖 Arco 默认 antialiased：Windows 下用 ClearType 渲染中文更清晰 */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  font-family: var(--j13-font-family);
  text-rendering: optimizeLegibility;
}

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--j13-font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-1);
  background: var(--j13-bg-page);
  overflow: hidden;
}

a { color: var(--j13-green); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(24, 160, 88, 0.07), transparent 70%),
    var(--j13-bg-page);
}

/* 顶栏 + 主体共用同一宽度容器，顶满高度、直角外框 */
.app-frame {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-width: var(--j13-max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--j13-border);
  border-right: 1px solid var(--j13-border);
  background: var(--j13-bg-surface);
}

.app-header {
  height: var(--j13-header-h);
  flex-shrink: 0;
  z-index: 100;
  background: var(--j13-bg-surface);
  border-bottom: 1px solid var(--j13-border);
}

/* 站点页脚 */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--j13-border);
  background: var(--j13-bg-surface);
  z-index: 50;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-3);
}

.site-footer__meta,
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2px;
  min-width: 0;
}

.site-footer__copy {
  color: var(--color-text-2);
  font-weight: 500;
}

.site-footer__slogan {
  color: var(--color-text-4);
}

.site-footer__sep {
  margin: 0 6px;
  color: var(--color-text-4);
  user-select: none;
}

.site-footer__nav a,
.site-footer__friend a {
  color: var(--color-text-3);
  text-decoration: none;
}

.site-footer__nav a:hover,
.site-footer__friend a:hover {
  color: var(--j13-green);
}

.site-footer__icp {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px 12px;
  }

  /* 手机端页脚在滚动容器内，随内容走，不再壳层贴底 */
  .page-wrap > .site-footer {
    flex-shrink: 0;
    margin-top: auto;
  }

  .post-list-scroll > .site-footer {
    flex-shrink: 0;
    margin-top: 8px;
  }
}

.admin-brand-sections > .admin-settings-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.admin-brand-sections > .admin-settings-section:first-of-type {
  margin-top: 16px;
}

.admin-friend-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-friend-links-row {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 720px) {
  .admin-friend-links-row {
    grid-template-columns: 1fr;
  }
}

.header-inner {
  height: 100%;
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 4px 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.header-brand:hover .header-logo-text { color: var(--j13-green); }

.header-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--j13-green) 0%, #34c471 100%);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26, 127, 75, 0.28);
  flex-shrink: 0;
  object-fit: cover;
}

img.header-logo-mark,
img.logo-mark,
img.admin-topbar-mark,
img.site-brand-logo-img {
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: transparent;
}

.header-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.header-search-wrap {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  background: var(--j13-bg-block-muted);
  border: 1px solid var(--j13-border-light);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, border-radius 0.15s;
}

.header-search-wrap--advanced {
  border-radius: 14px;
  padding-bottom: 8px;
  max-width: 480px;
}

.header-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
}

.header-search-advanced {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 0 2px 2px 24px;
}

.header-search-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-text-3, #64748b);
  cursor: pointer;
  white-space: nowrap;
}

.header-search-opt input {
  margin: 0;
}

.header-search-author {
  flex: 1;
  min-width: 7rem;
  height: 28px;
  padding: 0 0.55rem;
  border: 1px solid var(--j13-border-light);
  border-radius: 0.35rem;
  background: var(--j13-bg-surface, #fff);
  font-size: 0.78rem;
  color: var(--color-text-1);
  font-family: inherit;
}

.header-search-adv-toggle {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--color-text-3);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0 2px;
  cursor: pointer;
}

.header-search-adv-toggle.active,
.header-search-adv-toggle:hover {
  color: var(--j13-green);
}

.header-search-wrap:focus-within {
  background: var(--j13-bg-surface);
  border-color: color-mix(in srgb, var(--j13-green) 30%, transparent);
  box-shadow: 0 0 0 3px var(--j13-green-bg);
}

.header-search-icon {
  flex-shrink: 0;
  font-size: 15px;
  color: var(--color-text-3);
}

.header-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-text-1);
  font-family: inherit;
}

.header-search-input::placeholder { color: var(--color-text-4); }
.header-search-input::-webkit-search-cancel-button { display: none; }

.header-search-clear {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--color-fill-3);
  color: var(--color-text-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.header-search-clear:hover {
  background: var(--color-fill-4);
  color: var(--color-text-1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--j13-green);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(26, 127, 75, 0.22);
}

.header-compose-btn:hover {
  background: var(--j13-green-hover);
  box-shadow: 0 3px 10px rgba(26, 127, 75, 0.3);
}

.header-compose-btn:active { transform: scale(0.97); }

.header-action-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--j13-bg-block-muted);
  border: 1px solid var(--j13-border-light);
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.header-icon-btn:hover {
  background: var(--color-fill-3);
  color: var(--color-text-1);
}

.header-user-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--j13-green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s, transform 0.1s;
}

@media (hover: hover) {
  .header-user-btn:hover {
    box-shadow: 0 0 0 2px var(--j13-green-bg), 0 0 0 3px var(--j13-green);
  }
}

.header-user-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--j13-green-bg), 0 0 0 3px var(--j13-green);
}

/* 鼠标点击打开/关闭下拉后 focus 会回到按钮，隐藏默认 outline 与 hover 同款高亮 */
.header-user-btn:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.header-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-user-initial {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.header-login-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--j13-green);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.header-login-btn:hover { background: var(--j13-green-bg); }

.header-auth-slot {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.header-auth-slot--loading {
  background: var(--color-fill-3);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--j13-bg-surface);
}

.sidebar {
  width: var(--j13-sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section {
  padding: 4px 12px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-3);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-1);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav-item:hover {
  background: var(--j13-bg-block-muted);
}

.sidebar-nav-item.active {
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-weight: 600;
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-nav-item__meta {
  margin-left: auto;
  color: var(--color-text-4);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.sidebar-nav-item--board .sidebar-board-icon {
  opacity: 0.88;
}

.sidebar-nav-item--board.active .sidebar-board-icon {
  opacity: 1;
}

.sidebar-nav-item--board.active.sidebar-nav-item--board-0 { background: var(--board-0-bg); color: var(--board-0-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-1 { background: var(--board-1-bg); color: var(--board-1-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-2 { background: var(--board-2-bg); color: var(--board-2-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-3 { background: var(--board-3-bg); color: var(--board-3-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-4 { background: var(--board-4-bg); color: var(--board-4-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-5 { background: var(--board-5-bg); color: var(--board-5-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-6 { background: var(--board-6-bg); color: var(--board-6-color); }
.sidebar-nav-item--board.active.sidebar-nav-item--board-7 { background: var(--board-7-bg); color: var(--board-7-color); }

.sidebar-board-icon--0 { color: var(--board-0-color); }
.sidebar-board-icon--1 { color: var(--board-1-color); }
.sidebar-board-icon--2 { color: var(--board-2-color); }
.sidebar-board-icon--3 { color: var(--board-3-color); }
.sidebar-board-icon--4 { color: var(--board-4-color); }
.sidebar-board-icon--5 { color: var(--board-5-color); }
.sidebar-board-icon--6 { color: var(--board-6-color); }
.sidebar-board-icon--7 { color: var(--board-7-color); }

.sidebar-section--boards {
  margin-top: 8px;
}

.sidebar-actions {
  padding: 12px;
  border-top: 1px solid var(--j13-border);
  margin-top: 8px;
}

/* 标签云（右栏） */
.widget-card-icon--tags {
  color: #2a9d8f;
}

.widget-card--tags .widget-card-body--tags {
  padding: 10px 12px 14px;
  background:
    radial-gradient(ellipse 90% 70% at 10% 0%, color-mix(in srgb, var(--j13-green) 10%, transparent), transparent 55%),
    radial-gradient(ellipse 70% 60% at 95% 100%, rgba(42, 157, 143, 0.08), transparent 50%),
    var(--j13-bg-block);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 8px;
  min-height: 72px;
}

.tag-cloud--skeleton {
  justify-content: flex-start;
  gap: 8px;
}

.skeleton--tag-cloud {
  border-radius: 8px;
}

.tag-cloud-empty {
  width: 100%;
  padding: 12px 4px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-4);
}

.tag-cloud-item {
  --tag-fg: var(--color-text-2);
  --tag-bg: var(--j13-bg-block-muted);
  --tag-bd: var(--j13-border-light);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--tag-bd);
  border-radius: 8px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  line-height: 1.3;
  letter-spacing: 0.01em;
  cursor: pointer;
  transform-origin: center;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  word-break: break-word;
}

.tag-cloud-item__name {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-cloud-item__count {
  font-size: 0.72em;
  font-weight: 600;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

/* 热度档位 */
.tag-cloud-item--w0 { font-size: 11.5px; font-weight: 450; opacity: 0.82; }
.tag-cloud-item--w1 { font-size: 12.5px; font-weight: 500; }
.tag-cloud-item--w2 { font-size: 13.5px; font-weight: 560; }
.tag-cloud-item--w3 { font-size: 15px; font-weight: 650; }
.tag-cloud-item--w4 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--tag-fg) 12%, transparent);
}

/* 色调错落（绿 / 青 / 琥珀 / 蓝灰 / 玫褐 / 橄黄，避开紫系） */
.tag-cloud-item--t0 {
  --tag-fg: #1f7a4d;
  --tag-bg: color-mix(in srgb, #18a058 12%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #18a058 22%, var(--j13-border-light));
}
.tag-cloud-item--t1 {
  --tag-fg: #0f766e;
  --tag-bg: color-mix(in srgb, #2a9d8f 14%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #2a9d8f 24%, var(--j13-border-light));
}
.tag-cloud-item--t2 {
  --tag-fg: #b45309;
  --tag-bg: color-mix(in srgb, #f59e0b 14%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #f59e0b 26%, var(--j13-border-light));
}
.tag-cloud-item--t3 {
  --tag-fg: #1d4e89;
  --tag-bg: color-mix(in srgb, #3b82c4 13%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #3b82c4 24%, var(--j13-border-light));
}
.tag-cloud-item--t4 {
  --tag-fg: #9a3412;
  --tag-bg: color-mix(in srgb, #ea580c 12%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #ea580c 24%, var(--j13-border-light));
}
.tag-cloud-item--t5 {
  --tag-fg: #4d7c0f;
  --tag-bg: color-mix(in srgb, #84cc16 13%, var(--j13-bg-block));
  --tag-bd: color-mix(in srgb, #84cc16 24%, var(--j13-border-light));
}

/* 轻微错位，打破整齐栅格感 */
.tag-cloud-item--r1 { transform: translateY(1px) rotate(-0.6deg); }
.tag-cloud-item--r2 { transform: translateY(-1px) rotate(0.7deg); }
.tag-cloud-item--r3 { transform: translateY(0.5px) rotate(-0.4deg); }
.tag-cloud-item--r4 { transform: translateY(-0.5px) rotate(0.5deg); }

.tag-cloud-item:hover {
  z-index: 1;
  transform: translateY(-2px) scale(1.04);
  border-color: color-mix(in srgb, var(--tag-fg) 45%, var(--tag-bd));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tag-fg) 14%, transparent);
}

.tag-cloud-item.active {
  transform: translateY(-1px) scale(1.03);
  color: #fff;
  background: var(--tag-fg);
  border-color: transparent;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--tag-fg) 28%, transparent);
}

.tag-cloud-item.active .tag-cloud-item__count {
  opacity: 0.8;
  color: #fff;
}

.dark .widget-card--tags .widget-card-body--tags {
  background:
    radial-gradient(ellipse 90% 70% at 10% 0%, color-mix(in srgb, var(--j13-green) 16%, transparent), transparent 55%),
    radial-gradient(ellipse 70% 60% at 95% 100%, rgba(42, 157, 143, 0.12), transparent 50%),
    var(--j13-bg-block);
}

.dark .tag-cloud-item--t0 { --tag-fg: #6ee7a8; --tag-bg: rgba(24, 160, 88, 0.16); --tag-bd: rgba(24, 160, 88, 0.32); }
.dark .tag-cloud-item--t1 { --tag-fg: #5eead4; --tag-bg: rgba(42, 157, 143, 0.16); --tag-bd: rgba(42, 157, 143, 0.32); }
.dark .tag-cloud-item--t2 { --tag-fg: #fbbf24; --tag-bg: rgba(245, 158, 11, 0.14); --tag-bd: rgba(245, 158, 11, 0.3); }
.dark .tag-cloud-item--t3 { --tag-fg: #7dd3fc; --tag-bg: rgba(59, 130, 196, 0.16); --tag-bd: rgba(59, 130, 196, 0.32); }
.dark .tag-cloud-item--t4 { --tag-fg: #fdba74; --tag-bg: rgba(234, 88, 12, 0.14); --tag-bd: rgba(234, 88, 12, 0.3); }
.dark .tag-cloud-item--t5 { --tag-fg: #bef264; --tag-bg: rgba(132, 204, 22, 0.14); --tag-bd: rgba(132, 204, 22, 0.3); }

/* 文章目录树 */
.sidebar--outline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-outline-back {
  margin: 0 8px 4px;
  width: calc(100% - 16px);
  color: var(--color-text-2);
}

.article-outline {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.article-outline-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.article-outline-head svg {
  opacity: 0.7;
}

/* 嵌在右栏 widget 内时隐藏组件自带标题 */
.article-outline--aside .article-outline-head {
  display: none;
}

.article-outline--aside .article-outline-empty {
  padding: 4px 0 8px;
}

.article-outline--aside .article-outline-nav {
  padding: 0 0 4px;
}

.article-outline-empty {
  margin: 0;
  padding: 8px 16px 16px;
  font-size: 12px;
  color: var(--color-text-4);
  line-height: 1.5;
}

.article-outline-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px 16px;
}

.widget-card--outline .widget-card-body {
  padding-top: 2px;
}

.widget-author-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px 12px;
}

.widget-author-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.widget-author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--j13-border-light);
}

.widget-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-author-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.widget-author-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.widget-author-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.widget-author-name:hover {
  color: var(--j13-green);
}

.widget-author-badge {
  flex-shrink: 0;
  font-size: 10px;
  height: 18px;
  padding: 0 6px;
  font-weight: 600;
}

.widget-author-signature {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-3);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-author-stats {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 11px;
  line-height: 1.25;
  color: var(--color-text-4);
}

.widget-author-stats-dot {
  margin: 0 5px;
  opacity: 0.55;
}

.widget-author-views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.widget-author-views svg {
  opacity: 0.7;
}

.widget-author-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--j13-border-light);
}

.widget-author-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
  color: var(--color-text-3);
  font-size: 11px;
}

.widget-author-metric svg {
  opacity: 0.75;
}

.widget-author-metric strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-1);
  line-height: 1.2;
}

.widget-author-actions {
  display: flex;
  gap: 8px;
}

.widget-author-action {
  flex: 1;
}

.widget-card-icon--author,
.widget-card-icon--outline {
  color: var(--j13-green);
}

.widget-outline-body {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.article-outline-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 10px 7px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-2);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.article-outline-item:hover {
  background: var(--j13-bg-block-muted);
  color: var(--color-text-1);
}

.article-outline-item.active {
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-weight: 600;
}

/* 当前节：左侧短竖条，呼应正文标题绿横线 */
.article-outline-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--j13-green);
  border-radius: 1px;
}

.article-outline-item--l2 { padding-left: 20px; font-size: 12.5px; }
.article-outline-item--l3 { padding-left: 28px; font-size: 12px; color: var(--color-text-3); }
.article-outline-item--l4,
.article-outline-item--l5,
.article-outline-item--l6 { padding-left: 36px; font-size: 12px; color: var(--color-text-3); }

.article-outline-item--l3.active,
.article-outline-item--l4.active,
.article-outline-item--l5.active,
.article-outline-item--l6.active {
  color: var(--j13-green);
}

.post-detail-content .post-heading-anchor {
  scroll-margin-top: 16px;
}

/* 标题旁 #：hover 显现，点击复制锚点链接 */
.post-detail-content .post-heading-anchor-link {
  margin-left: 0.4em;
  font-weight: 500;
  font-size: 0.82em;
  line-height: 1;
  color: var(--j13-green);
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.2s ease;
  vertical-align: 0.05em;
}

.post-detail-content h1:hover .post-heading-anchor-link,
.post-detail-content h2:hover .post-heading-anchor-link,
.post-detail-content h3:hover .post-heading-anchor-link,
.post-detail-content h4:hover .post-heading-anchor-link,
.post-detail-content h5:hover .post-heading-anchor-link,
.post-detail-content h6:hover .post-heading-anchor-link,
.post-detail-content .post-heading-anchor-link:focus-visible {
  opacity: 0.75;
}

.post-detail-content .post-heading-anchor-link:hover {
  opacity: 1 !important;
}

.post-detail-toc-mobile {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block-muted);
}

.post-detail-toc-mobile > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
  list-style: none;
}

.post-detail-toc-mobile > summary::-webkit-details-marker {
  display: none;
}

.post-detail-toc-mobile .article-outline-head {
  display: none;
}

.post-detail-toc-mobile .article-outline-nav {
  padding: 8px 0 0;
}

.post-detail-toc-mobile .article-outline-item {
  white-space: normal;
}

.main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 与左栏、顶栏同色，避免露出外层画布灰底 */
  background: var(--j13-bg-surface);
}

/* 主内容 + 右栏：与左栏同色，整块平铺 */
.content-workspace {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--j13-bg-surface);
}

.aside-panel {
  width: var(--j13-aside-w);
  flex-shrink: 0;
  border-left: 1px solid var(--j13-border-light);
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--j13-bg-surface);
  min-height: 0;
}

.aside-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  flex: 1;
  min-height: 0;
}

/* 详情页：作者 + 目录占满右栏，目录过长时内部滚动 */
.aside-panel:has(.aside-panel-inner--post-detail) {
  overflow: hidden;
}

.aside-panel-inner--post-detail {
  height: 100%;
}

.aside-panel-inner--post-detail .widget-card--author {
  flex-shrink: 0;
}

.aside-panel-inner--post-detail .widget-card--outline {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.aside-panel-inner--post-detail .widget-card--outline .widget-card-head {
  flex-shrink: 0;
}

.aside-panel-inner--post-detail .widget-outline-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1100px) { .aside-panel { display: none; } }

/* 右侧栏隐藏时：主列内容居中收束，避免右侧大片空场 */
@media (max-width: 1100px) and (min-width: 769px) {
  .content-workspace--aside-hidden .main-content > .page-wrap,
  .content-workspace--aside-hidden .main-content > .page-wrap--feed {
    max-width: 920px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .content-workspace--aside-hidden .main-content > .post-detail-page {
    max-width: min(920px, var(--j13-article-read-w) + 80px);
  }
}

/* 窄屏社区动态抽屉（替代隐藏的右侧栏） */
.aside-drawer-root,
.sidebar-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.aside-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.aside-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: var(--j13-bg-surface);
  border-left: 1px solid var(--j13-border);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  animation: aside-drawer-in 0.2s ease;
}

/* 手机端左侧导航抽屉（替代隐藏的左侧栏） */
.sidebar-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 86vw);
  background: var(--j13-bg-surface);
  border-right: 1px solid var(--j13-border);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  animation: sidebar-drawer-in 0.2s ease;
}

.sidebar-drawer-body {
  display: flex;
  flex-direction: column;
}

.sidebar-drawer-body .sidebar {
  display: block;
  width: 100%;
  border-right: none;
  flex: 1;
  min-height: 0;
}

@keyframes aside-drawer-in {
  from { transform: translateX(12px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes sidebar-drawer-in {
  from { transform: translateX(-12px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.aside-drawer-head {
  height: var(--j13-header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--j13-border);
  font-size: 14px;
  font-weight: 600;
  background: var(--j13-bg-surface);
}

.aside-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
  .aside-drawer,
  .sidebar-drawer { animation: none; }
}
@media (max-width: 768px) {
  .app-frame { border-left: none; border-right: none; }
  .sidebar { display: none; }
  .header-inner { padding: 0 12px; gap: 8px; }
  .header-search-wrap { max-width: none; }
  .header-search-wrap--expanded {
    flex: 1;
    max-width: none;
  }
  .header-search-cancel {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--j13-green);
    font-size: 13px;
    font-family: inherit;
    padding: 0 4px;
    cursor: pointer;
  }
  .header-compose-btn { width: 34px; padding: 0; justify-content: center; }
  .feed-banner-row { flex-direction: row; gap: 10px; }
  .sidebar-drawer-extras {
    margin-top: auto;
    padding: 12px 8px 8px;
    border-top: 1px solid var(--j13-border-light);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sidebar-drawer-extra-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-1);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
  }
  .sidebar-drawer-extra-btn:hover {
    background: var(--j13-bg-block-muted);
  }
}

.page-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px;
}

/* 首页 Feed：仅列表区域滚动，避免与 page-wrap 双滚动 */
.page-wrap--feed {
  overflow: hidden;
}

/* 回到顶部 / 前往评论：贴合 app-frame 右缘 */
.back-to-top-stack {
  position: fixed;
  right: max(16px, calc((100vw - min(100vw, var(--j13-max-w))) / 2 + 16px));
  bottom: 28px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.back-to-top-stack--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top {
  position: relative;
  right: auto;
  bottom: auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--j13-border);
  border-radius: 50%;
  background: var(--j13-bg-surface);
  color: var(--j13-green);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--j13-shadow-card);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.back-to-top:hover {
  background: var(--j13-green);
  color: #fff;
  border-color: var(--j13-green);
  box-shadow: 0 3px 12px rgba(26, 127, 75, 0.28);
}

.back-to-top:active {
  transform: scale(0.96);
}

/* 手机端自定义下拉刷新指示器（原生 PTR 依赖 document 滚动） */
.ptr-indicator {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}

/* 有顶栏时从顶栏下方露出，避免叠在导航上造成「气泡错位」 */
body:has(.app-header) .ptr-indicator,
body:has(.admin-topbar) .ptr-indicator {
  top: calc(var(--j13-header-h) + env(safe-area-inset-top, 0px));
}

/* 仅松手回弹 / 进入刷新态时过渡，拖动跟手不加 transition */
.ptr-indicator--settling {
  transition: transform 0.2s ease-out;
}

.ptr-indicator__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--j13-border);
  background: var(--j13-bg-surface);
  color: var(--color-text-2);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--j13-shadow-card);
}

.ptr-indicator--ready .ptr-indicator__chip {
  color: var(--j13-green);
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border));
  background: var(--j13-green-bg);
}

.ptr-indicator__arrow {
  transition: transform 0.15s ease;
}

.ptr-indicator__spin {
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

@media (hover: hover) and (pointer: fine) {
  .ptr-indicator { display: none; }
}


@media (max-width: 768px) {
  .back-to-top-stack {
    right: 14px;
    bottom: 20px;
  }
  .back-to-top {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top-stack {
    transition: opacity 0.15s ease, visibility 0.15s ease;
    transform: none;
  }

  .back-to-top-stack--visible {
    transform: none;
  }

  .back-to-top:active {
    transform: none;
  }
}

.feed-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block);
  box-shadow: var(--j13-shadow-card);
  overflow: hidden;
}

.page-wrap::-webkit-scrollbar {
  display: none;
}

.virtual-list-wrap,
.post-list-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.virtual-list-wrap::-webkit-scrollbar,
.post-list-scroll::-webkit-scrollbar {
  display: none;
}

.feed-list-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px 16px;
}

.feed-list-footer--end {
  font-size: 12px;
  color: var(--color-text-3);
  padding: 10px 12px;
}

.feed-list-footer--pagination {
  border-top: 1px solid var(--j13-border-light);
  margin-top: 4px;
}

.feed-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  width: 100%;
  flex-wrap: wrap;
}

.feed-pagination__meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3);
  white-space: nowrap;
  min-width: 4.5rem;
}

.feed-pagination__meta strong {
  font-weight: 600;
  color: var(--color-text-2);
  font-variant-numeric: tabular-nums;
}

.feed-pagination__pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.feed-pagination__nav,
.feed-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 30px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-2);
  font-family: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.feed-pagination__nav:hover:not(:disabled),
.feed-pagination__page:hover:not(:disabled) {
  background: var(--j13-bg-block-muted);
  color: var(--color-text-1);
}

.feed-pagination__page.is-active {
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-weight: 600;
  cursor: default;
}

.feed-pagination__nav:disabled,
.feed-pagination__page:disabled:not(.is-active) {
  opacity: 0.35;
  cursor: not-allowed;
}

.feed-pagination__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: var(--color-text-4);
  font-size: 13px;
  user-select: none;
}

.feed-pagination__jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 2px 8px 2px 10px;
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.feed-pagination__jump:focus-within {
  background: var(--j13-bg-surface);
  border-color: color-mix(in srgb, var(--j13-green) 30%, transparent);
  box-shadow: 0 0 0 3px var(--j13-green-bg);
}

.feed-pagination__jump-label,
.feed-pagination__jump-suffix {
  font-size: 12px;
  color: var(--color-text-3);
  white-space: nowrap;
}

.feed-pagination__jump-input {
  width: 2.4rem;
  height: 24px;
  border: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text-1);
  font-variant-numeric: tabular-nums;
}

.feed-pagination__jump-input:disabled {
  opacity: 0.5;
}

@media (max-width: 640px) {
  .feed-pagination {
    justify-content: center;
  }

  .feed-pagination__meta {
    width: 100%;
    text-align: center;
    min-width: 0;
  }

  .feed-pagination__pages {
    flex: 1 1 100%;
    order: 1;
  }

  .feed-pagination__jump {
    order: 2;
  }
}

.page-inner { padding: 20px 24px; max-width: 720px; }
.page-inner-wide { padding: 20px 24px; }
.page-inner-wide--profile { max-width: 820px; }
.page-title { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.page-desc { font-size: 13px; color: var(--color-text-3); margin: 0 0 20px; }

.content-surface {
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-soft);
  overflow: hidden;
}

.feed-panel .content-surface {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.section-card {
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-soft);
  padding: 20px;
  margin-bottom: 16px;
}

.section-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--j13-border-light);
}

.feed-top {
  flex-shrink: 0;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block);
  position: relative;
}

.feed-top::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--j13-green) 0%, transparent 55%);
  opacity: 0.35;
  pointer-events: none;
}

@media (min-width: 900px) {
  .feed-top__bar:not(:has(.feed-head--solo)) {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 16px;
  }

  .feed-top__bar:not(:has(.feed-head--solo)) .feed-head {
    padding: 0;
    flex-shrink: 0;
  }

  .feed-top__bar:not(:has(.feed-head--solo)) .feed-toolbar {
    padding: 0;
    flex: 1;
    min-width: 0;
  }
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 6px;
}

.feed-head--solo {
  padding-bottom: 8px;
}

.feed-head--stats-only .feed-head__title {
  align-items: center;
}

.feed-head__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.feed-head h1,
.feed-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.feed-head__meta {
  font-size: 12px;
  color: var(--color-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-head__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.feed-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--color-text-3);
  background: var(--j13-bg-block-muted);
  white-space: nowrap;
}

.feed-stat-chip svg {
  width: 12px;
  height: 12px;
  color: var(--j13-green);
  opacity: 0.85;
}

.feed-stat-chip strong {
  color: var(--j13-green);
  font-weight: 600;
}

.feed-stat-chip--muted {
  background: transparent;
  color: var(--color-text-4);
  padding-left: 2px;
}

.feed-head__meta strong {
  color: var(--j13-green);
  font-weight: 600;
}

.feed-head__dot {
  margin: 0 4px;
  opacity: 0.55;
}

.feed-head__clear {
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: var(--j13-green);
  cursor: pointer;
  font-family: inherit;
}

.feed-head__clear:hover {
  text-decoration: underline;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 8px;
}

.feed-toolbar__spacer {
  flex: 1;
  min-width: 0;
}

.feed-toolbar__count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-3);
  white-space: nowrap;
}

/* 兼容旧类名，避免其他页面引用失效 */
.feed-banner {
  padding: 8px 16px;
  border-bottom: 1px solid var(--j13-border-light);
}

.feed-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feed-banner-title { flex: 1; min-width: 0; }

.feed-banner h2 { margin: 0; font-size: 15px; font-weight: 600; }
.feed-banner p { margin: 0; font-size: 12px; color: var(--color-text-3); line-height: 1.45; }

.feed-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-3);
}

.feed-stats strong { color: var(--j13-green); font-weight: 600; }

.feed-action-slot {
  display: inline-block;
  width: 88px;
  height: 28px;
  border-radius: 4px;
  background: var(--color-fill-3);
}

.feed-actions {
  min-height: 28px;
}

.mobile-board-bar {
  display: none;
  padding: 8px 12px;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--j13-border);
  background: var(--j13-bg-surface);
}

@media (max-width: 768px) { .mobile-board-bar { display: flex; } }

.board-chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.board-chip:focus-visible {
  outline: 2px solid var(--j13-green);
  outline-offset: 2px;
}

.board-chip.active {
  background: var(--j13-green-bg);
  border-color: transparent;
  color: var(--j13-green);
  font-weight: 600;
}

.board-chip.active.board-chip--0 { background: var(--board-0-bg); color: var(--board-0-color); }
.board-chip.active.board-chip--1 { background: var(--board-1-bg); color: var(--board-1-color); }
.board-chip.active.board-chip--2 { background: var(--board-2-bg); color: var(--board-2-color); }
.board-chip.active.board-chip--3 { background: var(--board-3-bg); color: var(--board-3-color); }
.board-chip.active.board-chip--4 { background: var(--board-4-bg); color: var(--board-4-color); }
.board-chip.active.board-chip--5 { background: var(--board-5-bg); color: var(--board-5-color); }
.board-chip.active.board-chip--6 { background: var(--board-6-bg); color: var(--board-6-color); }
.board-chip.active.board-chip--7 { background: var(--board-7-bg); color: var(--board-7-color); }

/* 帖子排序栏：与左侧栏 active 样式保持一致 */
.feed-sort-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.feed-sort-bar::-webkit-scrollbar { display: none; }

.feed-sort-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-2);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.feed-sort-tab:hover {
  background: var(--j13-bg-block-muted);
  color: var(--color-text-1);
}

.feed-sort-tab.active {
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-weight: 600;
}

.feed-sort-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .feed-head {
    flex-wrap: wrap;
    padding: 8px 12px 6px;
  }

  .feed-head__meta,
  .feed-head__stats { display: none; }

  .feed-toolbar {
    padding: 0 12px 8px;
  }

  .page-wrap {
    padding: 0;
  }

  .feed-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /*
   * 手机 Feed：主栏整页滚动，板块条 / 最新发帖·回复排序栏随列表滚走，
   * 避免它们占住视口上半，给帖子列表更多空间。
   */
  .main-content--feed-mobile-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .main-content--feed-mobile-scroll .page-wrap--feed {
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
  }

  .main-content--feed-mobile-scroll .feed-panel {
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
  }

  .main-content--feed-mobile-scroll .feed-top {
    flex-shrink: 0;
  }

  .main-content--feed-mobile-scroll .post-list-scroll {
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
  }

  .main-content--feed-mobile-scroll .mobile-board-bar {
    flex-shrink: 0;
    position: static;
  }
}

.post-list-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--color-text-3);
  border-bottom: 1px solid var(--j13-border-light);
}

.post-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--j13-border-light);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.post-row:hover {
  background: var(--j13-bg-block-accent);
}

.post-row:focus-visible {
  outline: none;
  background: var(--j13-bg-block-accent);
  box-shadow: inset 0 0 0 2px var(--j13-green-bg);
}

.post-row:hover .post-title,
.post-row:focus-visible .post-title {
  color: var(--j13-green);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--j13-green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  margin-top: 2px;
}

.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.post-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-3);
}

.post-author {
  color: var(--color-text-2);
  font-weight: 500;
  flex-shrink: 0;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
}

.post-author:hover {
  color: var(--j13-green);
}

.post-head-dot {
  color: var(--color-text-4);
  flex-shrink: 0;
}

.post-time {
  flex-shrink: 0;
  color: var(--color-text-4);
  font-variant-numeric: tabular-nums;
}

.post-head-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.post-pin-badge,
.post-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.post-pin-badge {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.22);
}

/* 板块置顶：与全局置顶同结构，用偏暖橙区分 */
.post-pin-badge--board {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.1);
  border-color: rgba(234, 88, 12, 0.22);
}

.post-pin-badge--detail {
  margin-right: 8px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  vertical-align: middle;
}

.dark .post-pin-badge {
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
}

.dark .post-pin-badge--board {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.28);
}

.post-status-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.post-status-badge--pending {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.post-status-badge--rejected {
  color: #be123c;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* 问答帖：未解决 / 已解决 */
.post-qa-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

.post-qa-badge--detail {
  margin-right: 8px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
}

.post-qa-badge--open {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.1);
  border: 1px solid rgba(234, 88, 12, 0.22);
}

/* 已解决：绿色 */
.post-qa-badge--resolved {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border: 1px solid color-mix(in srgb, var(--j13-green) 20%, transparent);
}

.post-moderation-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.post-moderation-banner--pending {
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.post-moderation-banner--rejected {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.dark .post-moderation-banner--pending {
  color: #fbbf24;
}

.dark .post-moderation-banner--rejected {
  color: #fb7185;
}

.waline-comment-status--pending { color: #d97706; }
.waline-comment-status--rejected { color: #e11d48; }

.post-feature-badge {
  padding: 0 7px 0 5px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.dark .post-feature-badge {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.22);
}

.post-feature-badge .post-featured-icon {
  color: inherit;
  vertical-align: 0;
}

.post-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.post-title-row .post-qa-badge,
.post-title-row .post-pin-badge,
.post-title-row .post-feature-badge,
.post-title-row .post-status-badge {
  flex-shrink: 0;
}

.post-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  font-family: inherit;
  color: var(--color-text-1);
  text-decoration: none;
  transition: color 0.15s;
  min-width: 0;
  flex: 1;
}

a.post-title:visited {
  color: var(--color-text-1);
}

.post-excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  min-width: 0;
}

.post-foot-left {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.post-list-tag {
  display: inline-flex;
  align-items: center;
  max-width: 7rem;
  padding: 0.1rem 0.4rem;
  border: 0;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 16%, transparent);
  color: var(--color-text-3, #64748b);
  font-size: 0.7rem;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-list-tag:hover {
  color: var(--j13-green, #18a058);
  background: color-mix(in srgb, var(--j13-green, #18a058) 12%, transparent);
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--color-text-4);
}

.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-4);
  font-variant-numeric: tabular-nums;
}

.post-stat svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.post-row:hover .post-stat,
.post-row:focus-visible .post-stat {
  color: var(--color-text-3);
}

.post-stat--zero {
  opacity: 0.55;
}

.post-stat--media {
  opacity: 0.8;
}

.post-featured-icon {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
  color: #d97706;
  stroke-width: 1.75;
}

.dark .post-featured-icon {
  color: #fbbf24;
}

.post-meta {
  font-size: 12px;
  color: var(--color-text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 板块色标 Badge */
.board-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.board-badge--0 { background: var(--board-0-bg); color: var(--board-0-color); }
.board-badge--1 { background: var(--board-1-bg); color: var(--board-1-color); }
.board-badge--2 { background: var(--board-2-bg); color: var(--board-2-color); }
.board-badge--3 { background: var(--board-3-bg); color: var(--board-3-color); }
.board-badge--4 { background: var(--board-4-bg); color: var(--board-4-color); }
.board-badge--5 { background: var(--board-5-bg); color: var(--board-5-color); }
.board-badge--6 { background: var(--board-6-bg); color: var(--board-6-color); }
.board-badge--7 { background: var(--board-7-bg); color: var(--board-7-color); }

/* 板块管理：图标 / 色标选择器 */
.board-manage-dialog {
  max-width: 520px;
}

.board-appearance-picker__preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.board-appearance-picker__preview-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--j13-bg-block-muted);
}

.board-appearance-picker__preview-icon svg {
  width: 20px;
  height: 20px;
}

.board-appearance-picker__preview-hint {
  font-size: 12px;
  color: var(--color-text-3);
}

.board-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.board-icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--j13-border-light);
  border-radius: 8px;
  background: var(--j13-bg-block);
  color: var(--color-text-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.board-icon-option svg {
  width: 18px;
  height: 18px;
}

.board-icon-option:hover {
  border-color: var(--j13-green);
  background: var(--j13-bg-block-muted);
}

.board-icon-option--active {
  border-color: var(--j13-green);
  background: var(--j13-green-bg);
  color: var(--j13-green);
}

.board-icon-option__auto {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-3);
}

.board-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.board-color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}

.board-color-option:hover {
  transform: scale(1.08);
}

.board-color-option--active {
  box-shadow: 0 0 0 2px var(--j13-bg-block), 0 0 0 3px var(--j13-green);
}

.board-color-option--auto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--j13-bg-block-muted);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-3);
}

.board-color-option--0 { background: var(--board-0-color); }
.board-color-option--1 { background: var(--board-1-color); }
.board-color-option--2 { background: var(--board-2-color); }
.board-color-option--3 { background: var(--board-3-color); }
.board-color-option--4 { background: var(--board-4-color); }
.board-color-option--5 { background: var(--board-5-color); }
.board-color-option--6 { background: var(--board-6-color); }
.board-color-option--7 { background: var(--board-7-color); }

.board-table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
}

.board-table-icon svg {
  width: 18px;
  height: 18px;
}

/* 帖子列表骨架屏 */
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--j13-bg-block-muted) 0%,
    var(--j13-bg-block) 45%,
    var(--j13-bg-block-muted) 90%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.post-row--skeleton {
  pointer-events: none;
  cursor: default;
}

.post-row--skeleton:hover {
  background: transparent;
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.skeleton--title {
  height: 18px;
  max-width: 100%;
}

.skeleton--excerpt {
  height: 13px;
  max-width: 100%;
}

.skeleton-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skeleton--badge {
  width: 52px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton--meta {
  height: 12px;
  width: 56px;
  flex-shrink: 0;
}

.skeleton--meta-short {
  width: 72px;
}

.skeleton--stat {
  width: 28px;
  height: 14px;
  border-radius: 4px;
}

.skeleton--feed-title {
  width: 96px;
  height: 18px;
}

.skeleton--stat-chip {
  width: 72px;
  height: 22px;
  border-radius: 999px;
}

.feed-toolbar--skeleton {
  pointer-events: none;
}

.skeleton--sort-tab {
  width: 72px;
  height: 28px;
  border-radius: 8px;
}

.skeleton--count {
  width: 56px;
  height: 14px;
  margin-left: auto;
}

.sidebar-nav-item--skeleton {
  pointer-events: none;
  cursor: default;
  gap: 10px;
}

.sidebar-nav-item--skeleton:hover {
  background: transparent;
}

.skeleton--sidebar-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton--sidebar-label {
  height: 12px;
  flex: 1;
  max-width: 120px;
}

.widget-item--skeleton {
  pointer-events: none;
  cursor: default;
}

.widget-item--skeleton:hover {
  background: transparent;
}

.skeleton--widget-rank {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton--widget-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton--widget-title {
  height: 12px;
  flex: 1;
  min-width: 0;
}

.skeleton--widget-time {
  width: 36px;
  height: 10px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 404 / 错误页 */
.error-page-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--j13-bg, var(--background));
}

.error-page {
  text-align: center;
  padding: 48px 24px 64px;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.error-page__code {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--j13-green, var(--primary));
  opacity: 0.18;
  user-select: none;
}

.error-page__icon {
  color: var(--color-text-4);
  margin-top: -28px;
}

.error-page__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-1);
}

.error-page__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-3);
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.empty-feed {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state-icon,
.empty-feed-icon,
.comment-empty-icon {
  display: block;
  color: var(--color-text-4);
  margin-bottom: 4px;
  opacity: 0.9;
}

.comment-empty-icon {
  margin: 0 auto 8px;
}

.empty-feed-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-4);
}

.empty-feed-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.projects-list .project-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
}
.projects-list .project-row:last-child {
  border-bottom: none;
}
.project-row-body {
  min-width: 0;
  flex: 1;
}
.project-row-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
.project-row-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-3);
}
.project-row-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  padding-top: 2px;
}
.project-row-link:hover {
  text-decoration: underline;
}
.projects-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.projects-pager-info {
  font-size: 13px;
  color: var(--color-text-3);
}

.admin-entry-desc {
  font-size: 13px;
  color: var(--color-text-3);
  margin: 0 0 12px;
}

.sidebar-section--spaced {
  margin-top: 8px;
}

.error-boundary {
  padding: 24px;
  text-align: center;
}

.error-boundary-msg {
  color: var(--color-text-3);
  font-size: 13px;
  margin: 8px 0 16px;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-3);
}

.auth-footer-sep {
  margin: 0 0.4rem;
  color: var(--color-text-4, #94a3b8);
}

.post-detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  flex: 1;
}

.post-detail-page {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
  padding: 16px 20px 24px;
  background: var(--j13-bg-workspace);
  /* 长文需要可拖拽定位；列表页仍隐藏滚动条保持干净 */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--j13-green) 45%, var(--j13-border)) transparent;
  -ms-overflow-style: auto;
}

.post-detail-page::-webkit-scrollbar {
  width: 8px;
}

.post-detail-page::-webkit-scrollbar-track {
  background: transparent;
}

.post-detail-page::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.post-detail-page::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--j13-green) 65%, var(--j13-border));
  background-clip: padding-box;
  border: 2px solid transparent;
}

.post-detail-header {
  padding: 16px 20px 20px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
  flex-shrink: 0;
}

.post-detail-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.post-detail-board-tag { margin: 0 !important; }

.post-detail-head { margin-bottom: 12px; }

.post-detail-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.45;
  word-break: break-word;
}

.post-detail-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.post-detail-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-detail-author-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-1);
}

.post-detail-meta-line {
  font-size: 12px;
  color: var(--color-text-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.post-detail-locked-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  color: hsl(var(--destructive));
  font-size: 11px;
}

.comment-locked-banner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.4rem;
  border: 1px solid color-mix(in srgb, hsl(var(--destructive)) 28%, transparent);
  background: color-mix(in srgb, hsl(var(--destructive)) 8%, transparent);
  color: hsl(var(--destructive));
  font-size: 0.875rem;
}

.post-detail-edit-hint {
  font-size: 12px;
  color: var(--color-text-3);
  align-self: center;
}

.post-revision-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.post-revision-overlay--fullscreen {
  padding: 0;
}

.post-revision-panel {
  background: hsl(var(--background));
  border-radius: 12px;
  width: min(1080px, 100%);
  height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.post-revision-panel--fullscreen {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
}

.post-revision-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  flex-shrink: 0;
}

.post-revision-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.post-revision-head-left h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.post-revision-head-sub {
  font-size: 12px;
  color: var(--color-text-3);
  padding-left: 8px;
  border-left: 1px solid var(--j13-border-light);
}

.post-revision-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.post-revision-view-tabs {
  display: flex;
  gap: 2px;
  background: hsl(var(--muted));
  border-radius: 8px;
  padding: 3px;
}

.post-revision-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-text-2);
  cursor: pointer;
  white-space: nowrap;
}

.post-revision-tab:hover {
  color: var(--color-text-1);
}

.post-revision-tab.active {
  background: hsl(var(--background));
  color: var(--color-text-1);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.post-revision-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-3);
}

.post-revision-icon-btn:hover {
  background: hsl(var(--muted));
  color: var(--color-text-1);
}

.post-revision-loading,
.post-revision-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--color-text-3);
  font-size: 14px;
}

.post-revision-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.post-revision-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--j13-border-light);
  min-height: 0;
}

.post-revision-sidebar-label {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-3);
}

.post-revision-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.post-revision-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 2px;
}

.post-revision-item:hover,
.post-revision-item.active {
  background: hsl(var(--muted));
}

.post-revision-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-revision-item-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-3);
}

.post-revision-item-title {
  font-weight: 500;
  color: var(--color-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-revision-item-meta {
  font-size: 11px;
  color: var(--color-text-3);
}

.post-revision-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-weight: 500;
}

.post-revision-badge--none {
  background: hsl(var(--muted));
  color: var(--color-text-3);
}

.post-revision-current {
  padding: 12px 14px;
  border-top: 1px solid var(--j13-border-light);
  background: hsl(var(--muted) / 0.4);
  flex-shrink: 0;
}

.post-revision-current-label {
  display: block;
  font-size: 11px;
  color: var(--color-text-3);
  margin-bottom: 4px;
}

.post-revision-current-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-revision-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.post-revision-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--j13-border-light);
  flex-shrink: 0;
}

.post-revision-main-editor {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-1);
  margin-right: 8px;
}

.post-revision-main-time {
  font-size: 12px;
  color: var(--color-text-3);
}

.post-revision-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 16px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Diff 视图 */
.revision-diff-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.revision-diff-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

.revision-diff-block {
  padding: 12px 14px;
  background: hsl(var(--muted) / 0.35);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.revision-diff-inline del {
  background: hsl(0 70% 95%);
  color: hsl(0 60% 35%);
  text-decoration: line-through;
  border-radius: 2px;
  padding: 0 2px;
}

.revision-diff-inline ins {
  background: hsl(140 60% 93%);
  color: hsl(140 50% 28%);
  text-decoration: none;
  border-radius: 2px;
  padding: 0 2px;
}

.revision-diff-unchanged {
  color: var(--color-text-3);
  font-size: 13px;
}

.revision-diff-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.revision-diff-stat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.revision-diff-stat--add {
  background: hsl(140 60% 93%);
  color: hsl(140 50% 28%);
}

.revision-diff-stat--del {
  background: hsl(0 70% 95%);
  color: hsl(0 60% 35%);
}

.revision-diff-pre {
  margin: 0;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--j13-border-light);
  border-radius: 8px;
  overflow: hidden;
}

.revision-diff-line {
  display: flex;
  padding: 1px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.revision-diff-line--add {
  background: hsl(140 60% 95%);
}

.revision-diff-line--del {
  background: hsl(0 70% 96%);
}

.revision-diff-line--same {
  background: hsl(var(--background));
}

.revision-diff-gutter {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  color: var(--color-text-3);
  user-select: none;
  font-size: 12px;
}

.revision-diff-line--add .revision-diff-gutter { color: hsl(140 50% 40%); }
.revision-diff-line--del .revision-diff-gutter { color: hsl(0 60% 45%); }

.revision-diff-text {
  flex: 1;
  padding-right: 12px;
}

.comment-rev-layout {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px;
  min-height: 280px;
  max-height: min(60vh, 480px);
}

.comment-rev-list {
  overflow-y: auto;
  border-right: 1px solid var(--j13-border-light);
  padding-right: 8px;
}

.comment-rev-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.comment-rev-item:hover,
.comment-rev-item.active {
  background: var(--j13-bg-block-accent);
}

.comment-rev-item__ver {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.comment-rev-item__meta {
  font-size: 11px;
  color: var(--color-text-3);
}

.comment-rev-detail {
  min-width: 0;
  overflow: auto;
}

.comment-rev-detail__hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-3);
}

@media (max-width: 640px) {
  .comment-rev-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .comment-rev-list {
    border-right: none;
    border-bottom: 1px solid var(--j13-border-light);
    padding-right: 0;
    padding-bottom: 8px;
    max-height: 140px;
  }
}

.revision-diff-line--add .revision-diff-text { color: hsl(140 45% 22%); }
.revision-diff-line--del .revision-diff-text {
  color: hsl(0 55% 30%);
  text-decoration: line-through;
}

/* 完整版本视图 */
.revision-full-view h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}

.revision-full-tags {
  font-size: 13px;
  color: var(--color-text-3);
  margin: 0 0 16px;
}

@media (max-width: 768px) {
  .post-revision-overlay:not(.post-revision-overlay--fullscreen) {
    padding: 0;
    align-items: stretch;
  }

  .post-revision-panel:not(.post-revision-panel--fullscreen) {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .post-revision-head {
    flex-wrap: wrap;
  }

  .post-revision-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .post-revision-view-tabs {
    flex: 1;
  }

  .post-revision-tab-label {
    display: none;
  }

  .post-revision-tab.active .post-revision-tab-label {
    display: inline;
  }

  .post-revision-body {
    flex-direction: column;
  }

  .post-revision-sidebar {
    width: 100%;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--j13-border-light);
  }

  .post-revision-current {
    display: none;
  }
}

.post-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.post-detail-tag-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.post-detail-tag-btn:hover {
  opacity: 0.85;
}

.post-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--j13-border-light);
  /* 防止正文绕排 float 把操作栏卷到图片旁 */
  clear: both;
  position: relative;
}

.post-detail-actions-primary,
.post-detail-actions-manage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.post-detail-actions-manage {
  width: 100%;
  padding-top: 12px;
  border-top: 1px dashed var(--j13-border-light);
}

.post-detail-more-btn {
  min-width: 36px;
  padding-inline: 10px;
}

/* 举报「更多」菜单：紧凑居中 */
.report-more-menu {
  min-width: 0 !important;
  width: max-content;
  padding: 4px;
}

.report-more-menu__item {
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  color: hsl(var(--destructive));
  font-size: 13px;
  cursor: pointer;
}

.report-more-menu__item:focus,
.report-more-menu__item:hover {
  color: hsl(var(--destructive));
  background: color-mix(in srgb, hsl(var(--destructive)) 10%, transparent);
}

.report-more-menu__item svg {
  width: 14px;
  height: 14px;
}

.post-detail-content {
  font-size: 15.5px;
  line-height: 1.8;
  word-break: break-word;
  color: var(--color-text-1);
  letter-spacing: 0.01em;
  /* 建立 BFC，把浮动图限制在正文容器内 */
  display: flow-root;
}

.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3,
.post-detail-content h4,
.post-detail-content h5,
.post-detail-content h6 {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--color-text-1);
  margin: 1.55em 0 0.65em;
}

/*
 * 标题下方绿色短横线：用文档流 block 而非 absolute+bottom，
 * 避免空标题 / 有内容时行盒高度不同导致「忽高忽矮」；
 * 高度一律整数 px，避免桌面非整数 DPR 下亚像素取整忽粗忽细。
 */
.post-detail-content h1::after,
.post-detail-content h2::after,
.post-detail-content h3::after,
.post-detail-content h4::after,
.post-detail-content h5::after,
.post-detail-content h6::after {
  content: '';
  display: block;
  box-sizing: border-box;
  margin-top: 0.38em;
  background: var(--j13-green);
  border-radius: 1px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-detail-content > :first-child,
.post-detail-content h1:first-child,
.post-detail-content h2:first-child,
.post-detail-content h3:first-child,
.post-detail-content h4:first-child,
.post-detail-content h5:first-child,
.post-detail-content h6:first-child {
  margin-top: 0;
}

.post-detail-content h1 {
  font-size: 1.7em;
}
.post-detail-content h1::after { width: 48px; height: 3px; }
.post-detail-content h1:hover::after { width: 72px; }

.post-detail-content h2 {
  font-size: 1.4em;
}
.post-detail-content h2::after { width: 40px; height: 2px; }
.post-detail-content h2:hover::after { width: 60px; }

.post-detail-content h3 { font-size: 1.22em; }
.post-detail-content h3::after { width: 32px; height: 2px; }
.post-detail-content h3:hover::after { width: 48px; }

.post-detail-content h4 { font-size: 1.1em; }
.post-detail-content h4::after { width: 26px; height: 2px; }
.post-detail-content h4:hover::after { width: 40px; }

.post-detail-content h5 { font-size: 1em; }
.post-detail-content h5::after { width: 20px; height: 1px; }
.post-detail-content h5:hover::after { width: 32px; }

.post-detail-content h6 {
  font-size: 0.92em;
  color: var(--color-text-2);
  font-weight: 600;
}
.post-detail-content h6::after { width: 16px; height: 1px; }
.post-detail-content h6:hover::after { width: 26px; }

.post-detail-content ul,
.post-detail-content ol {
  margin: 0 0 1em;
  padding-left: 1.55em;
}

.post-detail-content ul {
  list-style-type: disc;
}

.post-detail-content ol {
  list-style-type: decimal;
}

.post-detail-content li {
  display: list-item;
  margin-bottom: 0.35em;
  padding-left: 0.15em;
}

.post-detail-content li::marker {
  color: var(--color-text-3);
}

.post-detail-content li > ul,
.post-detail-content li > ol {
  margin-top: 0.35em;
  margin-bottom: 0;
}

.post-detail-content hr {
  margin: 1.75em 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--j13-border), transparent);
}

/* 会员专属内容区块 */
.post-detail-content members-only,
.post-detail-content .post-members-only {
  display: block;
  margin: 16px 0;
  border-radius: 0;
  overflow: visible;
}

/* 已登录：降噪，仅左边框暗示专属段落 */
.post-detail-content .post-members-only--visible {
  border: none;
  border-left: 3px solid rgba(24, 160, 88, 0.45);
  background: transparent;
  box-shadow: none;
  padding: 2px 0 2px 14px;
}

.post-detail-content .post-members-only__badge {
  display: none;
}

.post-detail-content .post-members-only__body {
  padding: 0;
}

.post-detail-content .post-members-only__body--empty {
  color: var(--color-text-4);
  font-style: italic;
}

/* 游客：流内嵌条，避免大卡片占屏 */
.post-detail-content .post-members-only--locked {
  position: relative;
  border: 1px solid rgba(24, 160, 88, 0.22);
  border-left: 3px solid rgba(24, 160, 88, 0.55);
  border-radius: 8px;
  background: var(--j13-bg-surface);
  overflow: hidden;
}

.post-detail-content .post-members-only__locked-wrap {
  position: relative;
  min-height: 0;
}

.post-detail-content .post-members-only__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  text-align: left;
}

.post-detail-content .post-members-only__gate-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(24, 160, 88, 0.1);
  color: var(--j13-green);
  border: none;
  margin: 0;
  box-shadow: none;
}

.post-detail-content .post-members-only__gate-text {
  flex: 1 1 160px;
  min-width: 0;
}

.post-detail-content .post-members-only__gate-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.post-detail-content .post-members-only__gate-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.4;
  max-width: none;
}

.post-detail-content .post-members-only__gate-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.post-detail-content .post-members-only__gate-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: var(--j13-green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.post-detail-content .post-members-only__gate-btn:hover {
  background: var(--j13-green-hover);
}

.post-detail-content .post-members-only__gate-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--j13-green);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-detail-content .post-members-only__gate-link:hover {
  color: var(--j13-green-hover);
}

.dark .post-detail-content .post-members-only--visible {
  border-left-color: rgba(35, 195, 107, 0.5);
  background: transparent;
  box-shadow: none;
}

.dark .post-detail-content .post-members-only--locked {
  border-color: rgba(35, 195, 107, 0.25);
  border-left-color: rgba(35, 195, 107, 0.55);
  background: var(--j13-bg-surface);
}

.dark .post-detail-content .post-members-only__gate {
  background: transparent;
}

.article-editor-tools-members {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.article-editor-tools-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--j13-border-light);
  flex-shrink: 0;
}

.article-editor-tools .article-tool-btn--members {
  color: var(--j13-green);
}

.article-editor-tools .article-tool-btn--members:hover,
.article-editor-tools .article-tool-btn--members.active {
  background: var(--j13-green-bg);
  color: var(--j13-green-hover);
}

.article-editor-tools .article-tool-btn--reply {
  color: #c27803;
}

.article-editor-tools .article-tool-btn--reply:hover,
.article-editor-tools .article-tool-btn--reply.active {
  background: rgba(194, 120, 3, 0.1);
  color: #a16207;
}

.dark .article-editor-tools .article-tool-btn--reply {
  color: #e8b84a;
}

.dark .article-editor-tools .article-tool-btn--reply:hover,
.dark .article-editor-tools .article-tool-btn--reply.active {
  background: rgba(232, 184, 74, 0.12);
  color: #f0c85a;
}

/* 回复可见内容区块（阅读态） */
.post-detail-content reply-only,
.post-detail-content .post-reply-only {
  display: block;
  margin: 16px 0;
  border-radius: 0;
  overflow: visible;
}

.post-detail-content .post-reply-only--visible {
  border: none;
  border-left: 3px solid rgba(194, 120, 3, 0.5);
  background: transparent;
  box-shadow: none;
  padding: 2px 0 2px 14px;
}

.post-detail-content .post-reply-only__badge {
  display: none;
}

.post-detail-content .post-reply-only__body {
  padding: 0;
}

.post-detail-content .post-reply-only--locked {
  position: relative;
  border: 1px solid rgba(194, 120, 3, 0.28);
  border-left: 3px solid rgba(194, 120, 3, 0.65);
  border-radius: 8px;
  background: var(--j13-bg-surface);
  overflow: hidden;
}

.post-detail-content .post-reply-only__locked-wrap {
  position: relative;
  min-height: 0;
}

.post-detail-content .post-reply-only__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  text-align: left;
}

.post-detail-content .post-reply-only__gate-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(194, 120, 3, 0.12);
  color: #c27803;
  border: none;
  margin: 0;
  box-shadow: none;
}

.post-detail-content .post-reply-only__gate-text {
  flex: 1 1 160px;
  min-width: 0;
}

.post-detail-content .post-reply-only__gate-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.post-detail-content .post-reply-only__gate-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.4;
}

.post-detail-content .post-reply-only__gate-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.post-detail-content .post-reply-only__gate-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #c27803;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.post-detail-content .post-reply-only__gate-btn:hover {
  background: #a16207;
}

.post-detail-content .post-reply-only__gate-link {
  padding: 0;
  border: none;
  background: none;
  color: #c27803;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-detail-content .post-reply-only__gate-link:hover {
  color: #a16207;
}

.dark .post-detail-content .post-reply-only--visible {
  border-left-color: rgba(232, 184, 74, 0.55);
}

.dark .post-detail-content .post-reply-only--locked {
  border-color: rgba(232, 184, 74, 0.3);
  border-left-color: rgba(232, 184, 74, 0.6);
}

.dark .post-detail-content .post-reply-only__gate-icon {
  background: rgba(232, 184, 74, 0.14);
  color: #e8b84a;
}

.dark .post-detail-content .post-reply-only__gate-btn {
  background: #c27803;
}

.dark .post-detail-content .post-reply-only__gate-link {
  color: #e8b84a;
}

.post-members-only__unwrap-btn {
  margin-left: 0;
  padding: 2px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.12s, color 0.12s;
}

.post-members-only__unwrap-btn:hover {
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
}

.post-members-only__badge-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-members-only__remove-btn {
  padding: 2px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.12s, color 0.12s;
}

.post-members-only__remove-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.editor-members-only--empty .post-members-only__remove-btn {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.post-detail-content strong,
.post-detail-content b {
  font-weight: 700;
  color: var(--color-text-1);
}

.post-detail-content em,
.post-detail-content i {
  font-style: italic;
}

.post-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.75em 0;
  box-shadow: var(--j13-shadow-soft);
  /* 非绕排图通栏显示，避免挤进左侧浮动图旁边 */
  display: block;
  clear: both;
}

.post-detail-content img.post-content-img--zoomable {
  cursor: zoom-in;
  transition: box-shadow 0.15s, transform 0.15s;
}

.post-detail-content img.post-content-img--zoomable:hover {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.14);
}

.post-detail-content img.post-content-img--zoomable:focus-visible {
  outline: 2px solid var(--j13-green);
  outline-offset: 3px;
}

/* 帖子图片灯箱 */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(8, 12, 20, 0.88);
  cursor: zoom-out;
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  user-select: none;
}

.image-lightbox-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

@media (max-width: 768px) {
  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox-hint {
    display: none;
  }
}

.post-detail-content p { margin: 0 0 1em; }
.post-detail-content p:last-child { margin-bottom: 0; }

/* 正文首段轻微强调（仅当首个子节点就是段落时） */
.post-detail-content > p:first-child {
  font-size: 1.06em;
  line-height: 1.75;
  letter-spacing: 0.015em;
  color: var(--color-text-1);
}

.post-detail-content a {
  color: var(--j13-green);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--j13-green) 35%, transparent);
}
.post-detail-content a:hover {
  text-decoration-color: var(--j13-green);
}
.post-detail-content blockquote {
  margin: 1.1em 0;
  padding: 0.75em 1em;
  border-left: 3px solid var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 6%, var(--j13-bg-block-muted));
  color: var(--color-text-2);
  border-radius: 0 10px 10px 0;
  transition:
    border-left-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.28s ease,
    padding-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-detail-content blockquote:hover {
  border-left-width: 5px;
  padding-left: calc(1em - 2px);
  background: color-mix(in srgb, var(--j13-green) 11%, var(--j13-bg-block-muted));
}
.post-detail-content blockquote p:last-child { margin-bottom: 0; }

/* 表格：简约网格，表头轻量区分；宽表外包层横向滚动 */
.post-detail-content .md-table-wrap {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.25em 0;
  overflow-x: auto;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-surface);
}

.post-detail-content table {
  width: auto;
  max-width: 100%;
  margin: 1.25em 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.55;
  display: table;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--j13-bg-surface);
  color: var(--color-text-1);
}

.post-detail-content .md-table-wrap table {
  margin: 0;
  max-width: none;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.post-detail-content th,
.post-detail-content td {
  padding: 9px 14px;
  border-right: 1px solid var(--j13-border);
  border-bottom: 1px solid var(--j13-border);
  text-align: left;
  vertical-align: top;
  min-width: 64px;
}

.post-detail-content th:last-child,
.post-detail-content td:last-child {
  border-right: none;
}

.post-detail-content tr:last-child th,
.post-detail-content tr:last-child td {
  border-bottom: none;
}

.post-detail-content th {
  background: color-mix(in srgb, var(--j13-bg-block-muted) 88%, var(--j13-bg-surface));
  color: var(--color-text-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.post-detail-content tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--j13-bg-block-muted) 35%, transparent);
}

.post-detail-content tbody tr:hover td {
  background: color-mix(in srgb, var(--j13-green) 6%, var(--j13-bg-surface));
}

.post-detail-content table p {
  margin: 0;
}

.post-detail-content pre,
.post-detail-content code,
.post-detail-content .md-codeblock {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, 'Liberation Mono', monospace;
}

.post-detail-content :not(pre) > code {
  padding: 0.15em 0.45em;
  font-size: 0.88em;
  background: color-mix(in srgb, var(--j13-green) 8%, var(--j13-bg-block-muted));
  color: color-mix(in srgb, var(--j13-green) 55%, var(--color-text-1));
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--j13-green) 12%, var(--j13-border-light));
}

/* 代码块外壳（默认跟亮色主题；暗色见下方 .dark） */
.post-detail-content .md-codeblock {
  margin: 1.15em 0;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  background: #f6f8fa;
  overflow: hidden;
  box-shadow: var(--j13-shadow-soft);
}
.post-detail-content .md-codeblock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #eef1f4;
  border-bottom: 1px solid #d8dee4;
}
.post-detail-content .md-codeblock__lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #656d76;
}
/* aardio 品牌名保持全小写，不做 uppercase */
.post-detail-content .md-codeblock[data-lang="aardio"] .md-codeblock__lang {
  text-transform: none;
  letter-spacing: 0.02em;
}
.post-detail-content .md-codeblock__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-detail-content .md-codeblock__editor-meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #656d76;
}
/* 编辑态代码块：只保留主题壳 / 头栏角标 / 可编辑正文，行号与折叠交给阅读态 */
.article-prosemirror .md-codeblock--editor {
  margin: 1em 0;
}
.article-prosemirror .md-codeblock--editor .md-codeblock__head {
  cursor: default;
  user-select: none;
}
.article-prosemirror .md-codeblock--editor .md-codeblock__pre {
  min-height: 1.65em;
  /* 编辑态永不按折叠裁切，即使误带 collapsed class */
  max-height: none !important;
  overflow: visible !important;
}
.article-prosemirror .md-codeblock--editor .md-codeblock__pre::after {
  display: none !important;
}
.article-prosemirror .md-codeblock--editor .md-codeblock__pre code,
.article-prosemirror .md-codeblock--editor.md-codeblock--lines .md-codeblock__pre code {
  display: block;
  outline: none;
  /* 覆盖阅读态行号布局的 white-space: normal，避免粘贴多行被挤成一行 */
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
}
.post-detail-content .md-codeblock__copy,
.post-detail-content .md-codeblock__fold {
  padding: 3px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  color: #57606a;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.post-detail-content .md-codeblock__copy:hover,
.post-detail-content .md-codeblock__fold:hover {
  background: #f3f4f6;
  color: #24292f;
}
.post-detail-content .md-codeblock__copy.is-copied {
  border-color: color-mix(in srgb, var(--j13-green) 50%, transparent);
  color: color-mix(in srgb, var(--j13-green) 55%, #24292f);
}
.post-detail-content .md-codeblock__pre,
.post-detail-content pre {
  margin: 0;
  padding: 14px 16px;
  background: transparent;
  border-radius: 0;
  overflow-x: auto;
  color: #24292f;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
  position: relative;
}
.post-detail-content .md-codeblock__pre code,
.post-detail-content pre code {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
  display: block;
}

/* 行号布局：外层改为 normal，正文行内保留 pre */
.post-detail-content .md-codeblock--lines .md-codeblock__pre code {
  white-space: normal;
}

/* 行号：列宽随 data-lineno-digits 自适应；nowrap 避免父级 white-space:normal 把多位数折行 */
.post-detail-content .md-codeblock--lines {
  --md-lineno-col: 1ch;
}
.post-detail-content .md-codeblock--lines[data-lineno-digits="2"] {
  --md-lineno-col: 2ch;
}
.post-detail-content .md-codeblock--lines[data-lineno-digits="3"] {
  --md-lineno-col: 3ch;
}
.post-detail-content .md-codeblock--lines[data-lineno-digits="4"] {
  --md-lineno-col: 4ch;
}
.post-detail-content .md-code-line {
  display: block;
  min-height: 1.65em;
}
.post-detail-content .md-codeblock--lines .md-code-line {
  display: grid;
  grid-template-columns: var(--md-lineno-col) minmax(0, 1fr);
  column-gap: 10px;
}
.post-detail-content .md-code-line__num {
  user-select: none;
  text-align: right;
  color: #8c959f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.post-detail-content .md-code-line__body {
  min-width: 0;
  overflow-wrap: normal;
  white-space: pre;
}

/* 默认折叠：约 5 行；刚好 5 行时再压到约 2 行，保证能看出效果 */
.post-detail-content .md-codeblock--collapsed .md-codeblock__pre {
  max-height: calc(5 * 1.65em + 28px);
  overflow: hidden;
}
.post-detail-content .md-codeblock--collapsed.md-codeblock--short .md-codeblock__pre {
  max-height: calc(2 * 1.65em + 20px);
}
.post-detail-content .md-codeblock--collapsed .md-codeblock__pre::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, #f6f8fa 85%);
}

/* 未包壳的遗留 pre（兜底） */
.post-detail-content > pre {
  margin: 1.15em 0;
  padding: 14px 16px;
  background: #f6f8fa;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  color: #24292f;
  overflow-x: auto;
}

/* highlight.js token（亮色） */
.post-detail-content .hljs-comment,
.post-detail-content .hljs-quote { color: #6e7781; font-style: italic; }
.post-detail-content .hljs-keyword,
.post-detail-content .hljs-selector-tag,
.post-detail-content .hljs-addition { color: #cf222e; }
.post-detail-content .hljs-string,
.post-detail-content .hljs-meta .hljs-string,
.post-detail-content .hljs-attribute { color: #0a3069; }
.post-detail-content .hljs-number,
.post-detail-content .hljs-literal,
.post-detail-content .hljs-variable,
.post-detail-content .hljs-template-variable { color: #0550ae; }
.post-detail-content .hljs-title,
.post-detail-content .hljs-section,
.post-detail-content .hljs-name { color: #8250df; }
.post-detail-content .hljs-type,
.post-detail-content .hljs-class .hljs-title { color: #953800; }
.post-detail-content .hljs-built_in,
.post-detail-content .hljs-params { color: #953800; }
.post-detail-content .hljs-attr,
.post-detail-content .hljs-symbol,
.post-detail-content .hljs-bullet { color: #116329; }
.post-detail-content .hljs-meta,
.post-detail-content .hljs-deletion { color: #82071e; }
.post-detail-content .hljs-regexp,
.post-detail-content .hljs-link { color: #0a3069; }
.post-detail-content .hljs-operator { color: #cf222e; }
.post-detail-content .hljs-emphasis { font-style: italic; }
.post-detail-content .hljs-strong { font-weight: 700; }

/* 暗色主题：代码块跟随站点主题自动切换 */
.dark .post-detail-content .md-codeblock {
  background: #0f1419;
  border-color: #2a2f36;
}
.dark .post-detail-content .md-codeblock__head {
  background: #161b22;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.dark .post-detail-content .md-codeblock__lang {
  color: rgba(255, 255, 255, 0.45);
}
.dark .post-detail-content .md-codeblock__editor-meta {
  color: rgba(255, 255, 255, 0.4);
}
.dark .post-detail-content .md-codeblock__copy,
.dark .post-detail-content .md-codeblock__fold {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
}
.dark .post-detail-content .md-codeblock__copy:hover,
.dark .post-detail-content .md-codeblock__fold:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.dark .post-detail-content .md-codeblock__copy.is-copied {
  border-color: color-mix(in srgb, var(--j13-green) 50%, transparent);
  color: #7ee2a8;
}
.dark .post-detail-content .md-codeblock__pre,
.dark .post-detail-content pre {
  color: #e6edf3;
}
.dark .post-detail-content .md-code-line__num {
  color: rgba(255, 255, 255, 0.28);
}
.dark .post-detail-content .md-codeblock--collapsed .md-codeblock__pre::after {
  background: linear-gradient(to bottom, transparent, #0f1419 85%);
}
.dark .post-detail-content > pre {
  background: #0f1419;
  border-color: #2a2f36;
  color: #e6edf3;
}
.dark .post-detail-content .hljs-comment,
.dark .post-detail-content .hljs-quote { color: #8b949e; }
.dark .post-detail-content .hljs-keyword,
.dark .post-detail-content .hljs-selector-tag,
.dark .post-detail-content .hljs-addition { color: #ff7b72; }
.dark .post-detail-content .hljs-string,
.dark .post-detail-content .hljs-meta .hljs-string,
.dark .post-detail-content .hljs-attribute { color: #a5d6ff; }
.dark .post-detail-content .hljs-number,
.dark .post-detail-content .hljs-literal,
.dark .post-detail-content .hljs-variable,
.dark .post-detail-content .hljs-template-variable { color: #79c0ff; }
.dark .post-detail-content .hljs-title,
.dark .post-detail-content .hljs-section,
.dark .post-detail-content .hljs-name { color: #d2a8ff; }
.dark .post-detail-content .hljs-type,
.dark .post-detail-content .hljs-class .hljs-title { color: #ffa657; }
.dark .post-detail-content .hljs-built_in,
.dark .post-detail-content .hljs-params { color: #ffa657; }
.dark .post-detail-content .hljs-attr,
.dark .post-detail-content .hljs-symbol,
.dark .post-detail-content .hljs-bullet { color: #7ee787; }
.dark .post-detail-content .hljs-meta,
.dark .post-detail-content .hljs-deletion { color: #ffa198; }
.dark .post-detail-content .hljs-regexp,
.dark .post-detail-content .hljs-link { color: #a5d6ff; }
.dark .post-detail-content .hljs-operator { color: #ff7b72; }

/* 评论区 — 独立卡片板块 */
.comment-section {
  display: flex;
  flex-direction: column;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
  flex-shrink: 0;
  overflow: hidden;
}

.comment-section-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 12px;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  border-bottom: 1px solid var(--j13-border-light);
}

/* 标题下方装饰横条，hover 时绿色高亮段向右延伸 */
.comment-section-bar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20px;
  width: 36px;
  height: 2px;
  background: var(--j13-green);
  border-radius: 1px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-section:hover .comment-section-bar::after {
  width: 52px;
}

.comment-section-title { color: var(--color-text-1); }

.comment-section-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-3);
}

.floor-jump-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-list-area {
  display: flex;
  flex-direction: column;
}

.comment-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-3);
}

.comment-empty p { margin: 0; font-size: 13px; }

/* 回复栏（旧版保留兼容） */
.reply-bar {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
  flex-shrink: 0;
}

/* 游客评论登录引导 */
.comment-login-gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 16px;
  border: 1px dashed var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
}

.comment-login-gate--inline {
  margin-top: 4px;
}

.comment-login-gate__text {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-2);
}

.comment-login-gate__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.comment-login-gate__register {
  font-size: 13px;
  color: var(--j13-green);
  text-decoration: none;
}

.comment-login-gate__register:hover {
  text-decoration: underline;
}

/* Waline 风格评论输入框 */
.comment-box-wrap {
  padding: 16px 20px;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  flex-shrink: 0;
}

.comment-box-wrap.inline {
  padding: 12px 0 4px;
  border-bottom: none;
  background: transparent;
}

.comment-box-wrap.inline .comment-box-avatar,
.comment-box-wrap.inline .comment-box-avatar-img,
.comment-box-wrap.inline .comment-box-avatar-placeholder {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.waline-comment-reply-btn.cancel {
  color: #e74c3c;
}

.waline-comment-reply-btn.cancel:hover {
  color: #c0392b;
}

.comment-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-box-avatar { flex-shrink: 0; }

.comment-box-avatar-img,
.comment-box-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-box-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--j13-green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.comment-box-avatar-placeholder.guest {
  background: var(--color-fill-3);
  color: var(--color-text-3);
}

.comment-box-main {
  flex: 1;
  min-width: 0;
}

.comment-box-reply-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--j13-green);
  margin-bottom: 8px;
}

.comment-box-reply-cancel {
  border: none;
  background: none;
  color: var(--color-text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.comment-box-reply-cancel:hover { color: var(--color-text-1); }

.comment-box-input-wrap {
  position: relative;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block);
  transition: border-color 0.2s, background 0.2s;
}

.comment-mention-popup {
  position: absolute;
  left: 8px;
  right: 48px;
  bottom: calc(100% + 4px);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.45rem;
  background: var(--j13-card, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.comment-mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.comment-mention-item:hover,
.comment-mention-item.active {
  background: color-mix(in srgb, var(--j13-green, #18a058) 10%, transparent);
}

.comment-mention-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--j13-bg-block-muted, #f1f5f9);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.comment-mention-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-mention-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.comment-mention-nick {
  font-size: 0.85rem;
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-mention-user {
  font-size: 0.72rem;
  color: var(--color-text-4, #94a3b8);
}

.comment-mention-empty {
  padding: 0.65rem;
  font-size: 0.8rem;
  color: var(--color-text-3, #64748b);
}

.comment-box-input-wrap:focus-within {
  border-color: rgb(var(--primary-6));
}

.comment-box-input-wrap.private-mode {
  background: var(--j13-bg-block-muted);
  border-color: var(--j13-border);
}

.comment-box-textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 200px;
  padding: 10px 48px 10px 12px;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  color: var(--color-text-1);
  background: transparent;
  box-sizing: border-box;
}

.comment-box-textarea::placeholder { color: var(--color-text-4); }

.comment-box-send {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #27c;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s, opacity 0.15s;
}

.comment-box-send:hover:not(:disabled) { background: #1a9bd8; }
.comment-box-send:disabled { opacity: 0.45; cursor: not-allowed; }

.comment-box-guest-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 10px;
  margin-bottom: 8px;
}

.comment-box-guest-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.comment-box-guest-field--error .comment-box-guest-input {
  border-color: rgb(var(--danger-6));
  box-shadow: 0 0 0 3px color-mix(in srgb, rgb(var(--danger-6)) 14%, transparent);
}

.comment-box-guest-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-3);
}

.comment-box-guest-required,
.comment-box-guest-optional {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.comment-box-guest-required {
  color: rgb(var(--danger-6));
  background: color-mix(in srgb, rgb(var(--danger-6)) 12%, transparent);
}

.comment-box-guest-optional {
  color: var(--color-text-4);
  background: var(--color-fill-2);
}

.comment-box-guest-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--color-text-4);
  line-height: 1.5;
}

.comment-box-guest-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--j13-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-1);
  background: var(--color-bg-1);
  outline: none;
  transition: border-color 0.2s;
}

.comment-box-guest-input:focus { border-color: rgb(var(--primary-6)); }
.comment-box-guest-input::placeholder { color: var(--color-text-4); }

.comment-box-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.comment-box-owo {
  border: none;
  background: none;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.comment-box-owo:hover,
.comment-box-owo.active {
  background: rgba(39, 204, 255, 0.12);
  color: #27c;
}

.comment-box-private {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-3);
  cursor: pointer;
  user-select: none;
}

.comment-box-private-hint {
  margin-left: -8px;
  font-size: 11px;
  color: var(--color-text-4);
}

/* 表情面板 */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  background: var(--color-bg-1);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.emoji-picker-item {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}

.emoji-picker-item:hover,
.emoji-picker-item:focus-visible,
.emoji-picker-item--active {
  background: var(--color-fill-2);
  outline: none;
}

.emoji-picker-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--j13-green);
}

/* Waline 嵌套评论列表 — 与正文共用 .page-wrap 滚动 */

.waline-comment {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--j13-border-light);
}

/* 回复：头像与昵称同行，正文从头像下方起铺满，避免逐级挤窄 */
.waline-comment.nested {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 6px 10px;
  align-items: start;
  padding: 12px 0 0;
  border-bottom: none;
}

.waline-comment.highlight {
  animation: floor-highlight 2s ease-out;
}

@keyframes floor-highlight {
  0%, 30% { background: var(--j13-green-bg); }
  100% { background: transparent; }
}

.waline-replies {
  margin-top: 8px;
}

.waline-comment.nested .waline-comment-avatar {
  grid-column: 1;
  grid-row: 1;
  width: 32px;
  height: 32px;
  font-size: 13px;
}

/* 让子元素直接参与 grid，正文/回复可跨列铺满 */
.waline-comment.nested .waline-comment-main {
  display: contents;
}

.waline-comment.nested .waline-comment-head {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 0;
  align-self: center;
  min-width: 0;
}

.waline-comment.nested .waline-comment-bubble,
.waline-comment.nested .waline-comment-private-mask,
.waline-comment.nested .waline-comment-edit,
.waline-comment.nested .waline-comment-meta,
.waline-comment.nested .comment-box-wrap.inline,
.waline-comment.nested .waline-replies {
  grid-column: 1 / -1;
}

/* 更深层级与第一层回复左对齐，不再继续右移 */
.waline-comment.nested .waline-replies {
  margin-top: 4px;
}

.waline-comment-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--j13-green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waline-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.waline-comment-avatar.guest {
  background: var(--color-fill-3);
  color: var(--color-text-3);
}

.waline-comment-main { flex: 1; min-width: 0; }

.waline-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.waline-comment-author {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-1);
  text-decoration: none;
  min-width: 0;
}

a.waline-comment-author:hover {
  color: var(--j13-green);
  text-decoration: none;
}

.waline-comment-like {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-3);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.waline-comment-like:hover {
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.waline-comment-like.is-liked {
  color: var(--j13-green);
}

.waline-comment-like:disabled {
  opacity: 0.6;
  cursor: wait;
}

.waline-comment-floor {
  display: none;
}

.waline-comment-bubble {
  padding: 10px 14px;
  background: var(--j13-bg-block-muted);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-1);
  word-break: break-word;
}

.waline-reply-at {
  color: inherit;
  font-weight: 400;
  line-height: 1.5;
}

.waline-comment-private-mask {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    #f6f6f6,
    #f6f6f6 8px,
    #ececec 8px,
    #ececec 16px
  );
}

.waline-comment-bubble .floor-body {
  font-size: inherit;
  line-height: inherit;
  word-break: break-word;
}

.floor-body {
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.waline-comment-bubble .quote-block {
  margin: 6px 0;
  background: var(--j13-bg-block);
}

.waline-comment-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-3);
}

.waline-comment-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.waline-comment-reply-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--color-text-3);
  cursor: pointer;
  transition: color 0.15s;
}

.waline-comment-reply-btn:hover { color: var(--j13-green); }

.waline-comment-approve-btn {
  color: var(--j13-green);
  font-weight: 600;
}

.waline-comment-approve-btn:hover {
  color: var(--j13-green-hover);
}

.waline-comment-edited {
  color: var(--color-text-4);
}

.waline-comment-edit {
  margin-top: 4px;
}

.waline-comment-edit-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-surface);
  color: var(--color-text-1);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.waline-comment-edit-input:focus {
  outline: none;
  border-color: var(--j13-green);
}

.waline-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .comment-box-wrap { padding: 12px 14px; }
  .comment-box-guest-fields { grid-template-columns: 1fr; }
  .comment-box-private-hint { display: none; }
  .comment-box-toolbar { flex-wrap: wrap; gap: 10px 16px; }
  .emoji-picker { grid-template-columns: repeat(8, 1fr); }
  .waline-comment { padding: 12px 14px; }
}

.mention {
  color: var(--j13-green);
  font-weight: 500;
  cursor: pointer;
}
.mention:hover {
  text-decoration: underline;
}

.quote-block {
  border-left: 3px solid var(--j13-green);
  padding: 8px 12px;
  margin: 6px 0 8px;
  background: var(--j13-bg-block-muted);
  font-size: 13px;
  color: var(--color-text-3);
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-block.clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.quote-block.clickable:hover {
  background: var(--j13-green-bg);
  border-left-color: var(--j13-green-hover);
}

@media (max-width: 768px) {
  .post-detail-page { padding: 12px 14px 20px; gap: 12px; }
  .post-detail-header { padding: 12px 14px 16px; }
  .post-detail-title { font-size: 17px; }
  .post-detail-actions { margin-top: 20px; padding-top: 16px; gap: 10px; }
  .post-detail-actions-primary,
  .post-detail-actions-manage { gap: 8px; }
  .comment-section-bar { padding: 12px 14px 10px; }
  .comment-section-bar::after { left: 14px; width: 32px; }
  .comment-section:hover .comment-section-bar::after { width: 46px; }
}

.widget-card {
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  box-shadow: var(--j13-shadow-soft);
  margin-bottom: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.widget-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 8px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
}

.widget-card-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.widget-card-icon--hot { color: #e74c3c; }
.widget-card-icon--notice { color: #3498db; }

.widget-card-body { padding: 6px 14px 12px; }

.widget-card--about {
  display: flex;
  flex-direction: column;
  border-bottom: none;
  min-height: 72px;
}

.widget-card--about .widget-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
}

.widget-about-text {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.65;
}

.widget-about-title {
  margin: 0 0 4px;
  color: var(--j13-green);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.widget-about-desc {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-3);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-about-slogan {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--color-text-4);
}

.widget-card-icon--welcome { color: var(--j13-green); }

.widget-welcome-body {
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.65;
}

.widget-welcome-body p {
  margin: 0 0 8px;
}

.widget-welcome-body ul {
  margin: 0;
  padding-left: 1.1em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-item {
  width: 100%;
  padding: 7px 0;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid var(--j13-border-light);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}

.widget-item:last-child { border-bottom: none; }

.widget-item:hover,
.widget-item:focus-visible {
  color: var(--j13-green);
  background: var(--j13-bg-block-accent);
  padding-left: 6px;
  padding-right: 6px;
  margin-left: -6px;
  margin-right: -6px;
}

.widget-item:focus-visible {
  outline: 2px solid var(--j13-green);
  outline-offset: 1px;
}

.widget-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-item-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--j13-green);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.widget-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.widget-item-time {
  font-size: 11px;
  color: var(--color-text-4);
  flex-shrink: 0;
}

.widget-rank {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-3);
  background: var(--j13-bg-block-muted);
  flex-shrink: 0;
}

.widget-rank--1 {
  color: #fff;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.widget-rank--2 {
  color: #fff;
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.widget-rank--3 {
  color: #fff;
  background: linear-gradient(135deg, #f1c40f, #e67e22);
}

.widget-empty {
  font-size: 13px;
  color: var(--color-text-3);
  padding: 8px 0;
}

.widget-empty--inline {
  padding: 0;
}

.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

.profile-header-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar info"
    "stats stats";
  align-items: start;
  gap: 16px 20px;
  padding: 20px;
  margin-bottom: 12px;
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-header-card > .profile-avatar-btn { grid-area: avatar; }
.profile-header-card > .profile-header-info { grid-area: info; }
.profile-header-card > .profile-stat-grid { grid-area: stats; }

/* 避免隐藏的 file input 占用 grid 单元格 */
.profile-header-card > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-header-card--dragover {
  border-color: color-mix(in srgb, var(--j13-green) 50%, var(--j13-border-light));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--j13-green) 15%, transparent);
}

.profile-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--j13-green) 12%, var(--j13-bg-block));
  color: var(--j13-green);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

.profile-avatar-btn {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}

.profile-avatar-btn:disabled {
  cursor: not-allowed;
}

.profile-avatar-lg {
  position: relative;
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--j13-green); color: #fff;
  font-size: 32px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.profile-avatar-lg--pending {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--j13-green) 40%, transparent);
}

.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-avatar-btn:hover .profile-avatar-overlay,
.profile-avatar-btn:focus-visible .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-btn:disabled .profile-avatar-overlay {
  opacity: 1;
}

.profile-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-header-main {
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-display-name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.profile-username {
  font-size: 13px;
  color: var(--color-text-3);
}

.profile-id-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--j13-green) 10%, var(--j13-bg-surface));
  color: var(--j13-green);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profile-id-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--j13-border-light);
  border-radius: 6px;
  background: var(--j13-bg-surface);
  color: var(--color-text-3);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.profile-id-copy:hover {
  border-color: var(--j13-green);
  color: var(--j13-green);
}

.profile-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  margin: 14px 0 0;
}

.profile-meta-list dt {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-4);
  letter-spacing: 0.02em;
}

.profile-meta-list dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-text-2);
  word-break: break-all;
}

.profile-avatar-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.4;
}

.profile-signature {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-signature--empty {
  color: var(--color-text-4);
  font-style: italic;
}

button.profile-signature--editable {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px;
  margin-left: -8px;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button.profile-signature--editable:hover,
button.profile-signature--editable:focus-visible {
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 35%, transparent);
  color: var(--j13-green);
  outline: none;
}

button.profile-signature--editable.profile-signature--empty {
  align-items: center;
  color: var(--color-text-3);
  font-style: normal;
}

button.profile-signature--editable.profile-signature--empty:hover,
button.profile-signature--editable.profile-signature--empty:focus-visible {
  color: var(--j13-green);
}

.profile-signature-text {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-signature-edit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-4);
  opacity: 0.85;
}

button.profile-signature--editable:hover .profile-signature-edit,
button.profile-signature--editable:focus-visible .profile-signature-edit {
  color: var(--j13-green);
  opacity: 1;
}

.profile-settings-lead {
  margin: -4px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-3);
}

.section-card-title--sub {
  margin-top: 0;
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.profile-readonly-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form--readonly {
  gap: 14px;
}

.profile-form-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--j13-border-light);
}

.profile-posts-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}

.profile-header-card--public .profile-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

/* 全站用户链接 */
.user-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.12s;
}

.user-link:hover,
.user-link:focus-visible {
  color: var(--j13-green);
  text-decoration: none;
}

.user-link--static {
  cursor: default;
}

.user-link--avatar-only {
  flex-shrink: 0;
}

a.user-link--avatar-only:hover,
a.user-link--avatar-only:focus-visible {
  color: #fff;
  outline: none;
}

.post-meta-user {
  font-weight: 500;
}

.post-detail-author-name.user-link {
  font-size: inherit;
  font-weight: 400;
}

.waline-comment-author.user-link {
  font-weight: 400;
}

.widget-item--active {
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

/* 正在聊：保留悬停底色与内边距，取消左右位移与变色 */
.widget-item.widget-item--active:hover,
.widget-item.widget-item--active:focus-visible {
  color: inherit;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  margin-left: 0;
  margin-right: 0;
  background: var(--j13-bg-block-accent);
}

/* 标题单行省略，避免多行撑高区块 */
.widget-item--active .widget-item-title {
  flex: none;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.widget-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--color-text-4, #94a3b8);
}

.widget-item-count {
  flex-shrink: 0;
}

.widget-item--comment {
  cursor: default;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  border-radius: 6px;
  box-sizing: border-box;
}

/* 最新评论：保留悬停底色与内边距，取消左右位移 */
.widget-item.widget-item--comment:hover,
.widget-item.widget-item--comment:focus-visible,
.widget-item.widget-item--comment:focus-within {
  color: inherit;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  margin-left: 0;
  margin-right: 0;
  background: var(--j13-bg-block-accent);
}

.widget-item--comment .widget-item-title {
  color: var(--color-text-2);
  transition: color 0.12s;
}

.widget-item-comment-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.widget-item-comment-main:hover .widget-item-title,
.widget-item-comment-main:focus-visible .widget-item-title {
  color: var(--j13-green);
}

.widget-item-comment-main:focus-visible {
  outline: none;
}

a.widget-item-avatar.user-link {
  text-decoration: none;
}

.post-revision-editor-link {
  font-weight: 500;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--j13-border-light);
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--j13-bg-surface);
  color: var(--color-text-3);
  font: inherit;
  cursor: default;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

button.profile-stat {
  cursor: pointer;
}

button.profile-stat:hover {
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border-light));
  color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 6%, var(--j13-bg-surface));
}

.profile-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-1);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

button.profile-stat:hover strong {
  color: var(--j13-green);
}

.profile-stat span {
  font-size: 12px;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.profile-tab-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.profile-tab:hover {
  color: var(--color-text-1);
  background: var(--j13-bg-surface);
}

.profile-tab.active {
  color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 10%, var(--j13-bg-surface));
  box-shadow: var(--j13-shadow-soft);
}

.profile-tab-count {
  min-width: 1.4em;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--j13-green) 14%, transparent);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profile-panel {
  margin-bottom: 24px;
}

.profile-panel--points .points-wallet {
  margin-top: 0;
}

.profile-avatar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.profile-avatar-hint {
  font-size: 13px;
  color: var(--color-text-3);
  white-space: nowrap;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.profile-form-footer--end {
  justify-content: flex-end;
}

.profile-form-hint {
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .profile-header-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "info"
      "stats";
    justify-items: center;
    text-align: center;
    padding: 20px 16px;
  }

  .profile-header-info {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .profile-name-row {
    justify-content: center;
  }

  .profile-id-row {
    justify-content: center;
  }

  button.profile-signature--editable {
    margin-left: 0;
    justify-content: center;
    text-align: center;
  }

  .profile-meta-list {
    width: 100%;
    text-align: left;
  }

  .profile-stat-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-tab {
    padding: 9px 8px;
    font-size: 12px;
  }

  .admin-entry-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-entry-bar-actions {
    width: 100%;
  }

  .admin-entry-bar-actions > * {
    flex: 1;
  }

  .profile-form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-form-hint {
    text-align: center;
  }
}

/* 头像裁剪弹窗 */
.avatar-crop-dialog {
  max-width: 420px;
  padding: 20px;
}

.avatar-crop-stage {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.avatar-crop-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.avatar-crop-zoom-label {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-text-3);
  width: 32px;
}

.avatar-crop-zoom input[type='range'] {
  flex: 1;
  height: 4px;
  accent-color: var(--j13-green);
  cursor: pointer;
}

.admin-entry-card {
  border-color: color-mix(in srgb, var(--j13-green) 25%, var(--j13-border));
  background: var(--j13-bg-block-accent);
}

/* 个人中心：站长入口紧凑条（避免挡在资料 Tab 前） */
.admin-entry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--j13-green) 22%, var(--j13-border-light));
  border-radius: 10px;
  background: var(--j13-bg-block-accent);
}

.admin-entry-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--j13-green);
}

.admin-entry-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 通用懒加载占位：非 Feed 页勿用首页鱼骨骨架 */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  min-height: 200px;
  padding: 48px 24px;
  box-sizing: border-box;
}

.page-loader--viewport {
  min-height: 100dvh;
  height: 100%;
  background: var(--j13-bg-page);
}

.auth-page {
  position: relative;
  height: 100%;
  min-height: 100dvh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(24, 160, 88, 0.14), transparent 65%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(24, 160, 88, 0.06), transparent 55%),
    var(--j13-bg-page);
}

.dark .auth-page {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(35, 195, 107, 0.12), transparent 65%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(35, 195, 107, 0.05), transparent 55%),
    var(--j13-bg-page);
}

.auth-brand-link {
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.auth-brand-link .logo-mark {
  margin-bottom: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-brand-link:hover .logo-mark {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 160, 88, 0.22);
}

/* 卡片内底部入口，与「注册/登录」同视线区 */
.auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-2);
  text-decoration: none;
  background: var(--j13-bg-block-muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.auth-back:hover {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border));
}

.auth-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
  padding: 32px;
}

.auth-box--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.auth-password-field {
  position: relative;
}

.auth-password-field__input {
  padding-right: 40px;
}

.auth-password-field__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-password-field__toggle:hover {
  color: var(--color-text-2);
  background: var(--j13-bg-block-muted);
}

.auth-box .logo-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--j13-green); color: #fff;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  object-fit: cover;
}

.auth-box h1 { text-align: center; font-size: 20px; margin: 0 0 4px; }
.auth-box .subtitle { text-align: center; font-size: 13px; color: var(--color-text-3); margin-bottom: 24px; }

.auth-captcha-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-captcha-row input {
  flex: 1;
  min-width: 0;
}

.auth-captcha-img {
  flex-shrink: 0;
  width: 120px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-page);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-text-3);
}

.auth-captcha-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-captcha-img:hover {
  border-color: var(--j13-green);
}

.auth-code-btn {
  flex-shrink: 0;
  min-width: 108px;
  height: 40px;
}

.auth-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.5;
}

.auth-email-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
}

/* 发帖页 — 与帖子详情同套工作区语言 */
.app-body--compose {
  background: var(--j13-bg-workspace);
}

.content-workspace--compose {
  background: var(--j13-bg-workspace);
}

.main-content--compose {
  /* 编辑页占满主栏高度；滚动交给编辑区内层，底栏可始终贴底 */
  overflow: hidden;
  background: var(--j13-bg-workspace);
}

.compose-page {
  /* 与 .compose-header 实际高度对齐（全屏等场景仍可能用到） */
  --compose-header-sticky-h: 57px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--j13-bg-workspace);
}

.compose-page--empty {
  align-items: center;
  justify-content: center;
}

.compose-empty-card {
  text-align: center;
  padding: 48px 40px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border);
  border-radius: 16px;
  box-shadow: var(--j13-shadow-card);
  max-width: 400px;
}

.compose-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 14px;
  background: var(--j13-green-bg);
  color: var(--j13-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-empty-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.compose-empty-card p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--color-text-3);
  line-height: 1.5;
}

.compose-primary-btn,
.compose-ghost-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.compose-primary-btn {
  background: var(--j13-green);
  color: #fff;
}

.compose-primary-btn:hover { background: var(--j13-green-hover); }
.compose-ghost-btn {
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
}

.compose-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* 富文本：接近正文阅读宽度，避免宽行/表格撑出右侧；源码双栏另加宽 */
  max-width: calc(var(--j13-article-read-w) + 64px);
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 16px;
  box-sizing: border-box;
  overflow: hidden;
  transition: max-width 0.2s ease;
}

.compose-page:has(.article-editor--markdown) .compose-canvas {
  max-width: min(1560px, 100%);
}

.compose-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
  overflow: hidden;
}

/* 正文区：限宽 + 纵向填满，横向溢出由内层编辑区承接 */
.compose-shell-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.compose-header {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  flex-shrink: 0;
  background: var(--j13-bg-surface);
  border-bottom: 1px solid var(--j13-border-light);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.compose-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.compose-header-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
  line-height: 1.3;
  white-space: nowrap;
}

.compose-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-surface);
  color: var(--color-text-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.compose-back:hover {
  border-color: var(--j13-green);
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.compose-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--j13-green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.compose-publish-btn:hover:not(:disabled) {
  background: var(--j13-green-hover);
}

.compose-publish-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.compose-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.compose-draft-hint {
  font-size: 12px;
  color: var(--color-text-3);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-edit-window {
  color: var(--color-text-3);
  font-weight: 400;
}

.compose-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  flex-shrink: 0;
}

.compose-context-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.compose-context-label {
  flex-shrink: 0;
  width: 32px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-3);
}

.compose-context-row--tags .compose-context-label {
  margin-top: 9px;
}

.compose-context-row--tags .compose-tags-field {
  flex: 1;
  min-width: 0;
}

.compose-board-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.compose-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.compose-type-hint {
  font-size: 12px;
  color: var(--color-text-3);
  align-self: center;
}

.compose-board-pill,
.compose-type-pill {
  padding: 5px 12px;
  border: 1px solid var(--j13-border);
  border-radius: 999px;
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.compose-board-pill:hover,
.compose-type-pill:hover {
  border-color: var(--j13-green);
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.compose-board-pill.active,
.compose-type-pill.active {
  background: var(--j13-green);
  border-color: var(--j13-green);
  color: #fff;
  font-weight: 500;
}

.compose-tags-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
  min-width: 0;
  max-width: 100%;
  cursor: text;
  transition: border-color 0.15s, background 0.15s;
}

.compose-tags-field:focus-within {
  border-color: var(--j13-green);
  background: var(--j13-bg-surface);
}

.compose-tags-field--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.compose-tags-icon {
  color: var(--color-text-4);
  flex-shrink: 0;
  margin-top: 5px;
}

.compose-tags-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.compose-tag-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--j13-green-bg);
  color: var(--j13-green);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.compose-tag-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.compose-tag-chip-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--j13-bg-surface);
  border-radius: 50%;
  background: var(--color-text-2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.compose-tag-chip:hover .compose-tag-chip-remove,
.compose-tag-chip:focus-within .compose-tag-chip-remove {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.compose-tag-chip-remove:hover {
  background: #e53935;
}

.compose-tag-chip-remove:focus-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  outline: 2px solid var(--j13-green);
  outline-offset: 1px;
}

/* 触控设备无悬停：始终显示删除按钮 */
@media (hover: none) {
  .compose-tag-chip-remove {
    opacity: 0.85;
    transform: scale(1);
    pointer-events: auto;
  }
}

.compose-tags-input {
  flex: 1;
  min-width: 96px;
  height: 26px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-1);
  padding: 0 2px;
}

.compose-tags-input::placeholder {
  color: var(--color-text-4);
}

.compose-document {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
}

.compose-title {
  width: 100%;
  margin: 0;
  padding: 20px 24px 12px;
  border: none;
  background: transparent;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--color-text-1);
  outline: none;
  flex-shrink: 0;
}

.compose-title::placeholder {
  color: var(--color-text-4);
  font-weight: 500;
}

.compose-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-3);
}

.compose-subtitle strong {
  color: var(--j13-green);
  font-weight: 500;
}

/* 文章编辑器 */
.article-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  border-top: 1px solid var(--j13-border-light);
  overflow: hidden;
}

.article-editor-bar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 8px 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: var(--j13-bg-surface);
  border-bottom: 1px solid var(--j13-border-light);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

/* 即时气泡提示（替代原生 title） */
.ui-tooltip {
  position: relative;
  display: inline-flex;
}

.ui-tooltip-bubble {
  position: absolute;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  width: max-content;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  box-shadow: var(--j13-shadow-card);
  transition: opacity 0.1s ease, transform 0.1s ease, visibility 0.1s;
}

.ui-tooltip-bubble--compact {
  padding: 5px 10px;
}

.ui-tooltip-bubble--rich {
  min-width: 148px;
  max-width: 220px;
  padding: 7px 12px;
}

.ui-tooltip-bubble__title {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-1);
}

.ui-tooltip-bubble--compact .ui-tooltip-bubble__title {
  white-space: nowrap;
}

.ui-tooltip-bubble__hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--color-text-3);
}

.ui-tooltip-bubble--bottom {
  top: calc(100% + 8px);
}

.ui-tooltip-bubble--top {
  bottom: calc(100% + 8px);
}

.ui-tooltip-bubble--center.ui-tooltip-bubble--bottom {
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
}

.ui-tooltip-bubble--center.ui-tooltip-bubble--top {
  left: 50%;
  transform: translateX(-50%) translateY(2px);
}

.ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,
.ui-tooltip-bubble--start.ui-tooltip-bubble--top {
  left: 0;
  transform: translateY(-2px);
}

.ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,
.ui-tooltip-bubble--end.ui-tooltip-bubble--top {
  right: 0;
  left: auto;
  transform: translateY(-2px);
}

.ui-tooltip:hover .ui-tooltip-bubble,
.ui-tooltip:focus-within .ui-tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom,
.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom {
  transform: translateX(-50%) translateY(0);
}

.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--top,
.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--top {
  transform: translateX(-50%) translateY(0);
}

.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,
.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--top,
.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,
.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--top,
.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,
.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--top,
.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,
.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--top {
  transform: translateY(0);
}

.article-editor-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.article-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.article-tool-btn:hover {
  background: var(--j13-bg-block-muted);
  color: var(--j13-green);
}

.article-tool-btn.active {
  background: rgba(24, 160, 88, 0.12);
  color: var(--j13-green);
}

.article-tool-btn strong {
  font-size: 12px;
  font-weight: 700;
}

.article-editor-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* 编辑面板 */
.article-editor-pane {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.article-editor-pane--source {
  min-height: 0;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block);
}

/* 编辑器选区：淡色高亮，避免浏览器默认深蓝 */
.article-editor-scroll ::selection,
.article-editor-markdown-input::selection {
  background: color-mix(in srgb, var(--j13-green) 24%, #d6e8f0);
  color: inherit;
}

.article-prosemirror ::selection {
  background: color-mix(in srgb, var(--j13-green) 24%, #d6e8f0);
  color: inherit;
}

.article-prosemirror .ProseMirror-selectednode {
  outline: 2px solid color-mix(in srgb, var(--j13-green) 45%, transparent);
  outline-offset: 2px;
}

.dark .article-editor-scroll ::selection,
.dark .article-editor-markdown-input::selection,
.dark .article-prosemirror ::selection {
  background: color-mix(in srgb, var(--j13-green) 35%, #2a3f50);
  color: inherit;
}

.article-editor-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: auto;
  background: transparent;
}

.article-editor-pane--source .article-editor-scroll {
  background: var(--j13-bg-block);
}

.article-editor-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.article-editor-content .tiptap,
.article-prosemirror {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 200px;
  padding: 16px 24px 32px;
  outline: none;
  font-size: 15.5px;
  line-height: 1.7;
  /* 长中英混排/表格单元格：强制在容器内换行，不撑破白底 */
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 编辑器内表格：完整网格、空格可见，便于点选与填写 */
.article-prosemirror.post-detail-content table,
.article-prosemirror table {
  width: 100%;
  max-width: 100%;
  margin: 1em 0;
  box-sizing: border-box;
  table-layout: fixed;
  border: 1px solid color-mix(in srgb, var(--j13-border) 80%, var(--color-text-3));
  border-radius: 8px;
  overflow: hidden;
  background: var(--j13-bg-surface);
}

.article-prosemirror.post-detail-content th,
.article-prosemirror.post-detail-content td,
.article-prosemirror th,
.article-prosemirror td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  min-width: 72px;
  min-height: 2.4em;
  padding: 8px 10px;
  border-right: 1px solid color-mix(in srgb, var(--j13-border) 80%, var(--color-text-3));
  border-bottom: 1px solid color-mix(in srgb, var(--j13-border) 80%, var(--color-text-3));
  vertical-align: top;
  background-clip: padding-box;
}

.article-prosemirror.post-detail-content th:last-child,
.article-prosemirror.post-detail-content td:last-child,
.article-prosemirror th:last-child,
.article-prosemirror td:last-child {
  border-right: none;
}

.article-prosemirror.post-detail-content tr:last-child th,
.article-prosemirror.post-detail-content tr:last-child td,
.article-prosemirror tr:last-child th,
.article-prosemirror tr:last-child td {
  border-bottom: none;
}

.article-prosemirror.post-detail-content th,
.article-prosemirror th {
  background: color-mix(in srgb, var(--j13-bg-block-muted) 92%, var(--j13-bg-surface));
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-2);
}

/* 编辑态关闭斑马纹与悬停，避免干扰光标所在格 */
.article-prosemirror.post-detail-content tbody tr:nth-child(even) td,
.article-prosemirror tbody tr:nth-child(even) td,
.article-prosemirror.post-detail-content tbody tr:hover td,
.article-prosemirror tbody tr:hover td {
  background: transparent;
}

.article-prosemirror.post-detail-content th.selectedCell,
.article-prosemirror.post-detail-content td.selectedCell,
.article-prosemirror th.selectedCell,
.article-prosemirror td.selectedCell {
  background: color-mix(in srgb, var(--j13-green) 12%, var(--j13-bg-surface)) !important;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--j13-green) 55%, transparent);
}

/* 单元格内段落：去掉外边距，空格也有可点高度 */
.article-prosemirror table p {
  margin: 0;
  min-height: 1.45em;
}

.article-prosemirror table p + p {
  margin-top: 0.35em;
}

/* 表格插入弹窗 */
.article-table-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 4px;
}
.article-table-dialog__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.article-table-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-table-dialog__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block-muted);
}
.article-table-dialog__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.article-table-dialog__toggle-text p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3);
  line-height: 1.4;
}
.article-table-dialog__footer {
  gap: 8px;
}
.article-table-dialog__remove {
  margin-right: auto;
}

/* 源码双栏：充分利用加宽画布 */
.article-editor--markdown .article-editor-body {
  min-height: 0;
}

.compose-page:has(.article-editor--markdown) .article-editor-markdown {
  min-height: 0;
}

.article-prosemirror p.is-editor-empty:first-child::before {
  color: var(--color-text-4);
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  user-select: none;
}

/* 空文档占位段落不参与选区高亮，避免 Ctrl+A 后出现幽灵蓝条 */
.article-prosemirror p.is-editor-empty::selection,
.article-prosemirror p.is-editor-empty *::selection {
  background: transparent;
}

.article-prosemirror.ProseMirror-focused p.is-editor-empty::selection {
  background: transparent;
}

.article-prosemirror a {
  color: var(--j13-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-prosemirror img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

/* —— 图组：多图并排 / 宫格 —— */
.image-group {
  margin: 1.25em 0;
  border-radius: 12px;
}

.image-group__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block-muted);
}

.image-group__toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-3);
}

.image-group__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.image-group__layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.image-group__layout-btn:hover {
  color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 8%, transparent);
}

.image-group__layout-btn.is-active {
  color: var(--j13-green);
  border-color: color-mix(in srgb, var(--j13-green) 35%, transparent);
  background: color-mix(in srgb, var(--j13-green) 10%, transparent);
}

.image-group--selected {
  outline: 2px solid color-mix(in srgb, var(--j13-green) 45%, transparent);
  outline-offset: 3px;
}

.image-group__grid,
.image-group[data-image-group]:not(:has(.image-group__toolbar)) {
  display: grid;
  gap: 8px;
}

/*
 * TipTap React NodeView 会在 contentDOM 内再包一层 div，
 * 若不打通则 grid 只有一个子项，编辑态会一直竖排。
 */
.article-prosemirror .image-group__grid > div {
  display: contents;
}

.image-group--cols-2 .image-group__grid,
.image-group--cols-2[data-image-group]:not(:has(.image-group__toolbar)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-group--cols-3 .image-group__grid,
.image-group--cols-3[data-image-group]:not(:has(.image-group__toolbar)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-group--cols-4 .image-group__grid,
.image-group--cols-4[data-image-group]:not(:has(.image-group__toolbar)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.image-group__grid img,
.image-group__grid .ProseMirror-selectednode,
.image-group[data-image-group]:not(:has(.image-group__toolbar)) > img {
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0;
  border-radius: 10px;
  box-shadow: var(--j13-shadow-soft);
}

.article-prosemirror .image-group__grid img {
  margin: 0;
  max-width: none;
}

/* 单图展示形态 */
.post-detail-content img.article-img--wide,
.article-prosemirror img.article-img--wide {
  width: 100%;
  max-width: min(100%, 960px);
  margin-left: auto;
  margin-right: auto;
  display: block;
  clear: both;
  float: none;
}

.post-detail-content img.article-img--float-left,
.article-prosemirror img.article-img--float-left {
  float: left;
  clear: none;
  display: block;
  width: min(42%, 280px);
  max-width: 42%;
  /* 顶对齐：无上边距，避免图顶高于/错位文字 */
  margin: 0 1em 0.75em 0;
  shape-outside: margin-box;
}

.post-detail-content img.article-img--float-right,
.article-prosemirror img.article-img--float-right {
  float: right;
  clear: none;
  display: block;
  width: min(42%, 280px);
  max-width: 42%;
  margin: 0 0 0.75em 1em;
  shape-outside: margin-box;
}

/*
 * 绕排后首段与图顶视觉对齐：
 * 正文 line-height: 1.8 会让字面落在行框中部，看起来比图顶更低。
 * 上移半行距；中间若夹空段落也一并照顾。
 */
.post-detail-content img.article-img--float-left + p,
.post-detail-content img.article-img--float-right + p,
.article-prosemirror img.article-img--float-left + p,
.article-prosemirror img.article-img--float-right + p,
.post-detail-content img.article-img--float-left + p:is(:empty, :has(> br:only-child)) + p,
.post-detail-content img.article-img--float-right + p:is(:empty, :has(> br:only-child)) + p,
.article-prosemirror img.article-img--float-left + p:is(:empty, :has(> br:only-child)) + p,
.article-prosemirror img.article-img--float-right + p:is(:empty, :has(> br:only-child)) + p {
  margin-top: calc((1em - 1.8em) / 2);
}

/* 图组内图片参与宫格，不要 clear/通栏 block 打散 */
.post-detail-content .image-group img,
.article-prosemirror .image-group img {
  clear: none;
  float: none;
}

.post-detail-content .image-group,
.article-prosemirror .image-group {
  clear: both;
}

/* 写到绕排图下方：双空行触发，并以 data-clear-float 持久化（源码往返可保留） */
.post-detail-content .article-clear-float,
.article-prosemirror .article-clear-float,
.post-detail-content [data-clear-float],
.article-prosemirror [data-clear-float] {
  clear: both;
}

.article-prosemirror {
  display: flow-root;
}

@media (max-width: 640px) {
  .image-group--cols-3 .image-group__grid,
  .image-group--cols-3[data-image-group]:not(:has(.image-group__toolbar)),
  .image-group--cols-4 .image-group__grid,
  .image-group--cols-4[data-image-group]:not(:has(.image-group__toolbar)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-group__layout-btn span {
    display: none;
  }

  .post-detail-content img.article-img--float-left,
  .post-detail-content img.article-img--float-right,
  .article-prosemirror img.article-img--float-left,
  .article-prosemirror img.article-img--float-right {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0.75em 0;
  }
}

.editor-members-only.post-members-only--visible {
  border: none;
  border-left: 3px solid rgba(24, 160, 88, 0.5);
  background: rgba(24, 160, 88, 0.04);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  box-shadow: none;
  padding: 0;
}

.editor-members-only .post-members-only__badge {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-bottom: none;
  border-radius: 0;
  background: transparent;
  color: var(--j13-green);
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}

.editor-members-only .post-members-only__badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-members-only .post-members-only__body {
  padding: 0 12px 12px;
  min-height: 48px;
  background: transparent;
}

.editor-members-only .post-members-only__body p.is-empty::before,
.editor-members-only .post-members-only__body[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-4);
  font-style: italic;
  pointer-events: none;
  float: left;
  height: 0;
}

.dark .editor-members-only .post-members-only__body {
  background: transparent;
}

.editor-members-only {
  margin: 16px 0;
}

.editor-members-only--selected {
  background: rgba(24, 160, 88, 0.07);
  box-shadow: inset 0 0 0 1px rgba(24, 160, 88, 0.28);
}

/* 编辑态：回复可见区块 */
.editor-reply-only.post-reply-only--visible {
  border: none;
  border-left: 3px solid rgba(194, 120, 3, 0.55);
  background: rgba(194, 120, 3, 0.05);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  box-shadow: none;
  padding: 0;
}

.editor-reply-only .post-reply-only__badge {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-bottom: none;
  border-radius: 0;
  background: transparent;
  color: #c27803;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}

.editor-reply-only .post-reply-only__badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-reply-only .post-reply-only__badge-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.editor-reply-only .post-reply-only__unwrap-btn {
  margin-left: 0;
  padding: 2px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 11px;
  cursor: pointer;
}

.editor-reply-only .post-reply-only__unwrap-btn:hover {
  color: #c27803;
  background: rgba(194, 120, 3, 0.1);
}

.editor-reply-only .post-reply-only__remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 11px;
  cursor: pointer;
}

.editor-reply-only .post-reply-only__remove-btn:hover {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
}

.editor-reply-only--empty .post-reply-only__remove-btn {
  color: #c0392b;
}

.editor-reply-only .post-reply-only__body {
  padding: 0 12px 12px;
  min-height: 48px;
  background: transparent;
}

.editor-reply-only .post-reply-only__body p.is-empty::before,
.editor-reply-only .post-reply-only__body[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-4);
  font-style: italic;
  pointer-events: none;
  float: left;
  height: 0;
}

.dark .editor-reply-only.post-reply-only--visible {
  border-left-color: rgba(232, 184, 74, 0.55);
  background: rgba(232, 184, 74, 0.06);
}

.dark .editor-reply-only .post-reply-only__badge {
  color: #e8b84a;
}

.editor-reply-only {
  margin: 16px 0;
}

.editor-reply-only--selected {
  background: rgba(194, 120, 3, 0.08);
  box-shadow: inset 0 0 0 1px rgba(194, 120, 3, 0.3);
}

.article-editor-status {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 20px;
  border-top: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
  font-size: 12px;
  color: var(--color-text-4);
  flex-shrink: 0;
  border-radius: 0 0 12px 12px;
}

.article-editor-status-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.article-editor-wordcount {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-3);
  font-weight: 500;
}

.article-editor-mode-label {
  color: var(--color-text-4);
}

.article-editor-status-sep {
  color: var(--color-text-4);
  opacity: 0.55;
}

.article-editor-status-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.article-editor-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--j13-border-light);
  border-radius: 6px;
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  flex-shrink: 0;
}

.article-editor-view-btn:hover {
  border-color: var(--j13-green);
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.article-editor-view-btn.active {
  border-color: rgba(24, 160, 88, 0.4);
  color: var(--j13-green);
  background: rgba(24, 160, 88, 0.1);
}

.article-editor--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  margin: 0 !important;
  padding: 12px 24px 0;
  background: var(--j13-bg-surface);
  border-top: none;
}

.article-editor--fullscreen .article-editor-bar {
  top: 0;
  margin: 0 auto;
  padding: 6px 8px;
}

.article-editor--fullscreen .article-editor-status {
  margin: 0 -24px;
  padding: 10px 24px 14px;
  border-radius: 0;
}

/* 全屏富文本：工具栏与编辑区同宽居中 */
.article-editor--fullscreen.article-editor--rich .article-editor-bar {
  width: 100%;
  max-width: var(--j13-article-read-w);
  margin: 0 auto;
}

.article-editor--fullscreen .article-editor-body {
  min-height: 0;
  flex: 1;
}

.article-editor--fullscreen .article-editor-pane,
.article-editor--fullscreen .article-editor-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* 全屏富文本：编辑区居中，宽度对齐帖子正文阅读区 */
.article-editor--fullscreen.article-editor--rich .article-editor-body {
  overflow-y: auto;
  padding: 20px 0 0;
  background: var(--j13-bg-workspace);
}

.article-editor--fullscreen.article-editor--rich .article-editor-pane {
  width: 100%;
  max-width: var(--j13-article-read-w);
  margin: 0 auto;
  min-height: calc(100vh - 176px);
  border-radius: 14px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.article-editor--fullscreen .article-editor-scroll,
.article-editor--fullscreen .article-editor-content .tiptap,
.article-editor--fullscreen .article-prosemirror {
  min-height: calc(100vh - 220px);
}

.article-editor--fullscreen .article-editor-markdown {
  min-height: calc(100vh - 176px);
}

.article-editor--fullscreen .article-editor-markdown-input,
.article-editor--fullscreen .article-editor-markdown-preview,
.article-editor--fullscreen .article-editor-pane--source {
  min-height: calc(100vh - 220px);
}

.article-editor-tools--markdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-editor-tools--markdown-hint {
  font-size: 12px;
  color: var(--color-text-3);
}

.article-link-dialog__footer {
  gap: 8px;
}

/* 代码块插入弹窗 */
.article-codeblock-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}
.article-codeblock-dialog__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-codeblock-dialog__langs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block-muted);
}
.article-codeblock-dialog__lang {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--j13-bg-surface);
  color: var(--color-text-1, inherit);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.article-codeblock-dialog__lang:hover {
  border-color: color-mix(in srgb, var(--j13-green) 25%, var(--j13-border));
}
.article-codeblock-dialog__lang.is-active {
  border-color: color-mix(in srgb, var(--j13-green) 45%, transparent);
  background: var(--j13-green-bg);
  color: var(--j13-green-hover);
  font-weight: 600;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--j13-green) 20%, transparent);
}
.article-codeblock-dialog__lang-id {
  font-size: 11px;
  opacity: 0.55;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 400;
}
.article-codeblock-dialog__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  font-size: 13px;
  color: var(--color-text-3, #8b949e);
  text-align: center;
}
.article-codeblock-dialog__codehint {
  display: inline;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--j13-bg-block-muted);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--color-text-2, inherit);
}
.article-codeblock-dialog__toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}
.article-codeblock-dialog__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block-muted);
}
.article-codeblock-dialog__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.article-codeblock-dialog__toggle-text p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3, #8b949e);
  line-height: 1.45;
}
.article-codeblock-dialog__footer {
  gap: 8px;
  margin-top: 4px;
}
.article-codeblock-dialog__remove {
  margin-right: auto;
}

@media (max-width: 560px) {
  .article-codeblock-dialog__langs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.article-editor-markdown {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border-top: none;
  overflow: hidden;
}

.article-editor--markdown .article-editor-pane--source {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--j13-border-light);
  min-height: 0;
  height: 100%;
}

.article-editor--markdown .article-editor-markdown-preview {
  border: none;
  border-radius: 0;
}

.article-editor-markdown-input {
  display: block;
  width: 100%;
  min-height: 100%;
  padding: 14px 16px 20px;
  border: none;
  outline: none;
  resize: none;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-1);
  background: transparent;
}

.article-editor-markdown-preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  overflow: hidden;
}

.article-editor-markdown-preview-label {
  padding: 8px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-4);
  flex-shrink: 0;
}

.article-editor-markdown-preview-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .compose-page {
    --compose-header-sticky-h: 53px;
  }

  .compose-canvas {
    padding: 10px 12px 20px;
  }

  .compose-shell {
    border-radius: 10px;
  }

  .compose-header {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 10px 10px 0 0;
  }

  .compose-draft-hint {
    display: none;
  }

  .compose-back span {
    display: none;
  }

  .compose-back {
    padding: 6px 8px;
  }

  .compose-context {
    padding: 12px;
    gap: 8px;
  }

  .compose-context-row {
    flex-direction: column;
    gap: 6px;
  }

  .compose-context-label,
  .compose-context-row--tags .compose-context-label {
    margin-top: 0;
    width: auto;
  }

  .compose-title {
    font-size: 20px;
    padding: 14px 14px 8px;
  }

  .article-editor--fullscreen {
    padding: 8px 12px 0;
  }

  .article-editor--fullscreen .article-editor-bar {
    margin: 0;
    padding: 8px 0;
  }

  .article-editor-markdown {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .article-editor--markdown .article-editor-pane--source {
    border-right: none;
    border-bottom: 1px solid var(--j13-border-light);
  }

  .article-editor-pane--source {
    min-height: 0;
  }

  .article-editor--fullscreen.article-editor--rich .article-editor-pane {
    max-width: none;
    margin: 0;
  }

  .article-editor-bar {
    padding: 8px 10px;
  }

  .article-editor-content .tiptap,
  .article-prosemirror {
    min-height: 160px;
    padding: 12px 14px 20px;
  }

  .article-editor-status {
    padding: 10px 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    border-radius: 0 0 10px 10px;
  }

  .article-editor--fullscreen .article-editor-status {
    margin: 0 -12px;
    padding: 10px 12px;
    border-radius: 0;
  }

  .article-editor-status-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .compose-tags-field {
    min-width: 0;
  }
}

/* 路由懒加载占位已改为 FeedPageSkeleton，保留类名兼容 */

/* ========== React 管理后台 ========== */
.admin-shell { min-height: 100vh; background: hsl(var(--background)); }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px; border-bottom: 1px solid var(--j13-border);
  background: hsl(var(--card));
}
.admin-topbar-brand { display: flex; align-items: center; gap: 10px; }
.admin-topbar-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--j13-green);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
  object-fit: cover; flex-shrink: 0;
}

.admin-brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block-muted);
}
.admin-brand-preview-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--j13-green); color: #fff;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-brand-preview-logo {
  width: 48px; height: 48px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
}
.admin-brand-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-brand-upload-row input[type="file"] {
  flex: 1;
  min-width: 0;
}
.admin-topbar-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.admin-topbar-sub { font-size: 12px; color: hsl(var(--muted-foreground)); }
.admin-topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-topbar-user { font-size: 13px; color: hsl(var(--muted-foreground)); }
.admin-link-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--j13-green); background: none; border: none; cursor: pointer;
}
.admin-body { display: flex; height: calc(100vh - 56px); overflow: hidden; }
.admin-sidebar {
  width: 220px; flex-shrink: 0; padding: 12px 10px 20px; border-right: 1px solid var(--j13-border);
  background: hsl(var(--card)); overflow-y: auto;
}
.admin-nav-group { margin-bottom: 14px; }
.admin-nav-group:last-child { margin-bottom: 0; }
.admin-nav-group-label {
  padding: 6px 12px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: hsl(var(--muted-foreground) / 0.85);
}
.admin-nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; margin-bottom: 2px; border-radius: 8px; font-size: 13px;
  color: hsl(var(--muted-foreground)); text-decoration: none;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-nav-icon { flex-shrink: 0; }
.admin-nav-text { flex: 1; min-width: 0; }
.admin-nav-badge {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  background: hsl(24 90% 48% / 0.16); color: hsl(24 90% 40%);
}
.dark .admin-nav-badge { background: hsl(24 90% 55% / 0.22); color: hsl(24 95% 72%); }
.admin-nav-item:hover { background: var(--j13-green-bg); color: var(--j13-green); }
.admin-nav-item.active {
  background: var(--j13-green-bg); color: var(--j13-green); font-weight: 600;
  border-left-color: var(--j13-green);
}
.admin-main { flex: 1; min-width: 0; min-height: 0; padding: 24px; overflow-y: auto; }
.admin-page-head { margin-bottom: 20px; }
.admin-page-head h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.admin-page-head p { font-size: 13px; color: hsl(var(--muted-foreground)); }
.admin-section-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 13px; font-weight: 600;
}
.admin-section-muted { font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.admin-queue-section { margin-bottom: 22px; }
.admin-queue-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.admin-queue-card {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--j13-border); background: hsl(var(--card));
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.admin-queue-card:hover {
  border-color: var(--j13-green); background: var(--j13-green-bg);
}
.admin-queue-card.has-work {
  border-color: hsl(24 80% 55% / 0.45);
  background: hsl(24 90% 48% / 0.06);
}
.admin-queue-card.has-work:hover {
  border-color: hsl(24 80% 50%);
  background: hsl(24 90% 48% / 0.1);
}
.admin-queue-card-top {
  display: flex; align-items: center; justify-content: space-between;
  color: hsl(var(--muted-foreground)); margin-bottom: 8px;
}
.admin-queue-count { font-size: 22px; font-weight: 700; color: hsl(var(--foreground)); line-height: 1; }
.admin-queue-card.has-work .admin-queue-count { color: hsl(24 90% 40%); }
.dark .admin-queue-card.has-work .admin-queue-count { color: hsl(24 95% 68%); }
.admin-queue-label { font-size: 13px; font-weight: 600; }
.admin-queue-hint { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; line-height: 1.4; }
.admin-stat-section { margin-bottom: 8px; }
.admin-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.admin-stat-card {
  padding: 16px; border-radius: 10px; border: 1px solid var(--j13-border); background: hsl(var(--card));
}
.admin-stat-value { font-size: 24px; font-weight: 700; color: var(--j13-green); }
.admin-stat-label { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 4px; }
.admin-card {
  border: 1px solid var(--j13-border); border-radius: 10px; background: hsl(var(--card));
  margin-bottom: 16px; overflow-x: auto;
}
.admin-card-body { padding: 16px 20px 20px; }
.admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--j13-border); font-weight: 600; font-size: 14px;
}
.admin-card-desc { padding: 12px 16px 0; font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.admin-card .admin-card-desc + button { margin: 12px 16px 16px; }
.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 16px;
  font-size: 13px;
}
.admin-form-row label { color: hsl(var(--muted-foreground)); white-space: nowrap; }

/* ========== 系统设置页 ========== */
.admin-settings-page {
  max-width: 880px;
  padding-bottom: 24px;
}
.admin-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--j13-border);
}
.admin-settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.admin-settings-tab:hover { color: hsl(var(--foreground)); }
.admin-settings-tab.active {
  color: var(--j13-green);
  border-bottom-color: var(--j13-green);
}
.admin-settings-panel { display: flex; flex-direction: column; gap: 0; }
.admin-settings-card { margin-bottom: 0; }
.admin-settings-card-badge {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--muted) / 0.45);
}
.admin-settings-sections { display: flex; flex-direction: column; gap: 20px; }
.admin-settings-section-head h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.admin-settings-section-head p {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
  margin-bottom: 10px;
}
.admin-settings-table {
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  overflow: hidden;
  background: hsl(var(--background));
}
.admin-settings-row {
  display: grid;
  grid-template-columns: 140px 140px 1fr;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--j13-border);
  font-size: 13px;
}
.admin-settings-row:last-child { border-bottom: none; }
.admin-settings-row-label {
  color: hsl(var(--foreground));
  font-weight: 500;
}
.admin-settings-row-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-settings-input {
  width: 88px;
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
}
.admin-settings-unit {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.admin-settings-row-hint {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

/* 设置表内紧凑开关（勿复用 .admin-mail-switch，其绝对定位会破坏后台布局） */
.admin-settings-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 40px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-settings-switch-ui {
  position: relative;
  display: block;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: hsl(var(--muted-foreground) / 0.28);
  transition: background .18s;
}
.admin-settings-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform .18s;
}
.admin-settings-switch.is-on .admin-settings-switch-ui {
  background: var(--j13-green);
}
.admin-settings-switch.is-on .admin-settings-switch-ui::after {
  transform: translateX(16px);
}
.admin-settings-switch:focus-visible {
  outline: 2px solid var(--j13-green);
  outline-offset: 2px;
  border-radius: 999px;
}

.admin-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  background: hsl(var(--card));
}
.admin-settings-bar p {
  margin: 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
  max-width: 420px;
}
.admin-settings-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.admin-settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.admin-settings-row-input--wide {
  flex: 1;
  min-width: 0;
}
.admin-settings-row-input--stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.admin-permalink-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-permalink-chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  cursor: pointer;
}
.admin-permalink-chip:hover:not(:disabled) {
  border-color: var(--j13-green, hsl(var(--primary)));
  color: var(--j13-green, hsl(var(--primary)));
}
.admin-permalink-chip.is-active {
  border-color: var(--j13-green, hsl(var(--primary)));
  background: color-mix(in srgb, var(--j13-green, hsl(var(--primary))) 12%, transparent);
  color: var(--j13-green, hsl(var(--primary)));
  font-weight: 600;
}
.admin-permalink-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.admin-permalink-preview {
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: hsl(var(--muted));
  font-size: 12px;
}
.admin-settings-input--text {
  width: 100%;
  max-width: 360px;
}
.admin-settings-select {
  height: 36px;
  min-width: 220px;
  max-width: 360px;
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--background));
  padding: 0 10px;
  font-size: 13px;
}

/* ========== 邮件设置表单 ========== */
.admin-mail-panel .admin-settings-card {
  margin-bottom: 0;
}
.admin-mail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 3px 10px;
  border-radius: 999px;
  background: hsl(var(--muted) / 0.5);
}
.admin-mail-status.is-on {
  color: var(--j13-green);
  background: rgba(24, 160, 88, 0.1);
}
.admin-mail-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.admin-mail-status.is-on .admin-mail-status-dot {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.18);
}
.admin-mail-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.admin-mail-switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  background: var(--j13-bg-block-muted, hsl(var(--muted) / 0.35));
  cursor: pointer;
}
.admin-mail-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.admin-mail-switch-ui {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin-top: 1px;
  border-radius: 999px;
  background: hsl(var(--muted-foreground) / 0.28);
  transition: background .18s;
}
.admin-mail-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform .18s;
}
.admin-mail-switch:has(input:checked) .admin-mail-switch-ui {
  background: var(--j13-green);
}
.admin-mail-switch:has(input:checked) .admin-mail-switch-ui::after {
  transform: translateX(16px);
}
.admin-mail-switch:has(input:focus-visible) .admin-mail-switch-ui {
  outline: 2px solid var(--j13-green);
  outline-offset: 2px;
}
.admin-mail-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-mail-switch-copy strong {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.admin-mail-switch-copy small {
  font-size: 12px;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
}
.admin-mail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.admin-mail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.admin-mail-field--span2 {
  grid-column: 1 / -1;
}
.admin-mail-field label {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.admin-mail-field-hint {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.admin-mail-field input,
.admin-mail-select {
  width: 100%;
  height: 36px;
}
.admin-mail-select {
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--background));
  padding: 0 10px;
  font-size: 13px;
  color: hsl(var(--foreground));
}
.admin-mail-select:focus {
  outline: none;
  border-color: var(--j13-green);
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.15);
}
.admin-mail-test {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--j13-border);
  border-radius: 10px;
  background: hsl(var(--background));
}
.admin-mail-test-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-mail-test-head strong {
  font-size: 13px;
  font-weight: 600;
}
.admin-mail-test-head span {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.admin-mail-test-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-mail-test-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
}
.admin-mail-test-row button {
  flex-shrink: 0;
}

.admin-oidc-url {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: hsl(var(--muted) / 0.55);
  font-size: 12.5px;
  word-break: break-all;
  line-height: 1.45;
}

.admin-oauth-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-oauth-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
}

.admin-oauth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .admin-mail-grid {
    grid-template-columns: 1fr;
  }
  .admin-mail-field--span2 {
    grid-column: auto;
  }
  .admin-mail-test-row {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-oauth-row {
    flex-direction: column;
  }
}

.admin-settings-filter-body { display: flex; flex-direction: column; gap: 12px; }
.admin-settings-filter-tip {
  margin: 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.admin-settings-filter-tip code,
.admin-settings-backup-name code {
  font-size: 11px;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: 4px;
}
.admin-settings-filter-textarea {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}
.admin-settings-info { display: flex; flex-direction: column; gap: 0; }
.admin-settings-info-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--j13-border);
  font-size: 13px;
}
.admin-settings-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.admin-settings-info-row:first-child { padding-top: 0; }
.admin-settings-info-row dt { color: hsl(var(--muted-foreground)); }
.admin-settings-info-row dd { margin: 0; word-break: break-all; }
.admin-settings-info-row dd code {
  font-size: 12px;
  background: hsl(var(--muted));
  padding: 2px 6px;
  border-radius: 4px;
}
.admin-settings-backup-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.admin-settings-backup-body > p {
  margin: 0;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.admin-settings-backup-name { font-size: 12px !important; }

@media (max-width: 640px) {
  .admin-settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
  }
  .admin-settings-row-hint { padding-left: 0; }
  .admin-settings-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-settings-bar p { max-width: none; }
  .admin-settings-info-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 768px) {
  .admin-body {
    height: calc(100dvh - 56px);
  }
  .admin-main {
    padding: 16px;
  }
  .admin-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .admin-topbar-brand {
    gap: 8px;
    min-width: 0;
  }
  .admin-topbar-sub { display: none; }
  .admin-dl {
    grid-template-columns: 1fr;
  }
}

/* 后台窄屏导航抽屉（与前台 aside-drawer 同范式） */
.admin-nav-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.admin-nav-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 88vw);
  background: hsl(var(--card));
  border-right: 1px solid var(--j13-border);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  animation: admin-nav-drawer-in 0.2s ease;
}

@keyframes admin-nav-drawer-in {
  from { transform: translateX(-12px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.admin-nav-drawer-head {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--j13-border);
  font-size: 14px;
  font-weight: 600;
}

.admin-nav-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-drawer { animation: none; }
}

.admin-page-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--j13-border); }
.admin-table th { font-weight: 600; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / 0.3); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table-email { max-width: 200px; word-break: break-all; }
.admin-table-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.admin-empty { padding: 32px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.admin-text-link {
  background: none; border: none; padding: 0; color: var(--j13-green); cursor: pointer; font-size: inherit;
}
.admin-text-link:hover { text-decoration: underline; }
.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--j13-border);
  border-radius: 999px;
  background: var(--j13-bg-surface);
  color: var(--color-text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border));
  color: var(--j13-green);
}

.admin-tab.active {
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 45%, var(--j13-border));
  color: var(--j13-green);
  font-weight: 600;
}

.admin-search-bar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 480px; }
.admin-pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px; border-top: 1px solid var(--j13-border); font-size: 13px;
}

.admin-media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-media-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 220px;
  max-width: 520px;
}
.admin-media-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 16px;
}
.admin-media-card {
  position: relative;
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  background: var(--j13-bg-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-media-card.is-selected {
  border-color: color-mix(in srgb, var(--j13-green) 55%, var(--j13-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--j13-green) 35%, transparent);
}
.admin-media-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--j13-bg-surface) 88%, transparent);
  border: 1px solid var(--j13-border);
}
.admin-media-thumb {
  display: block;
  aspect-ratio: 1;
  background: hsl(var(--muted) / 0.35);
  overflow: hidden;
}
.admin-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-media-meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.admin-media-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-media-sub,
.admin-media-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.admin-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.admin-dl { padding: 16px; display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; font-size: 13px; }
.admin-dl dt { color: hsl(var(--muted-foreground)); }
.admin-dl dd code { font-size: 12px; background: hsl(var(--muted)); padding: 2px 6px; border-radius: 4px; }

/* 站内私信 */
.header-msg-btn {
  position: relative;
}

.header-msg-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.pm-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pm-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.pm-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--color-text-2, #475569);
  font-size: 0.875rem;
  font-weight: 560;
  cursor: pointer;
}

.pm-tab:hover {
  border-color: color-mix(in srgb, var(--j13-green, #18a058) 40%, var(--j13-border, #e2e8f0));
}

.pm-tab.active {
  border-color: color-mix(in srgb, var(--j13-green, #18a058) 45%, transparent);
  background: color-mix(in srgb, var(--j13-green, #18a058) 10%, transparent);
  color: var(--j13-green, #18a058);
}

.pm-tab__badge {
  min-width: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: hsl(var(--destructive));
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.15rem;
  text-align: center;
}

.pm-notify {
  padding: 0.85rem 1rem 1rem;
  border-radius: 0.5rem;
}

.pm-notify-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.pm-notify-filter {
  padding: 0.25rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 14%, transparent);
  color: var(--color-text-3, #64748b);
  font-size: 0.78rem;
  cursor: pointer;
}

.pm-notify-filter.active {
  background: color-mix(in srgb, var(--j13-green, #18a058) 16%, transparent);
  color: var(--j13-green, #18a058);
  font-weight: 600;
}

.pm-notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pm-notify-item {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.45rem;
  background: var(--j13-card, #fff);
}

.pm-notify-item.unread {
  border-color: color-mix(in srgb, var(--j13-green, #18a058) 35%, var(--j13-border, #e2e8f0));
  background: color-mix(in srgb, var(--j13-green, #18a058) 5%, var(--j13-card, #fff));
}

.pm-notify-item__kind {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--j13-green, #18a058);
  margin-bottom: 0.25rem;
}

.pm-notify-item__subject {
  font-weight: 650;
  margin-bottom: 0.25rem;
}

.pm-notify-item__text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-2, #475569);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pm-notify-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--color-text-4, #94a3b8);
}

.pm-notify-item__link {
  color: var(--j13-green, #18a058);
  text-decoration: none;
  font-weight: 560;
}

.pm-notify-item__link:hover {
  text-decoration: underline;
}

.pm-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  height: min(72vh, 680px);
  min-height: 480px;
  overflow: hidden;
}

.pm-list {
  border-right: 1px solid var(--j13-border-light);
  overflow-y: auto;
  background: var(--j13-bg-block-muted);
}

.pm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--j13-bg-surface);
}

.pm-avatar--fallback,
.pm-avatar--system {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.pm-avatar--system {
  color: var(--color-text-2);
  background: color-mix(in srgb, var(--j13-border) 35%, var(--j13-bg-surface));
}

.pm-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--j13-border-light);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.pm-conv-item:hover {
  background: color-mix(in srgb, var(--j13-bg-surface) 70%, transparent);
}

.pm-conv-item.active {
  background: var(--j13-bg-surface);
  box-shadow: inset 3px 0 0 var(--j13-green);
}

.pm-conv-item.unread .pm-conv-item__name {
  font-weight: 700;
  color: var(--color-text-1);
}

.pm-conv-item.unread .pm-conv-item__preview > span:first-child {
  color: var(--color-text-1);
  font-weight: 500;
}

.pm-conv-item__body {
  min-width: 0;
  flex: 1;
}

.pm-conv-item__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.pm-conv-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-1);
}

.pm-conv-item__time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-4);
}

.pm-conv-item__preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-3);
}

.pm-conv-item__preview > span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-conv-item__badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.pm-list-more {
  padding: 8px;
  text-align: center;
}

.pm-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--j13-bg-surface);
}

.pm-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  flex-shrink: 0;
}

.pm-thread-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: -2px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-2);
  cursor: pointer;
}

.pm-thread-back:hover {
  background: var(--j13-bg-block-muted);
}

.pm-thread-head__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-thread-head__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.pm-thread-head__name:hover {
  color: var(--j13-green);
}

.pm-thread-head__sub {
  font-size: 12px;
  color: var(--color-text-3);
}

.pm-thread-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  background:
    radial-gradient(ellipse at top, var(--j13-green-bg), transparent 55%),
    var(--j13-bg-workspace);
}

.pm-thread-older {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.pm-bubble-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.pm-bubble-row--mine {
  justify-content: flex-end;
}

.pm-bubble-row--system {
  justify-content: center;
}

.pm-bubble {
  max-width: min(78%, 480px);
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pm-bubble--mine {
  border-radius: 14px 14px 4px 14px;
  background: var(--j13-green-soft);
  border-color: color-mix(in srgb, var(--j13-green) 22%, var(--j13-border-light));
}

.pm-bubble--system {
  max-width: min(92%, 520px);
  border-radius: 12px;
  background: var(--j13-bg-surface);
  border-color: var(--j13-border);
}

.pm-bubble__kind {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
  font-size: 11px;
  font-weight: 600;
}

.pm-bubble__subject {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.pm-bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-1);
}

.pm-bubble__link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.pm-bubble__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-text-4);
}

.pm-bubble-row--mine .pm-bubble__meta {
  justify-content: flex-end;
}

.pm-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  flex-shrink: 0;
}

.pm-composer--readonly {
  display: block;
  font-size: 12px;
  color: var(--color-text-3);
  text-align: center;
  padding: 14px;
}

.pm-composer__input {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--j13-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-1);
  background: var(--j13-bg-block-muted);
  outline: none;
}

.pm-composer__input:focus {
  border-color: var(--j13-green);
  background: var(--j13-bg-surface);
}

.pm-composer__send {
  flex-shrink: 0;
}

.pm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 48px 20px;
  text-align: center;
  color: var(--color-text-3);
  font-size: 13px;
}

.pm-empty p {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-2);
}

.pm-empty span {
  font-size: 12px;
}

.pm-empty--thread {
  flex: 1;
}

.pm-compose-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-2);
}

.pm-field input,
.pm-field textarea,
.pm-field select {
  width: 100%;
  border: 1px solid var(--j13-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-1);
  background: var(--j13-bg-surface);
  outline: none;
}

.pm-field input:focus,
.pm-field textarea:focus,
.pm-field select:focus {
  border-color: var(--j13-green);
}

.pm-field textarea {
  resize: vertical;
  min-height: 96px;
}

@media (max-width: 768px) {
  .pm-layout {
    grid-template-columns: 1fr;
    height: min(78vh, 720px);
  }

  .pm-list {
    border-right: none;
  }

  .pm-layout:not(.pm-layout--thread) .pm-thread {
    display: none;
  }

  .pm-layout.pm-layout--thread .pm-list {
    display: none;
  }

  .pm-thread-back {
    display: inline-flex;
  }
}

/* —— 用户徽章 / 等级 —— */
.user-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  flex-wrap: wrap;
}
.user-badges--compact {
  gap: 0.2rem;
}
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 18%, transparent);
  color: var(--j13-text-secondary, #64748b);
}
.user-badge--owner {
  background: color-mix(in srgb, #d97706 22%, transparent);
  color: #b45309;
}
.user-badge--verified {
  background: color-mix(in srgb, var(--j13-green, #16a34a) 20%, transparent);
  color: var(--j13-green, #16a34a);
}
.user-badge--level {
  gap: 0.2rem;
  padding-left: 0.3rem;
  border-left: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
.user-badge__level-text {
  letter-spacing: 0.01em;
}
.level-emblem {
  flex-shrink: 0;
  display: block;
}
.user-badge--level-sprout {
  background: color-mix(in srgb, #6b8f71 16%, transparent);
  color: #5a7260;
}
.user-badge--level-leaf {
  background: color-mix(in srgb, var(--j13-green, #18a058) 16%, transparent);
  color: var(--j13-green, #18a058);
}
.user-badge--level-crest {
  background: color-mix(in srgb, #d97706 18%, transparent);
  color: #b45309;
}
.user-badge--level-crown {
  background: color-mix(in srgb, #ca8a04 20%, transparent);
  color: #a16207;
}
.dark .user-badge--level-sprout {
  background: color-mix(in srgb, #86a789 18%, transparent);
  color: #a3b8a6;
}
.dark .user-badge--level-leaf {
  background: color-mix(in srgb, var(--j13-green, #23c36b) 18%, transparent);
  color: var(--j13-green, #23c36b);
}
.dark .user-badge--level-crest {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #fbbf24;
}
.dark .user-badge--level-crown {
  background: color-mix(in srgb, #eab308 20%, transparent);
  color: #facc15;
}
.user-badge--ach {
  padding: 0.15rem;
}

/* —— 积分钱包 —— */
.points-wallet {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--j13-card, #fff);
}
.points-wallet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.points-wallet-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 1rem;
}
.points-wallet-balance {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.points-wallet-balance strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.points-wallet-balance span {
  color: var(--j13-text-secondary, #64748b);
  font-size: 0.85rem;
}
.points-wallet-balance em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--j13-text-secondary, #64748b);
  margin-left: 0.5rem;
}
.points-wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.points-wallet-ledger h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.points-wallet-ledger ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.points-wallet-ledger li {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--j13-border, #e2e8f0);
  font-size: 0.85rem;
}
.points-wallet-ledger .pos { color: var(--j13-green, #16a34a); font-weight: 600; }
.points-wallet-ledger .neg { color: #dc2626; font-weight: 600; }
.points-wallet-empty {
  margin: 0;
  color: var(--j13-text-secondary, #64748b);
  font-size: 0.85rem;
}

/* —— 积分可见区块 —— */
.post-points-only__gate,
.post-points-only__badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.post-points-only--locked .post-points-only__gate {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border: 1px dashed color-mix(in srgb, #ca8a04 45%, transparent);
  border-radius: 0.5rem;
  background: color-mix(in srgb, #ca8a04 8%, transparent);
}
.post-points-only__gate-btn,
.post-points-only__remove-btn {
  cursor: pointer;
  border: 1px solid color-mix(in srgb, #ca8a04 40%, transparent);
  background: #fff;
  border-radius: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}
.post-points-only__cost {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.post-points-only__cost input {
  width: 4rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.25rem;
}
.editor-points-only {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px solid color-mix(in srgb, #ca8a04 35%, transparent);
  border-radius: 0.4rem;
}
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* —— 用户管理：成员目录式布局 —— */
.admin-users-page {
  max-width: 920px;
}
.admin-users-page .admin-page-head {
  margin-bottom: 28px;
}
.admin-users-page .admin-page-head h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}
.admin-users-page .admin-page-head p {
  margin-top: 6px;
  font-size: 14px;
}

.admin-users-panel {
  border: 1px solid var(--j13-border);
  border-radius: 14px;
  background: hsl(var(--card));
  overflow: hidden;
}
.admin-users-panel-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--j13-border);
  background: linear-gradient(
    180deg,
    hsl(var(--muted) / 0.35) 0%,
    hsl(var(--card)) 100%
  );
}
.admin-users-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-users-search-field {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.admin-users-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.admin-users-search-field input {
  height: 40px;
  padding-left: 38px;
  border-radius: 10px;
  background: hsl(var(--background));
}
.admin-users-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-users-filter {
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-users-filter:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.5);
}
.admin-users-filter.active {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 28%, transparent);
}

.admin-users-cols {
  display: none;
  grid-template-columns: minmax(0, 1fr) 72px 72px 96px 72px;
  gap: 12px;
  padding: 10px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground) / 0.9);
}
.admin-users-cols-who { padding-left: 56px; }
.admin-users-cols > span:not(.admin-users-cols-who):not(.admin-users-cols-action) {
  text-align: right;
}

.admin-users-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.admin-users-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--j13-border);
  transition: background .15s;
}
.admin-users-row:last-of-type { border-bottom: none; }
.admin-users-row:hover { background: hsl(var(--muted) / 0.28); }
.admin-users-row--banned {
  background: hsl(0 70% 50% / 0.035);
}
.admin-users-row--banned:hover {
  background: hsl(0 70% 50% / 0.06);
}

.admin-users-who {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.admin-users-who .admin-user-avatar {
  width: 44px;
  height: 44px;
  margin-top: 1px;
  box-shadow: 0 0 0 1px var(--j13-border);
}
.admin-users-who-text { min-width: 0; }
.admin-users-who-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-user-nick {
  border: none;
  background: none;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  cursor: pointer;
  line-height: 1.3;
}
.admin-user-nick:hover {
  color: var(--j13-green);
}
.admin-users-handle {
  margin-top: 3px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.admin-users-mail {
  margin-top: 2px;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground) / 0.92);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-users-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.admin-users-metric::before {
  content: attr(data-label);
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.admin-users-metric-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}
.admin-users-action {
  display: flex;
  justify-content: flex-start;
}
.admin-users-manage-btn {
  gap: 4px;
  color: hsl(var(--muted-foreground));
}
.admin-users-manage-btn:hover {
  color: var(--j13-green);
  background: var(--j13-green-bg);
}

.admin-users-empty {
  padding: 56px 24px;
  text-align: center;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
}
.admin-users-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--j13-border);
  background: hsl(var(--muted) / 0.18);
}
.admin-users-total {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.admin-users-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: hsl(var(--muted));
}
.admin-user-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--j13-green);
  background: var(--j13-green-bg);
}
.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.admin-user-email {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-manage-dialog { gap: 0; }
.admin-user-manage-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}
.admin-user-manage-head .admin-user-avatar {
  width: 52px;
  height: 52px;
}
.admin-user-manage-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.admin-user-manage-section {
  padding: 14px 0;
  border-top: 1px solid var(--j13-border);
}
.admin-user-manage-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.admin-user-fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
}
.admin-user-fact-grid dt {
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2px;
}
.admin-user-fact-grid dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}
.admin-user-manage-actions,
.admin-user-manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-user-manage-row > input,
.admin-user-manage-row > .admin-user-select { flex: 1; min-width: 120px; }
.admin-user-manage-hint {
  margin-top: 6px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.admin-user-select {
  height: 36px;
  border-radius: 8px;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  padding: 0 10px;
  font-size: 13px;
  color: hsl(var(--foreground));
}
.admin-user-badge-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: hsl(var(--muted) / 0.35);
  font-size: 13px;
}
.admin-user-badge-preview .admin-user-manage-hint { margin: 0; }

@media (min-width: 760px) {
  .admin-users-cols { display: grid; }
  .admin-users-row {
    grid-template-columns: minmax(0, 1fr) 72px 72px 96px 72px;
    gap: 12px;
    padding: 16px 20px;
  }
  .admin-users-metric::before { display: none; }
  .admin-users-metric {
    align-items: flex-end;
    text-align: right;
  }
  .admin-users-metric-value { font-size: 13.5px; font-weight: 500; }
  .admin-users-metric--time .admin-users-metric-value {
    font-weight: 500;
    color: hsl(var(--muted-foreground));
  }
  .admin-users-action { justify-content: flex-end; }
  .admin-users-mail { max-width: 220px; }
}

@media (max-width: 759px) {
  .admin-users-row {
    padding: 16px 16px 18px;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .admin-users-who {
    grid-column: 1 / -1;
  }
  .admin-users-metric {
    padding-top: 4px;
  }
  .admin-users-action {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 4px;
  }
  .admin-users-panel-head { padding: 16px; }
}
.admin-badge-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}
.admin-badge-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.admin-badge-form-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem !important;
  margin-top: 1.4rem;
}
.admin-select {
  height: 2.25rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.35rem;
  padding: 0 0.5rem;
  background: var(--j13-card, #fff);
  width: 100%;
}

/* —— 徽章管理（卡片式） —— */
.admin-badge-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-badge-stat {
  padding: 0.85rem 1rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.55rem;
  background: var(--j13-card, #fff);
}
.admin-badge-stat strong {
  display: block;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.admin-badge-stat span {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
}
.admin-badge-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-badge-search {
  position: relative;
  min-width: min(100%, 240px);
  flex: 1 1 220px;
  max-width: 320px;
}
.admin-badge-search > svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.admin-badge-search input {
  padding-left: 2rem;
}
.admin-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}
.admin-badge-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  border-radius: 0.7rem;
  background: var(--j13-card, #fff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-badge-card:hover {
  border-color: color-mix(in srgb, var(--j13-green, #16a34a) 35%, var(--j13-border, #e2e8f0));
  box-shadow: 0 6px 20px hsl(var(--foreground) / 0.04);
}
.admin-badge-card.is-disabled {
  opacity: 0.72;
}
.admin-badge-card-top {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.admin-badge-preview {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #1d4ed8;
  background: color-mix(in srgb, #2563eb 14%, transparent);
  border: 1px solid color-mix(in srgb, #2563eb 22%, transparent);
}
.admin-badge-preview.is-limited {
  color: #b45309;
  background: color-mix(in srgb, #d97706 16%, transparent);
  border-color: color-mix(in srgb, #d97706 28%, transparent);
}
.admin-badge-preview--lg {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.85rem;
}
.admin-badge-card-meta {
  min-width: 0;
  flex: 1;
}
.admin-badge-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.admin-badge-card-title-row h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}
.admin-badge-code {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.admin-badge-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.admin-badge-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--j13-border, #e2e8f0);
}
.admin-badge-condition {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  max-width: 100%;
}
.admin-badge-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.admin-badge-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--j13-border, #e2e8f0);
  border-radius: 0.75rem;
  color: hsl(var(--muted-foreground));
}
.admin-badge-empty h3 {
  margin: 0.75rem 0 0.35rem;
  font-size: 1.05rem;
  color: hsl(var(--foreground));
}
.admin-badge-empty p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.admin-badge-dialog-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid var(--j13-border, #e2e8f0);
}
.admin-badge-dialog-preview-name {
  font-weight: 600;
  font-size: 1rem;
}
.admin-badge-dialog-preview-cond {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}
.admin-badge-dialog-fields {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.admin-badge-kind-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 0.55rem;
  background: hsl(var(--muted) / 0.45);
}
.admin-badge-kind-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.15rem;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 550;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.admin-badge-kind-seg button.active {
  background: var(--j13-card, #fff);
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.08);
}
.admin-badge-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.admin-badge-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.admin-badge-field-row--end {
  align-items: end;
}
.admin-badge-field-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}
.admin-badge-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
  gap: 0.35rem;
}
.admin-badge-icon-opt {
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  border: 1px solid var(--j13-border, #e2e8f0);
  background: var(--j13-card, #fff);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.admin-badge-icon-opt:hover {
  border-color: color-mix(in srgb, var(--j13-green, #16a34a) 40%, var(--j13-border));
  color: hsl(var(--foreground));
}
.admin-badge-icon-opt.active {
  border-color: var(--j13-green, #16a34a);
  color: var(--j13-green, #16a34a);
  background: color-mix(in srgb, var(--j13-green, #16a34a) 10%, transparent);
}
.admin-badge-enable-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  min-height: 2.25rem;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .admin-badge-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-badge-field-row {
    grid-template-columns: 1fr;
  }
  .admin-badge-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-badge-search {
    max-width: none;
  }
}
.article-tool-btn--points.is-active,
.article-tool-btn--points[aria-pressed='true'] {
  color: #a16207;
}
.profile-badge-wall {
  margin: 0.75rem 0 0.25rem;
}
.profile-badge-wall-title {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

