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

/* 文档入口壳层（原 index.html 内联 style，改为外链 CSS，对齐 Gitea 式 link stylesheet） */
html { scrollbar-gutter: stable; }
html, body, #root { height: 100%; margin: 0; touch-action: pan-x pan-y; }
body { overflow: hidden; font-size: 14px; line-height: 1.5; }
.app-shell { height: 100%; max-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; touch-action: pan-x pan-y; }
.app-frame { flex: 1; min-height: 0; height: 100%; max-width: 1400px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; touch-action: pan-x pan-y; }
.app-header { height: 56px; flex-shrink: 0; }
.site-footer { flex-shrink: 0; }
.app-body { flex: 1; display: flex; min-height: 0; width: 100%; overflow: hidden; touch-action: pan-x pan-y; }
.content-workspace { flex: 1; display: flex; min-width: 0; min-height: 0; overflow: hidden; touch-action: pan-x pan-y; }
.sidebar { width: 210px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; touch-action: pan-x pan-y; }
.aside-panel { width: 280px; flex-shrink: 0; }
@media (max-width: 1100px) { .aside-panel { display: none; } }
@media (max-width: 768px) { .sidebar { display: none; } }

@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;
  /* 允许单指平移滚动，禁止 pinch / 双击放大 */
  touch-action: pan-x pan-y;
}

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;
}

/* 嵌套滚动壳会截断祖先 touch-action，需在壳上再次声明 */
.app-shell,
.app-frame,
.app-body,
.content-workspace,
.main-content,
.virtual-list-wrap,
.post-list-scroll,
.list-page-panel,
.article-editor-scroll,
.comment-rev-detail {
  touch-action: pan-x pan-y;
}

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);
}

/* 站内跳转顶栏细进度条（2px，类 Next.js / YouTube） */
.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
  background: var(--j13-green);
  box-shadow: 0 0 8px rgba(24, 160, 88, 0.55), 0 0 2px rgba(24, 160, 88, 0.9);
  transition: width 0.2s ease-out;
  border-radius: 0 1px 1px 0;
}

.top-progress--done {
  opacity: 0;
  transition: width 0.12s ease-out, opacity 0.2s ease-out 0.05s;
}

html.dark .top-progress {
  background: #36d399;
  box-shadow: 0 0 8px rgba(54, 211, 153, 0.5), 0 0 2px rgba(54, 211, 153, 0.85);
}

/* 站点页脚 */
.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;
  }
}

@media (min-width: 769px) {
  /* 桌面：只保留壳层贴底页脚，隐藏列表内流入页脚 */
  .post-list-scroll > .site-footer {
    display: none;
  }
}

.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;
}

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

.header-search-filter-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.header-search-filter-btn:hover,
.header-search-filter-btn--active {
  background: var(--j13-green-bg);
  color: var(--j13-green);
}

.header-search-filter-btn__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--j13-green);
}

.header-search-kbd {
  flex-shrink: 0;
  display: none;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  font-size: 10px;
  font-family: inherit;
  color: var(--color-text-4);
  line-height: 1.4;
}

@media (min-width: 1100px) {
  .header-search-kbd { display: inline-flex; }
}

.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);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-search-icon svg {
  width: 16px;
  height: 16px;
}

/* SSR 主题钮：随 html.dark 切换日月图标 */
.ssr-theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ssr-theme-icon--sun {
  display: none;
}
html.dark .ssr-theme-icon--moon {
  display: none;
}
html.dark .ssr-theme-icon--sun {
  display: inline-flex;
}

.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);
}

/* —— 搜索面板 —— */
.post-search-panel {
  max-width: 480px;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.post-search-panel--mobile {
  top: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  translate: none !important;
  --tw-translate-x: 0 !important;
  --tw-translate-y: 0 !important;
  max-width: none !important;
  width: 100% !important;
  max-height: min(92dvh, 640px);
  height: auto;
  margin: 0 !important;
  border-radius: 16px 16px 0 0 !important;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  animation: none !important;
  overflow: hidden;
}

.post-search-panel--mobile[data-state='open'] {
  animation: post-search-sheet-in 0.24s ease-out !important;
}

.post-search-panel--mobile[data-state='closed'] {
  animation: post-search-sheet-out 0.18s ease-in !important;
}

@keyframes post-search-sheet-in {
  from { transform: translateY(100%); opacity: 0.9; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes post-search-sheet-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0.9; }
}

.post-search-panel__handle {
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--color-fill-3);
}

@media (prefers-reduced-motion: reduce) {
  .post-search-panel--mobile[data-state='open'],
  .post-search-panel--mobile[data-state='closed'] {
    animation: none !important;
  }
}

.post-search-panel .post-search-panel__desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-3);
}

.post-search-panel > [data-radix-dialog-close] {
  top: 14px;
  right: 14px;
}

.post-search-panel__header {
  padding: 20px 24px 12px;
  text-align: left;
}

.post-search-panel--mobile .post-search-panel__header {
  padding: 8px 16px 10px;
}

.post-search-panel--mobile .post-search-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 8px;
}

.post-search-panel--mobile .post-search-panel__footer,
.post-search-panel__footer--mobile {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
}

.post-search-panel__btn {
  width: 100%;
  min-height: 44px;
}

.post-search-panel--mobile .search-scope-pills {
  display: flex;
  width: 100%;
}

.post-search-panel--mobile .search-scope-pill {
  flex: 1;
  text-align: center;
  min-height: 40px;
}

.post-search-panel__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px 8px;
}

.post-search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-search-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-search-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.post-search-field__hint {
  font-size: 11px;
  color: var(--color-text-4);
}

.post-search-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block-muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.post-search-field__icon {
  flex-shrink: 0;
  color: var(--color-text-3);
}

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

.post-search-field__input::placeholder {
  color: var(--color-text-4);
}

.search-scope-pills {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  border-radius: 10px;
  background: var(--j13-bg-block-muted);
  border: 1px solid var(--j13-border-light);
}

.search-scope-pill {
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-2);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.search-scope-pill.active {
  background: var(--j13-bg-surface);
  color: var(--j13-green);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.search-author-suggest {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
}

.search-author-suggest__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.search-author-suggest__item:hover {
  background: var(--j13-bg-block-muted);
}

.search-author-suggest__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.search-author-suggest__avatar--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--j13-green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.search-author-suggest__name {
  font-size: 13px;
  color: var(--color-text-1);
}

.search-author-suggest__user {
  font-size: 11px;
  color: var(--color-text-4);
}

.post-search-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-search-recent__item {
  border: 1px solid var(--j13-border-light);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-2);
  background: var(--j13-bg-block-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.post-search-recent__item:hover {
  border-color: color-mix(in srgb, var(--j13-green) 40%, transparent);
  color: var(--j13-green);
}

.post-search-panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--j13-border-light);
}

.post-search-panel--mobile .post-search-panel__footer {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* —— 结果页搜索筛选条 —— */
.search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 0 16px 10px;
}

.search-filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.search-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-text-2);
  background: var(--j13-bg-block-muted);
  border: 1px solid var(--j13-border-light);
}

.search-filter-chip__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-filter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.search-filter-chip__remove:hover {
  background: var(--color-fill-3);
  color: var(--color-text-1);
}

.search-filter-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-filter-bar__link {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-family: inherit;
  color: var(--j13-green);
  cursor: pointer;
}

.search-filter-bar__link:hover {
  text-decoration: underline;
}

.search-filter-bar__link--muted {
  color: var(--color-text-3);
}

/* 手机顶栏搜索入口 */
.header-search-mobile-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
  color: var(--color-text-4);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.header-search-mobile-pill--active {
  color: var(--color-text-1);
  border-color: color-mix(in srgb, var(--j13-green) 25%, transparent);
  background: var(--j13-bg-surface);
}

.header-search-mobile-pill__icon {
  flex-shrink: 0;
  color: var(--color-text-3);
}

.header-search-mobile-pill__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.header-search-mobile-pill__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--j13-green);
}

.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;
}

/* 桌面默认隐藏；手机在 max-width:768 中显示（需压过 .header-icon-btn） */
.header-icon-btn.header-menu-btn {
  display: none;
}

.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);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.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;
}

/* 三栏主滚动区统一细绿色可拖滚动条 */
.sidebar,
.post-detail-page,
.page-wrap,
.post-list-scroll,
.virtual-list-wrap,
.aside-panel,
.aside-drawer-body,
.widget-outline-body {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--j13-green) 45%, var(--j13-border)) transparent;
  -ms-overflow-style: auto;
}

.sidebar::-webkit-scrollbar,
.post-detail-page::-webkit-scrollbar,
.page-wrap::-webkit-scrollbar,
.post-list-scroll::-webkit-scrollbar,
.virtual-list-wrap::-webkit-scrollbar,
.aside-panel::-webkit-scrollbar,
.aside-drawer-body::-webkit-scrollbar,
.widget-outline-body::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.post-detail-page::-webkit-scrollbar-track,
.page-wrap::-webkit-scrollbar-track,
.post-list-scroll::-webkit-scrollbar-track,
.virtual-list-wrap::-webkit-scrollbar-track,
.aside-panel::-webkit-scrollbar-track,
.aside-drawer-body::-webkit-scrollbar-track,
.widget-outline-body::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.post-detail-page::-webkit-scrollbar-thumb,
.page-wrap::-webkit-scrollbar-thumb,
.post-list-scroll::-webkit-scrollbar-thumb,
.virtual-list-wrap::-webkit-scrollbar-thumb,
.aside-panel::-webkit-scrollbar-thumb,
.aside-drawer-body::-webkit-scrollbar-thumb,
.widget-outline-body::-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;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.post-detail-page::-webkit-scrollbar-thumb:hover,
.page-wrap::-webkit-scrollbar-thumb:hover,
.post-list-scroll::-webkit-scrollbar-thumb:hover,
.virtual-list-wrap::-webkit-scrollbar-thumb:hover,
.aside-panel::-webkit-scrollbar-thumb:hover,
.aside-drawer-body::-webkit-scrollbar-thumb:hover,
.widget-outline-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--j13-green) 65%, var(--j13-border));
  background-clip: padding-box;
  border: 2px solid transparent;
}

@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-brand { flex-shrink: 0; }
  .header-logo-text { display: none; }
  .header-icon-btn.header-menu-btn { display: flex; }
  .header-theme-btn { display: none; }
  .header-compose-btn__label { display: none; }
  .header-search-wrap { max-width: none; }
  .header-compose-btn { width: 34px; padding: 0; justify-content: center; }
  .header-action-group { gap: 4px; }

  /* 手机：藏壳层贴底页脚（列表内 InFlow 负责） */
  .app-frame > .site-footer { display: none; }

  .post-search-field__input {
    font-size: 16px;
  }

  .search-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 12px 8px;
  }

  .search-filter-bar__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .search-filter-bar__chips::-webkit-scrollbar {
    display: none;
  }

  .search-filter-chip {
    flex-shrink: 0;
    max-width: none;
  }

  .search-filter-bar__actions {
    justify-content: flex-end;
    gap: 12px;
  }

  .feed-head {
    padding: 8px 12px 6px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .feed-head__title {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .feed-head h1,
  .feed-head h2 {
    white-space: normal;
  }

  .empty-feed-actions {
    flex-wrap: wrap;
    padding: 0 8px;
  }

  .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;
  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;
}

.virtual-list-wrap,
.post-list-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* 文档 SSR：静态列表（非 virtualizer absolute 行） */
.content-surface--ssr {
  position: relative;
  display: flex;
  flex-direction: column;
}
a.post-row {
  text-decoration: none;
  color: inherit;
  display: flex;
}
.feed-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--color-text-3);
  font-size: 14px;
}
.ssr-home .feed-header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-1);
}

.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; }

/* 列表类独立页：与首页 feed-panel 同卡同留白 */
.list-page-panel {
  overflow: auto;
}

.list-page-panel__head {
  flex-shrink: 0;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block);
}

.list-page-panel__back {
  margin: 0 0 6px -6px;
}

.list-page-panel__head .page-title {
  margin: 0 0 4px;
}

.list-page-panel__head .page-desc {
  margin: 0;
}

.list-page-panel__head .links-page-head {
  margin-bottom: 0;
}

.list-page-panel__head .links-page-head .page-desc {
  margin: 0;
}

.list-page-panel__empty {
  margin: 32px 16px;
}

.list-page-panel .links-page-board {
  margin: 16px;
  border-radius: 10px;
}

.list-page-panel .links-page-my {
  padding: 16px 16px 8px;
  margin-top: 0;
  border-top: none;
}

.list-page-panel .links-page-my--compact {
  padding-bottom: 4px;
}

.list-page-panel .links-page-login-hint {
  padding: 0 16px 20px;
}

.list-page-panel .projects-pager {
  padding: 12px 16px 16px;
}
.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__meta--count {
  font-size: 12px;
  color: var(--color-text-3);
}

.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 样式保持一致；flex:1 把「共 N 条」推到工具栏右缘 */
.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;
  text-decoration: none;
  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;
}

.feed-sort-tab.is-pending {
  color: var(--j13-green);
}

.feed-sort-tab__spin {
  animation: ptr-spin 0.7s linear infinite;
}

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

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

  .feed-toolbar {
    padding: 10px 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-row--compact {
  padding: 10px 20px;
  gap: 10px;
}

.post-row--compact .post-body {
  gap: 4px;
}

.post-row--compact .post-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
  margin-top: 0;
}

.post-row--has-thumb {
  align-items: center;
}

/* v2 紧凑列表布局 */
.post-row--v2 {
  padding: 8px 16px;
  gap: 8px;
  align-items: flex-start;
}

/* 仅标题模式：略增行距，避免帖子贴得过紧 */
.post-row--v2.post-row--title-only {
  padding: 12px 16px;
}

.post-row--v2.post-row--title-only .post-main {
  gap: 4px;
}

.post-row--v2 .post-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
  margin-top: 1px;
}

.post-row--v2.post-row--has-thumb {
  align-items: flex-start;
}

.post-row--v2 .post-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.post-row--v2 .post-main--with-thumb {
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.post-row--v2 .post-main--with-thumb .post-content {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row--v2 .post-main--with-thumb .post-aside {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: max-content;
}

.post-row--v2 .post-main--with-thumb .post-thumb {
  width: 64px;
  flex: 0 0 64px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 4px;
  overflow: hidden;
  background: var(--j13-bg-block-accent, #f1f5f9);
}

.post-row--v2 .post-main--with-thumb .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-row--v2 .post-main--with-thumb .post-stats {
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: max-content;
  align-self: flex-end;
}

.post-row--v2 .post-main--with-thumb .post-stat {
  flex-shrink: 0;
  white-space: nowrap;
}

.post-row--v2 .post-main--with-thumb .post-stat svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.post-row--v2 .post-main--with-thumb .post-meta--inline {
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
}

.post-row--v2 .post-main--with-thumb .post-meta-left {
  min-width: 0;
  overflow: hidden;
}

.post-row--v2 .post-meta--inline {
  justify-content: flex-start;
}

.post-row--v2 .post-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row--v2 .post-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-row--v2 .post-title {
  font-size: 15px;
  font-weight: 400;
  /* 与侧栏类型徽章 height:20px 对齐，避免 SSR（span 标题）视觉偏高/偏低 */
  line-height: 20px;
}

/* 标题右侧类型徽章：统一盒高与文字居中（投票等原先仅靠 padding，易与问答徽章不齐） */
.post-row--v2 .post-title-type-badges {
  display: inline-flex;
  align-items: center;
  align-self: center;
  line-height: 1;
}

.post-row--v2 .post-title-type-badges .post-type-badge,
.post-row--v2 .post-title-type-badges .post-qa-badge,
.post-row--v2 .post-title-type-badges .post-bounty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 20px;
  padding: 0 7px;
  margin-right: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.post-row--v2 .post-excerpt {
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-4);
}

.post-row--v2 .post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  color: var(--color-text-4);
}

.post-row--v2 .post-meta-left {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.post-row--v2 .post-meta-author {
  color: var(--color-text-3);
  font-weight: 400;
  flex-shrink: 0;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.post-row--v2 .post-meta-sep {
  margin: 0 4px;
  color: var(--color-text-4);
  flex-shrink: 0;
}

.post-row--v2 .post-meta-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.post-row--v2 .post-meta-last-reply {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  margin-left: 6px;
  gap: 4px;
  color: var(--color-text-4);
  overflow: hidden;
}

.post-row--v2 .post-meta-last-reply-arrow {
  flex-shrink: 0;
  opacity: 0.75;
}

.post-row--v2 .post-meta-last-reply-user {
  flex-shrink: 1;
  min-width: 0;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-3);
  font-weight: 400;
}

.post-row--v2 a.post-meta-last-reply-user:hover {
  color: var(--j13-green);
}

.post-row--v2 .post-meta-last-reply-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* 手机端 meta 精简：作者、回复人、一个时间（有回复则用回复时间） */
@media (max-width: 768px) {
  .post-row--v2 .post-list-board-btn {
    display: none;
  }

  .post-row--v2 .post-meta-left:has(.post-meta-last-reply) .post-meta-sep--before-time,
  .post-row--v2 .post-meta-left:has(.post-meta-last-reply) .post-meta-time--created {
    display: none;
  }

  .post-row--v2 .post-meta-author {
    max-width: 4.5rem;
  }

  .post-row--v2 .post-meta-last-reply-user {
    max-width: 4.5rem;
  }
}

/* 列表内板块色标（meta 行、用户名之前；颜色淡化） */
.post-row--v2 .post-list-board-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 5rem;
  padding: 0;
  margin: 0 6px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.post-row--v2 .post-list-board-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-row--v2 .post-list-board-badge.board-badge--0 {
  color: color-mix(in srgb, var(--board-0-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-0-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--1 {
  color: color-mix(in srgb, var(--board-1-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-1-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--2 {
  color: color-mix(in srgb, var(--board-2-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-2-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--3 {
  color: color-mix(in srgb, var(--board-3-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-3-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--4 {
  color: color-mix(in srgb, var(--board-4-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-4-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--5 {
  color: color-mix(in srgb, var(--board-5-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-5-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--6 {
  color: color-mix(in srgb, var(--board-6-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-6-color) 9%, transparent);
}
.post-row--v2 .post-list-board-badge.board-badge--7 {
  color: color-mix(in srgb, var(--board-7-color) 52%, var(--color-text-3, #64748b));
  background: color-mix(in srgb, var(--board-7-color) 9%, transparent);
}

.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--0 {
  color: color-mix(in srgb, var(--board-0-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-0-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--1 {
  color: color-mix(in srgb, var(--board-1-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-1-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--2 {
  color: color-mix(in srgb, var(--board-2-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-2-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--3 {
  color: color-mix(in srgb, var(--board-3-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-3-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--4 {
  color: color-mix(in srgb, var(--board-4-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-4-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--5 {
  color: color-mix(in srgb, var(--board-5-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-5-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--6 {
  color: color-mix(in srgb, var(--board-6-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-6-color) 14%, transparent);
}
.post-row--v2 .post-list-board-btn:hover .post-list-board-badge.board-badge--7 {
  color: color-mix(in srgb, var(--board-7-color) 72%, var(--color-text-2, #475569));
  background: color-mix(in srgb, var(--board-7-color) 14%, transparent);
}

.post-row--v2 .post-list-tag {
  padding: 0;
  margin-left: 6px;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-4);
  font-size: 12px;
  max-width: 5rem;
  flex-shrink: 1;
}

.post-row--v2 .post-list-tag:hover {
  background: transparent;
  color: var(--j13-green);
}

.post-row--v2 .post-stats {
  gap: 8px;
  flex-shrink: 0;
  margin-left: 0;
}

.post-row--v2 .post-stat {
  font-size: 11px;
  gap: 2px;
}

.post-row--v2 .post-stat svg {
  width: 12px;
  height: 12px;
}

.post-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--j13-bg-block-accent, #f1f5f9);
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.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: var(--j13-green);
  background: var(--j13-green-bg);
  border: 1px solid color-mix(in srgb, var(--j13-green) 28%, transparent);
}

.dark .post-feature-badge {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 35%, transparent);
}

.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,
.post-title-row .post-bounty-badge,
.post-title-row .post-type-badge--poll,
.post-title-row .post-type-badge--lottery {
  flex-shrink: 0;
}

/* 类型徽章缀在标题后：不参与收缩，标题在剩余宽度内 ellipsis */
.post-title-type-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  max-width: none;
}

.post-title-type-badges .post-type-badge,
.post-title-type-badges .post-qa-badge,
.post-title-type-badges .post-bounty-badge {
  margin-right: 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: 0 1 auto;
}

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: var(--j13-green);
  stroke-width: 1.75;
}

.dark .post-featured-icon {
  color: var(--j13-green);
}

.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--avatar-v2 {
  width: 36px;
  height: 36px;
  margin-top: 1px;
}

.skeleton--title-v2 {
  height: 14px;
}

.skeleton--board-badge {
  width: 2.5rem;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.post-meta-left--skeleton {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.post-meta-left--skeleton .skeleton--meta-line {
  flex: 1;
  max-width: none;
}

.skeleton--excerpt-v2 {
  height: 12px;
}

.skeleton--meta-line {
  height: 12px;
  flex: 1;
  min-width: 0;
  max-width: 55%;
}

.skeleton--thumb {
  width: 64px;
  height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton--thumb-tall {
  height: auto;
  align-self: stretch;
  min-height: 52px;
}

.post-row--v2.post-row--skeleton .post-main--with-thumb {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.post-row--v2.post-row--skeleton .post-main--with-thumb .post-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row--v2.post-row--skeleton .post-main--with-thumb .post-aside {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.post-row--v2.post-row--skeleton .post-main--with-thumb .post-stats {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
}

.post-row--v2.post-row--skeleton .post-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row--v2.post-row--skeleton .post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.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-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  max-width: 420px;
  padding: 0 12px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}
.projects-search__icon {
  flex-shrink: 0;
  color: var(--color-text-4);
}
.projects-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--color-text);
}
.projects-search__input::placeholder {
  color: var(--color-text-4);
}

/* 码桶行复用帖子列表结构，仅补充语言徽标与徽章间距 */
.projects-list .project-list-item .post-excerpt {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.projects-list .project-list-item .post-meta-left {
  flex-wrap: wrap;
  gap: 4px 6px;
  overflow: visible;
}
.projects-list .project-list-item .post-meta-author {
  max-width: none;
}
.project-lang-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-2);
  background: color-mix(in srgb, var(--color-border) 45%, transparent);
}
.project-list-badges {
  margin-left: 2px;
}
.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);
}

.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;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

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

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

.post-manage-menu-trigger {
  flex-shrink: 0;
  gap: 4px;
  color: var(--color-text-2);
}

.post-manage-menu {
  max-height: 70vh;
  overflow-y: auto;
  min-width: 11.5rem;
}

.post-manage-menu-hint {
  font-weight: 400 !important;
  font-size: 12px !important;
  color: var(--color-text-3) !important;
  white-space: normal;
  line-height: 1.4;
}

.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-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 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.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);
}

/* 评论管理菜单（编辑 / 审核 / 删除 / 举报） */
.comment-manage-menu {
  min-width: 9.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.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;
}

.article-editor-tools .article-tool-btn--points {
  color: #b45309;
}

.article-editor-tools .article-tool-btn--points:hover,
.article-editor-tools .article-tool-btn--points.active {
  background: rgba(180, 83, 9, 0.1);
  color: #92400e;
}

.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:not([src*="/stickers/"]) {
  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,
.site-page__body img.post-content-img--zoomable,
.post-body 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,
.site-page__body img.post-content-img--zoomable:hover,
.post-body 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,
.site-page__body img.post-content-img--zoomable:focus-visible,
.post-body 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;
  /* 由组件接管 pinch / pan，禁止浏览器默认手势 */
  touch-action: none;
  overflow: visible;
}

.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;
  -webkit-user-drag: none;
  touch-action: none;
  transform-origin: center center;
  will-change: transform;
}

.image-lightbox-img--settling {
  transition: transform 0.18s ease-out;
}

.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;
}

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

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

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

  .image-lightbox-hint--mobile {
    display: block;
  }
}

.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-expanded-slot.is-collapsed {
  display: none;
}

.comment-composer-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--j13-border-light);
  border-radius: 999px;
  background: var(--j13-bg-workspace, hsl(var(--muted)));
  color: var(--color-text-3);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.comment-composer-collapsed:hover {
  border-color: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border-light));
  background: var(--j13-bg-surface);
}

.comment-composer-collapsed-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--j13-green) 18%, transparent);
  color: var(--j13-green);
  font-size: 12px;
  font-weight: 600;
}

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

.comment-composer-collapsed-placeholder {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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: var(--j13-green);
}

.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 {
  margin-left: auto;
  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;
  flex-shrink: 0;
}

.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);
}

/* 贴纸选择器 */
.sticker-picker {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border: 1px solid var(--j13-border-light);
  border-radius: 8px;
  background: var(--j13-bg-surface);
  max-height: 280px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  z-index: 30;
}

.sticker-picker-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--j13-border-light);
  padding: 0 8px;
}

.sticker-picker-tab {
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.sticker-picker-tab:hover { color: var(--color-text-1); }

.sticker-picker-tab.active {
  color: var(--j13-green);
  border-bottom-color: var(--j13-green);
}

.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sticker-picker-item {
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.1s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-picker-item:hover {
  background: var(--color-fill-2);
  transform: scale(1.15);
}

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

.sticker-picker-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--color-text-4);
  font-size: 13px;
}

/* 评论富文本编辑器（精简 Tiptap，复用 .article-editor-* 类） */
.comment-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.comment-editor .article-editor-bar {
  padding: 4px 8px;
  gap: 6px;
  background: transparent;
  border-bottom: 1px solid var(--j13-border-light);
  box-shadow: none;
}

.comment-editor .article-editor-tools { gap: 1px; flex-wrap: nowrap; }

.comment-editor .article-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  padding: 0;
}

.comment-editor .article-tool-btn--owo {
  width: auto;
  min-width: 28px;
  padding: 0 8px;
}

/* OwO 文本按钮：与 SVG 图标视觉对齐，fill button area for consistent focus ring */
.article-tool-btn__owo {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-editor .article-editor-body {
  background: transparent;
}

.comment-editor .article-editor-scroll {
  max-height: 320px;
}

.comment-editor .article-editor-content .tiptap,
.comment-editor .article-prosemirror {
  min-height: 80px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
}

/* 评论正文中的贴纸 img */
.floor-body img[src*="/stickers/"],
.comment-body img[src*="/stickers/"] {
  display: inline-block !important;
  vertical-align: middle;
  width: 28px;
  height: 28px;
  max-width: 28px;
  margin: 0 1px !important;
  background: transparent;
  border-radius: 4px;
  box-shadow: none !important;
  object-fit: contain;
  clear: none !important;
}

/* 编辑器内贴纸 img 尺寸约束 */
.comment-editor .article-prosemirror img[src*="/stickers/"],
.comment-editor .article-editor-content img[src*="/stickers/"] {
  display: inline-block !important;
  width: 28px;
  height: 28px;
  max-width: 28px;
  vertical-align: middle;
  margin: 0 1px !important;
  border-radius: 4px;
  box-shadow: none !important;
  object-fit: contain;
  clear: none !important;
}

/* 选择器中颜文字纯文本样式 */
.sticker-picker-text {
  display: inline-block;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.4;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Sans Mono', monospace;
  color: var(--color-text-1);
  word-break: break-all;
  text-align: center;
  padding: 2px;
}

/* 移动端：贴纸选择器 4 列 */
@media (max-width: 640px) {
  .sticker-picker { max-height: 240px; }
  .sticker-picker-grid { grid-template-columns: repeat(4, 1fr); }
  .sticker-picker-tab { padding: 6px 10px; font-size: 12px; }
  .comment-editor .article-tool-btn { width: 30px; height: 30px; }
  .comment-editor .article-tool-btn--owo { width: auto; min-width: 30px; padding: 0 8px; }
  .comment-editor .article-editor-tools { flex-wrap: wrap; }
  .comment-editor .article-editor-bar { padding: 4px 6px; }
}

/* 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;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-block);
  transition: border-color 0.2s, background 0.2s;
}

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

/* 覆盖 ProseMirror 默认黑色 outline */
.comment-editor .article-prosemirror,
.comment-editor .ProseMirror {
  outline: none !important;
}

.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 { 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;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.widget-card-icon svg {
  width: 15px;
  height: 15px;
}

.widget-card-icon--hot { color: #e74c3c; }
.widget-card-icon--notice { color: #3498db; }
.widget-card-icon--links { color: #2d6a4f; }
.widget-card-icon--showcase { color: #1d4ed8; }
.widget-card-icon--users { color: #8b5cf6; }

.widget-card-head--split {
  justify-content: space-between;
  gap: 8px;
}

.widget-card-head-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.widget-friend-links-apply {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-2);
  text-decoration: none;
}

.widget-friend-links-title {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.widget-friend-links-title:hover {
  color: var(--j13-green);
}

.widget-friend-links-more {
  margin-top: 6px;
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--j13-green);
  cursor: pointer;
}
.widget-friend-links-more:hover {
  text-decoration: underline;
}

.widget-card-body--friend-links {
  padding-top: 8px;
}

.widget-friend-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.widget-friend-links-list li {
  max-width: 100%;
}

.widget-friend-links-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--j13-border-light);
  border-radius: 4px;
  background: var(--j13-bg-block-muted);
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.widget-friend-links-list a:hover {
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border-light));
  background: var(--j13-green-soft);
  color: var(--j13-green);
  text-decoration: none;
}

.friend-link-site-info {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--j13-bg-block-muted, #f8fafc);
  border: 1px solid var(--j13-border-light, #e5e7eb);
}
.friend-link-site-info__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground, #1f2937);
}
.friend-link-site-info__list {
  margin: 0;
  display: grid;
  gap: 6px;
}
.friend-link-site-info__item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.5;
}
.friend-link-site-info__item dt {
  margin: 0;
  color: var(--muted-fg, #64748b);
  font-weight: 500;
}
.friend-link-site-info__item dd {
  margin: 0;
  min-width: 0;
  word-break: break-all;
  color: var(--foreground, #334155);
  user-select: text;
}

.friend-link-apply-dialog {
  gap: 16px;
  padding: 0;
  overflow: hidden;
}
.friend-link-apply-dialog > button.absolute {
  top: 14px;
  right: 14px;
}
.friend-link-apply-dialog__header {
  position: relative;
  padding: 16px 20px 0;
  margin: 0;
  text-align: left;
}
.friend-link-apply-dialog__header h2 {
  font-size: 17px;
  font-weight: 600;
}

.friend-link-apply-dialog .friend-link-site-info {
  margin: 0 20px;
}
.friend-link-apply-form {
  display: grid;
  gap: 14px;
  padding: 0 20px;
}
.friend-link-apply-field {
  display: grid;
  gap: 6px;
}
.friend-link-apply-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground, #334155);
}
.friend-link-apply-field input {
  height: 38px;
  border-radius: 8px;
  font-size: 13px;
}
/* 聚焦：仅细边框，去掉绿色 ring，降低干扰 */
.friend-link-apply-dialog .friend-link-apply-field input:focus,
.friend-link-apply-dialog .friend-link-apply-field input:focus-visible {
  outline: none;
  box-shadow: none;
  --tw-ring-shadow: 0 0 #0000;
  --tw-ring-offset-shadow: 0 0 #0000;
  border-color: color-mix(in srgb, var(--j13-green) 55%, var(--j13-border, #cbd5e1));
}
.friend-link-apply-field__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-fg, #64748b);
}
.friend-link-apply-placement {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.friend-link-apply-placement__option {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--j13-border-light, #e5e7eb);
  border-radius: 8px;
  background: var(--j13-bg-surface, #fff);
  font-size: 13px;
  font-weight: 400;
  color: var(--foreground, #334155);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.friend-link-apply-placement__option:hover {
  border-color: var(--j13-border, #cbd5e1);
  background: var(--j13-bg-block-muted, #f8fafc);
}
.friend-link-apply-placement__option--active {
  border-color: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border, #cbd5e1));
  background: var(--j13-bg-block-muted, #f8fafc);
  color: var(--foreground, #1f2937);
  font-weight: 400;
}
.friend-link-apply-placement__custom {
  border: 1px solid var(--j13-border-light, #e5e7eb);
  border-radius: 8px;
  background: var(--j13-bg-surface, #fff);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.friend-link-apply-placement__custom .friend-link-apply-placement__option {
  border: none;
  border-radius: 0;
  background: transparent;
}
.friend-link-apply-placement__custom .friend-link-apply-placement__option:hover,
.friend-link-apply-placement__custom .friend-link-apply-placement__option--active {
  background: transparent;
}
.friend-link-apply-placement__custom--open {
  border-color: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border, #cbd5e1));
  background: var(--j13-bg-block-muted, #f8fafc);
}
.friend-link-apply-placement__custom-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.friend-link-apply-placement__custom--open .friend-link-apply-placement__custom-panel {
  grid-template-rows: 1fr;
}
.friend-link-apply-placement__custom-inner {
  overflow: hidden;
  min-height: 0;
  display: grid;
  gap: 6px;
  padding: 0 12px;
  opacity: 0;
  transition: opacity 0.18s ease, padding 0.22s ease;
}
.friend-link-apply-placement__custom--open .friend-link-apply-placement__custom-inner {
  padding: 0 12px 12px;
  opacity: 1;
}
.friend-link-apply-placement__custom-inner label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-fg, #64748b);
}

.friend-link-apply-logo-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.friend-link-apply-logo-preview {
  flex-shrink: 0;
  width: 72px;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px dashed var(--border, #cbd5e1);
  background: var(--background, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-fg, #94a3b8);
  font-size: 12px;
}
.friend-link-apply-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.friend-link-apply-logo-input {
  flex: 1;
  min-width: 0;
}
.friend-link-apply-logo-upload {
  flex-shrink: 0;
  height: 38px;
  gap: 4px;
  padding-left: 12px;
  padding-right: 12px;
}

.friend-link-apply-dialog__footer {
  flex-direction: column;
  gap: 12px;
  padding: 4px 20px 20px;
  margin: 0;
}
@media (min-width: 640px) {
  .friend-link-apply-dialog__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.friend-link-apply-dialog__note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted-fg, #64748b);
}
.friend-link-apply-dialog__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}
@media (min-width: 640px) {
  .friend-link-apply-dialog__actions {
    width: auto;
  }
}

.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;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  padding: 20px 16px;
}

.widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--j13-border-light);
}

.widget-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.widget-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--j13-green);
  line-height: 1.2;
}

.widget-stat-label {
  font-size: 11px;
  color: var(--color-text-4);
  line-height: 1.3;
}

.widget-checkin {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--j13-border-light);
}

.widget-checkin-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
}

.widget-checkin-panel--guest {
  background: var(--j13-bg-block-muted);
  border-color: var(--j13-border-light);
}

.widget-checkin-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.widget-checkin-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--color-text-3);
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
}

.widget-checkin-panel--done .widget-checkin-icon {
  color: var(--j13-green);
  background: var(--j13-bg-block);
  border-color: var(--j13-border-light);
  box-shadow: none;
}

.widget-checkin-panel--guest .widget-checkin-icon {
  color: var(--color-text-3);
  background: var(--j13-bg-block);
  border-color: var(--j13-border-light);
}

.widget-checkin-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.widget-checkin-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  line-height: 1.35;
}

.widget-checkin-meta {
  font-size: 11px;
  color: var(--color-text-4);
  line-height: 1.45;
}

.widget-checkin-reward {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-3);
  font-variant-numeric: tabular-nums;
}

.widget-checkin-reward::before {
  content: '+';
  color: var(--j13-green);
  opacity: 0.85;
}

.widget-checkin-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--j13-border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-2);
  background: var(--j13-bg-block);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.widget-checkin-action:hover:not(:disabled) {
  color: var(--j13-green);
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border));
  background: var(--j13-green-bg);
}

.widget-checkin-action:active:not(:disabled) {
  background: color-mix(in srgb, var(--j13-green) 6%, var(--j13-bg-block));
}

.widget-checkin-action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.widget-checkin-panel--guest .widget-checkin-action {
  color: var(--color-text-2);
  background: var(--j13-bg-block);
  border-color: var(--j13-border);
}

.widget-checkin-panel--guest .widget-checkin-action:hover {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border));
}

.widget-checkin-action-spinner {
  color: var(--j13-green);
}

.widget-checkin-skeleton {
  height: 76px;
  width: 100%;
  border-radius: 10px;
}

.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;
}

/* 占位头像链接：避免 .user-link inherit 盖掉绿底白字 */
a.user-link.user-link--avatar-only {
  color: #fff;
}

a.user-link.user-link--avatar-only:hover,
a.user-link.user-link--avatar-only:focus-visible {
  color: #fff;
  outline: 2px solid color-mix(in srgb, var(--j13-green) 45%, transparent);
  outline-offset: 2px;
}

.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 {
  flex: none;
  display: block;
  max-width: 100%;
  min-width: 0;
  color: var(--color-text-2);
  transition: color 0.12s;
}

.widget-item-comment-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.widget-item--comment .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);
  min-width: 0;
}

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

.skeleton--widget-meta {
  width: 55%;
  height: 10px;
  flex-shrink: 0;
}

.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;
}

/* 最新注册：4 列网格，头像在上、昵称在下 */
.widget-card-body--users {
  padding-top: 8px;
}

.widget-recent-users-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 6px;
}

.widget-recent-user-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

a.widget-recent-user-cell:hover,
a.widget-recent-user-cell:focus-visible {
  background: var(--j13-bg-block-accent);
  text-decoration: none;
  color: inherit;
}

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

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

.widget-recent-user-name {
  width: 100%;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: var(--color-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.widget-recent-user-cell:hover .widget-recent-user-name,
a.widget-recent-user-cell:focus-visible .widget-recent-user-name {
  color: var(--j13-green);
}

.widget-recent-user-cell--skeleton {
  pointer-events: none;
}

.skeleton--recent-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton--recent-user-name {
  height: 11px;
  width: 70%;
  border-radius: 4px;
}

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;
  /* 放行 pinch，供 react-easy-crop 缩放 */
  touch-action: auto;
}

.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-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 28px;
  border-top: 1px solid var(--j13-border-light);
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
  flex-shrink: 0;
}

.compose-context-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: none;
}

.compose-context-row:last-child {
  border-bottom: none;
}

.compose-context-label {
  flex-shrink: 0;
  width: auto;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-3);
  letter-spacing: 0.02em;
}

.compose-context-row--tags .compose-context-label {
  margin: 0;
}

.compose-context-row--tags .compose-tags-field {
  flex: 0 1 280px;
  min-width: 160px;
}

.compose-board-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* 类型：连体分段控件（二选一） */
.compose-type-pills {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  background: var(--j13-bg-block-muted);
}

.compose-type-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

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

.compose-type-pill {
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.compose-type-pill:hover:not(.active) {
  color: var(--color-text-1);
}

.compose-type-pill.active {
  background: var(--j13-green);
  color: #fff;
  font-weight: 600;
}

.compose-type-pill:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.compose-type-pill.active:disabled {
  opacity: 1;
}

/* 板块：带图标的选择芯片 */
.compose-board-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--j13-border);
  border-radius: 999px;
  background: var(--j13-bg-surface);
  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-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.compose-board-pill:hover {
  border-color: var(--j13-green);
  color: var(--j13-green);
}

.compose-board-pill:hover .compose-board-icon {
  opacity: 1;
}

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

.compose-board-pill.active .compose-board-icon {
  opacity: 1;
}

/* 板块主题色 —— 图标颜色 */
.compose-board-pill--0 .compose-board-icon { color: var(--board-0-color); }
.compose-board-pill--1 .compose-board-icon { color: var(--board-1-color); }
.compose-board-pill--2 .compose-board-icon { color: var(--board-2-color); }
.compose-board-pill--3 .compose-board-icon { color: var(--board-3-color); }
.compose-board-pill--4 .compose-board-icon { color: var(--board-4-color); }
.compose-board-pill--5 .compose-board-icon { color: var(--board-5-color); }
.compose-board-pill--6 .compose-board-icon { color: var(--board-6-color); }
.compose-board-pill--7 .compose-board-icon { color: var(--board-7-color); }

/* 选中态：主题色背景 + 主题色图标 */
.compose-board-pill.active.compose-board-pill--0 { background: var(--board-0-bg); border-color: var(--board-0-color); color: var(--board-0-color); }
.compose-board-pill.active.compose-board-pill--1 { background: var(--board-1-bg); border-color: var(--board-1-color); color: var(--board-1-color); }
.compose-board-pill.active.compose-board-pill--2 { background: var(--board-2-bg); border-color: var(--board-2-color); color: var(--board-2-color); }
.compose-board-pill.active.compose-board-pill--3 { background: var(--board-3-bg); border-color: var(--board-3-color); color: var(--board-3-color); }
.compose-board-pill.active.compose-board-pill--4 { background: var(--board-4-bg); border-color: var(--board-4-color); color: var(--board-4-color); }
.compose-board-pill.active.compose-board-pill--5 { background: var(--board-5-bg); border-color: var(--board-5-color); color: var(--board-5-color); }
.compose-board-pill.active.compose-board-pill--6 { background: var(--board-6-bg); border-color: var(--board-6-color); color: var(--board-6-color); }
.compose-board-pill.active.compose-board-pill--7 { background: var(--board-7-bg); border-color: var(--board-7-color); color: var(--board-7-color); }

.compose-board-pill.active.compose-board-pill--0 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--1 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--2 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--3 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--4 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--5 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--6 .compose-board-icon,
.compose-board-pill.active.compose-board-pill--7 .compose-board-icon {
  color: inherit;
  opacity: 1;
}

/* hover 态：主题色图标 */
.compose-board-pill:hover.compose-board-pill--0 .compose-board-icon { color: var(--board-0-color); }
.compose-board-pill:hover.compose-board-pill--1 .compose-board-icon { color: var(--board-1-color); }
.compose-board-pill:hover.compose-board-pill--2 .compose-board-icon { color: var(--board-2-color); }
.compose-board-pill:hover.compose-board-pill--3 .compose-board-icon { color: var(--board-3-color); }
.compose-board-pill:hover.compose-board-pill--4 .compose-board-icon { color: var(--board-4-color); }
.compose-board-pill:hover.compose-board-pill--5 .compose-board-icon { color: var(--board-5-color); }
.compose-board-pill:hover.compose-board-pill--6 .compose-board-icon { color: var(--board-6-color); }
.compose-board-pill:hover.compose-board-pill--7 .compose-board-icon { color: var(--board-7-color); }

.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;
  background: var(--j13-bg-surface);
}

.compose-title {
  width: 100%;
  margin: 0;
  padding: 28px 28px 14px;
  border: none;
  background: transparent;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-text-1);
  outline: none;
  flex-shrink: 0;
}

.compose-title::placeholder {
  color: var(--color-text-4);
  font-weight: 600;
}

.compose-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-3);
}

.compose-subtitle strong {
  color: var(--j13-green);
  font-weight: 500;
}

/* ===== 发帖页移动端适配 ===== */
@media (max-width: 640px) {
  .compose-page {
    --compose-header-sticky-h: 52px;
  }

  .compose-canvas {
    padding: 8px 0;
    max-width: 100%;
  }

  .compose-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .compose-shell-body {
    border-radius: 0;
  }

  .compose-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .compose-header-left {
    gap: 8px;
    min-width: 0;
  }

  .compose-header-title {
    font-size: 14px;
  }

  .compose-back span {
    display: none;
  }

  .compose-back {
    padding: 6px;
    border-radius: 8px;
  }

  .compose-draft-hint,
  .compose-edit-window {
    display: none;
  }

  .compose-publish-btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .compose-publish-btn span {
    display: none;
  }

  .compose-context {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--j13-border-light);
    border-bottom: 1px solid var(--j13-border-light);
    background: var(--j13-bg-surface);
  }

  .compose-context-row {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .compose-context-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-2);
    letter-spacing: 0;
  }

  .compose-type-pills {
    align-self: flex-start;
  }

  .compose-type-field {
    flex-wrap: nowrap;
    align-items: center;
  }

  .compose-type-hint {
    font-size: 11px;
    color: var(--color-text-4);
    white-space: nowrap;
  }

  .compose-board-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .compose-board-pills::-webkit-scrollbar {
    display: none;
  }

  .compose-board-pill {
    flex-shrink: 0;
  }

  .compose-context-row--tags .compose-tags-field {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .compose-title {
    padding: 20px 16px 12px;
    font-size: 20px;
    font-weight: 700;
  }

  .compose-tags-field {
    padding: 6px 10px;
  }

  .article-editor-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: 6px 10px;
    gap: 6px;
    background: var(--j13-bg-surface);
    border-bottom: 1px solid var(--j13-border-light);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  }

  /* —— 移动端：解除上层 overflow:hidden 以支持 sticky —— */
  .compose-page {
    overflow: visible !important;
  }

  .compose-canvas {
    overflow: visible !important;
  }

  .compose-shell {
    overflow: visible !important;
  }

  .compose-shell-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .compose-document {
    overflow: visible !important;
    flex: 1 0 auto;
    min-height: 100%;
  }

  .article-editor {
    overflow: visible !important;
    flex: 1 0 auto;
    min-height: 300px;
  }

  .article-editor-body {
    overflow: visible !important;
  }

  .article-editor-scroll {
    overflow: visible !important;
    flex: none;
  }

  .article-editor-content .tiptap,
  .article-prosemirror {
    min-height: 200px;
    flex: none;
  }
}

/* 文章编辑器 */
.article-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  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:focus-visible {
  outline: 2px solid var(--j13-green);
  outline-offset: 1px;
}

.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;
  cursor: text;
}

.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 {
  position: relative;
  top: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 6px 8px;
  z-index: auto;
  box-shadow: none;
  overflow: visible;
}

.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: none;
  margin: 0;
}

.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 {
  width: min(520px, 92vw);
  max-width: min(520px, 92vw);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}
.article-link-dialog__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 16px;
}
.article-link-dialog__section + .article-link-dialog__section {
  border-top: 1px solid var(--j13-border-light);
  padding-top: 16px;
}
.article-link-dialog__section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}
.article-link-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.article-link-dialog__field label {
  font-size: 12px;
  color: var(--color-text-2);
}
.article-link-dialog__advanced {
  padding-bottom: 8px;
}
.article-link-dialog__advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
  cursor: pointer;
  user-select: none;
}
.article-link-dialog__advanced-toggle:hover {
  color: var(--color-text-1);
}
.article-link-dialog__advanced-chevron {
  transition: transform 0.15s ease;
}
.article-link-dialog__advanced-toggle.is-open .article-link-dialog__advanced-chevron {
  transform: rotate(180deg);
}
.article-link-dialog__advanced-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.article-link-dialog__hits {
  position: relative;
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  background: var(--j13-bg-block-muted, var(--color-fill-3));
  overflow: hidden;
}
.article-link-dialog__hits-hint {
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 12px;
  color: var(--color-text-3);
}
.article-link-dialog__hit-list {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  max-height: 220px;
  overflow-y: auto;
}
.article-link-dialog__hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--color-text-1);
  transition: background 0.12s;
}
.article-link-dialog__hit:hover {
  background: var(--j13-bg-surface, #fff);
}
.article-link-dialog__hit.is-selected {
  background: var(--j13-green-bg);
}
.article-link-dialog__hit-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-link-dialog__hit-kind {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-3);
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--j13-border) 55%, transparent);
}
.article-link-dialog__hits-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  font-size: 13px;
  color: var(--color-text-3);
}
.article-link-dialog__hits-loading {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--color-text-3);
}
.article-link-dialog__spin {
  animation: article-link-dialog-spin 0.8s linear infinite;
}
@keyframes article-link-dialog-spin {
  to { transform: rotate(360deg); }
}
.article-link-dialog__footer {
  gap: 8px;
  margin-top: 4px;
}
.article-link-dialog__remove {
  margin-right: auto;
}

.article-image-picker {
  width: min(520px, 92vw);
  max-width: min(520px, 92vw);
}
.article-image-picker__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 4px 0 12px;
  padding: 4px;
  border: 1px solid var(--j13-border);
  border-radius: 10px;
  background: var(--j13-bg-block-muted, var(--color-fill-3));
}
.article-image-picker__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.article-image-picker__tab:hover:not(:disabled) {
  background: var(--j13-bg-surface, #fff);
  border-color: color-mix(in srgb, var(--j13-green) 22%, var(--j13-border));
  color: var(--color-text-1);
}
.article-image-picker__tab.is-active {
  background: var(--j13-bg-surface, #fff);
  border-color: color-mix(in srgb, var(--j13-green) 40%, transparent);
  color: var(--j13-green-hover, var(--j13-green));
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px color-mix(in srgb, var(--j13-green) 18%, transparent);
}
.article-image-picker__tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.article-image-picker__panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
}
.article-image-picker__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 24px 16px;
  border: 1.5px dashed var(--j13-border);
  border-radius: 10px;
  background: var(--j13-bg-block-muted, var(--color-fill-3));
  color: var(--color-text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.article-image-picker__drop p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-1);
}
.article-image-picker__drop span {
  font-size: 12px;
  color: var(--color-text-3);
}
.article-image-picker__drop.is-dragover {
  border-color: var(--j13-green);
  background: var(--j13-green-bg);
}
.article-image-picker__drop.is-busy {
  cursor: wait;
  pointer-events: none;
}
.article-image-picker__hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-3);
}
.article-image-picker__footer {
  gap: 8px;
  align-items: center;
}
.article-image-picker__selected-count {
  margin-right: auto;
  font-size: 13px;
  color: var(--color-text-2);
}
.article-image-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.article-image-picker__thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--j13-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--j13-bg-block-muted, var(--color-fill-3));
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.article-image-picker__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-image-picker__thumb.is-selected {
  border-color: var(--j13-green);
  box-shadow: 0 0 0 1px var(--j13-green);
}
.article-image-picker__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  color: var(--color-text-3);
  font-size: 13px;
}
.article-image-picker__more {
  display: flex;
  justify-content: center;
}
.article-image-picker__spin {
  animation: article-image-picker-spin 0.8s linear infinite;
}
@keyframes article-image-picker-spin {
  to { transform: rotate(360deg); }
}

/* 代码块插入弹窗 */
.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;
    overflow: visible !important;
  }

  .compose-canvas {
    padding: 10px 12px 20px;
    overflow: visible !important;
  }

  .compose-shell {
    border-radius: 10px;
    overflow: visible !important;
  }

  .compose-shell-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .compose-document {
    overflow: visible !important;
    flex: 1 0 auto;
    min-height: 100%;
  }

  .article-editor {
    overflow: visible !important;
    flex: 1 0 auto;
    min-height: 300px;
  }

  .article-editor-body {
    overflow: visible !important;
  }

  .article-editor-scroll {
    overflow: visible !important;
    flex: none;
  }

  .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: 6px 12px;
  }

  .compose-context-row {
    flex-direction: column;
    gap: 3px;
    padding: 4px 0;
  }

  .compose-context-label,
  .compose-context-row--tags .compose-context-label {
    margin-top: 0;
    width: auto;
  }

  .compose-title {
    font-size: 20px;
    padding: 18px 18px 12px;
  }

  .article-editor--fullscreen {
    padding: 8px 12px 0;
  }

  .article-editor--fullscreen .article-editor-bar {
    position: relative;
    margin: 0;
    padding: 8px 0;
    z-index: auto;
    box-shadow: none;
  }

  .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 {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: 8px 10px;
    background: var(--j13-bg-surface);
    border-bottom: 1px solid var(--j13-border-light);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  }

  .article-editor-content .tiptap,
  .article-prosemirror {
    min-height: 160px;
    padding: 12px 14px 20px;
  }

  .article-editor-status {
    padding: 4px 10px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    border-radius: 0 0 10px 10px;
  }

  .article-editor--fullscreen .article-editor-status {
    margin: 0 -12px;
    padding: 4px 12px;
    border-radius: 0;
  }

  .article-editor-status-meta {
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }

  .article-editor-status-actions {
    width: auto;
    justify-content: flex-end;
    flex-shrink: 0;
  }

  .article-editor-view-btn {
    padding: 4px 10px;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .compose-tags-field {
    min-width: 0;
  }
}

/* 路由懒加载占位类名保留兼容（前台已改顶栏进度 + 空白） */

/* ========== 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)); }

/* ========== 仪表盘 bento ========== */
.admin-dash-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.admin-dash-head-title h1 { margin-bottom: 0; }
.admin-dash-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-dash-section-label h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.admin-dash-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}
.admin-dash-traffic {
  border: 1px solid var(--j13-border);
  border-radius: 12px;
  background: hsl(var(--card));
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.admin-dash-traffic-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-dash-traffic-top .admin-dash-section-label { margin-bottom: 0; }
.admin-dash-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
}
.admin-dash-traffic-pv {
  font-size: 48px;
  font-weight: 700;
  color: var(--j13-green);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 8px;
}
.admin-dash-traffic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.admin-dash-traffic-uv {
  color: hsl(var(--foreground));
  font-weight: 500;
}
.admin-dash-traffic-trend {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.admin-dash-traffic-trend.is-up { color: var(--j13-green); }
.admin-dash-traffic-trend.is-down { color: hsl(24 90% 42%); }
.admin-dash-traffic-total {
  margin-top: auto;
  padding-top: 16px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.admin-dash-traffic-hint { opacity: 0.85; margin-left: 4px; }
.admin-dash-traffic-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  padding: 12px 0;
}

.admin-dash-queue {
  border: 1px solid var(--j13-border);
  border-radius: 12px;
  background: hsl(var(--card));
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.admin-dash-queue-head { margin-bottom: 12px; }
.admin-dash-queue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}
.admin-dash-queue-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--j13-border);
  background: hsl(var(--background));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.admin-dash-queue-card:hover {
  border-color: color-mix(in srgb, var(--j13-green) 45%, var(--j13-border));
  background: var(--j13-green-bg);
}
.admin-dash-queue-card.has-work {
  border-color: hsl(24 80% 55% / 0.45);
  background: hsl(24 90% 48% / 0.06);
}
.admin-dash-queue-card.has-work:hover {
  border-color: hsl(24 80% 50%);
  background: hsl(24 90% 48% / 0.1);
}
.admin-dash-queue-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: hsl(var(--muted-foreground));
  margin-bottom: 6px;
}
.admin-dash-queue-count {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.admin-dash-queue-card.has-work .admin-dash-queue-count {
  color: hsl(24 90% 40%);
}
.dark .admin-dash-queue-card.has-work .admin-dash-queue-count {
  color: hsl(24 95% 68%);
}
.admin-dash-queue-label {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.admin-dash-queue-hint {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.admin-dash-scale {
  margin-bottom: 20px;
}
.admin-dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.admin-dash-metric-card {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--j13-border);
  background: hsl(var(--card));
}
.admin-dash-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 6px;
}
.admin-dash-metric-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

@media (max-width: 960px) {
  .admin-dash-bento {
    grid-template-columns: 1fr;
  }
  .admin-dash-traffic-pv {
    font-size: 40px;
  }
}
@media (max-width: 640px) {
  .admin-dash-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.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-settings-subsection {
  margin-top: 1.25rem;
}
.admin-settings-subsection-title {
  margin: 0 0 0.25rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground, #0f172a);
}
.admin-settings-subsection-desc {
  margin: 0 0 0.75rem;
  font-size: 12px;
  line-height: 1.45;
  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 tr.admin-row-highlight td {
  background: color-mix(in srgb, #f97316 14%, transparent);
  transition: background 0.4s ease;
}
.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: 14px;
}

.pm-page-head .page-desc {
  margin-bottom: 0;
}

.pm-workspace {
  overflow: hidden;
  padding: 0;
}

.pm-workspace--im.content-surface {
  background: color-mix(in srgb, #faf9f7 35%, var(--j13-bg-surface));
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--j13-muted, #94a3b8) 8%, transparent);
}

.pm-workspace--im .pm-tabs {
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border-bottom: 1px solid var(--j13-border-light);
}

.pm-workspace--im .pm-tab {
  margin-bottom: 0;
  padding: 6px 14px;
  border-bottom: none;
  border-radius: 999px;
}

.pm-workspace--im .pm-tab.active {
  background: color-mix(in srgb, var(--j13-green) 12%, transparent);
  border-bottom-color: transparent;
}

.pm-tabs {
  display: flex;
  gap: 0;
  padding: 0 1rem;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
}

.pm-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 0.875rem;
  font-weight: 560;
  cursor: pointer;
}

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

.pm-tab.active {
  color: var(--j13-green);
  border-bottom-color: var(--j13-green);
  font-weight: 650;
}

.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;
}

.pm-notify-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem 0;
  border-bottom: 1px solid var(--j13-border-light);
}

.pm-notify-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.pm-notify-filter {
  padding: 0.45rem 0.7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--color-text-3);
  font-size: 0.8rem;
  cursor: pointer;
}

.pm-notify-filter:hover {
  color: var(--color-text-1);
}

.pm-notify-filter.active {
  color: var(--j13-green);
  border-bottom-color: var(--j13-green);
  font-weight: 650;
}

.pm-notify-unread-toggle {
  padding: 0.35rem 0.55rem;
  border: 0;
  background: transparent;
  color: var(--color-text-3);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.pm-notify-unread-toggle:hover,
.pm-notify-unread-toggle.active {
  color: var(--j13-green);
  font-weight: 600;
}

.pm-notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pm-notify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--j13-border-light);
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
  transition: background 0.12s;
}

.pm-notify-item--clickable {
  cursor: pointer;
}

.pm-notify-item--clickable:hover {
  background: color-mix(in srgb, var(--j13-green) 5%, transparent);
}

.pm-notify-item.unread {
  border-left-color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 4%, transparent);
}

.pm-notify-item.unread .pm-notify-item__subject {
  font-weight: 700;
  color: var(--color-text-1);
}

.pm-notify-item:not(.unread) .pm-notify-item__subject {
  font-weight: 560;
  color: var(--color-text-2);
}

.pm-notify-item:not(.unread) .pm-notify-item__text {
  color: var(--color-text-3);
}

/* 仅仍待审：极淡警示底与左侧细条 */
.pm-notify-item--moderation.unread {
  border-left-color: color-mix(in srgb, #f97316 55%, var(--j13-border-light));
  background: color-mix(in srgb, #f97316 4%, transparent);
}

.pm-notify-item--moderation:not(.unread) {
  background: color-mix(in srgb, #f97316 3%, transparent);
}

.pm-notify-item__icon {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 12%, transparent);
  color: var(--color-text-3);
}

.pm-notify-item__body {
  flex: 1;
  min-width: 0;
}

.pm-notify-item__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.2rem;
}

.pm-notify-item__kind {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-3);
}

.pm-notify-item--moderation .pm-notify-item__kind {
  color: color-mix(in srgb, #c2410c 70%, var(--color-text-3));
}

.pm-notify-status {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.35rem;
  border-radius: 0.2rem;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.pm-notify-status--pending {
  background: color-mix(in srgb, #f97316 10%, transparent);
  color: color-mix(in srgb, #c2410c 75%, var(--color-text-2));
}

.pm-notify-status--published {
  background: color-mix(in srgb, var(--j13-green) 10%, transparent);
  color: color-mix(in srgb, var(--j13-green) 80%, var(--color-text-2));
}

.pm-notify-status--rejected {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 14%, transparent);
  color: var(--color-text-3);
}

.pm-notify-status--deleted {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 12%, transparent);
  color: var(--color-text-4);
}

.pm-notify-item__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--j13-green);
  flex-shrink: 0;
}

.pm-notify-item--moderation .pm-notify-item__dot {
  background: color-mix(in srgb, #f97316 70%, var(--j13-muted, #94a3b8));
}

.pm-notify-item__time {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--color-text-4);
}

.pm-notify-item__subject {
  margin-bottom: 0.15rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.pm-notify-item__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-2);
  font-size: 0.84rem;
  line-height: 1.5;
}

.pm-notify-item__cta {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--j13-green);
}

.pm-notify-item--moderation .pm-notify-item__cta {
  color: color-mix(in srgb, #c2410c 65%, var(--color-text-2));
}

.pm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: min(72vh, 680px);
  min-height: 480px;
  overflow: hidden;
}

.pm-list {
  overflow-y: auto;
  padding: 6px 8px;
  background: color-mix(in srgb, #faf9f7 28%, var(--j13-bg-surface));
  border-right: 1px solid var(--j13-border-light);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--j13-muted, #94a3b8) 35%, transparent) transparent;
}

.pm-list-search {
  position: relative;
  padding: 8px 6px 10px;
  flex-shrink: 0;
}

.pm-list-search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(calc(-50% + 2px));
  color: var(--color-text-4);
  pointer-events: none;
}

.pm-list-search__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 0 10px 0 34px;
  border: 1px solid var(--j13-border-light);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-1);
  background: var(--j13-bg-surface);
  outline: none;
}

.pm-list-search__input:focus {
  border-color: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border-light));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--j13-green) 8%, transparent);
}

.pm-list-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.pm-list-search__dropdown {
  position: absolute;
  left: 6px;
  right: 6px;
  top: calc(100% - 2px);
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--j13-muted, #94a3b8) 18%, transparent);
  max-height: 280px;
  overflow-y: auto;
}

.pm-list-search__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.pm-list-search__item:hover {
  background: color-mix(in srgb, var(--j13-green) 8%, transparent);
}

.pm-list-search__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.pm-list-search__username {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-4);
}

.pm-list-search__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  font-size: 12px;
  color: var(--color-text-3);
}

.pm-avatar--search {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.pm-list::-webkit-scrollbar {
  width: 6px;
}

.pm-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 35%, transparent);
  border-radius: 999px;
}

.pm-avatar {
  width: 44px;
  height: 44px;
  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-avatar--bubble {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.pm-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

.pm-conv-item:hover {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 6%, transparent);
}

.pm-conv-item.active {
  background: color-mix(in srgb, var(--j13-green) 10%, var(--j13-bg-surface));
}

.pm-conv-item.unread .pm-conv-item__name {
  font-weight: 650;
  color: var(--color-text-1);
}

.pm-conv-item__body {
  min-width: 0;
  flex: 1;
}

.pm-conv-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pm-conv-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 550;
  color: var(--color-text-1);
}

.pm-conv-item__time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-4);
  line-height: 1.2;
}

.pm-conv-item__preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-4);
  line-height: 1.35;
}

.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 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--j13-green) 16%, var(--j13-bg-surface));
  color: var(--j13-green);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.pm-list-more {
  padding: 10px;
  text-align: center;
}

.pm-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--j13-bg-workspace);
}

.pm-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  flex-shrink: 0;
  background: var(--j13-bg-surface);
}

.pm-thread-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: -4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-2);
  cursor: pointer;
}

.pm-thread-back:hover {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 12%, transparent);
}

.pm-thread-head__meta {
  min-width: 0;
  flex: 1;
}

.pm-thread-head__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-thread-head__profile {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--j13-green);
  text-decoration: none;
}

.pm-thread-head__profile:hover {
  text-decoration: underline;
}

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 20px 20px;
  background: var(--j13-bg-workspace);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--j13-muted, #94a3b8) 35%, transparent) transparent;
}

.pm-thread-scroll::-webkit-scrollbar {
  width: 6px;
}

.pm-thread-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 35%, transparent);
  border-radius: 999px;
}

.pm-thread-older {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.pm-bubble-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.pm-bubble-row--mine {
  justify-content: flex-end;
}

.pm-bubble-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: min(68%, 500px);
  min-width: 0;
}

.pm-bubble-row--mine .pm-bubble-stack {
  align-items: flex-end;
}

.pm-bubble {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  box-shadow: none;
}

.pm-bubble--mine {
  background: color-mix(in srgb, var(--j13-green) 14%, var(--j13-bg-surface));
  border-color: color-mix(in srgb, var(--j13-green) 22%, transparent);
}

.pm-bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-1);
}

.pm-bubble__img {
  display: block;
  max-width: min(220px, 100%);
  max-height: 220px;
  margin: 4px 0;
  border-radius: 8px;
  object-fit: contain;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 8%, transparent);
}

.pm-bubble--mine .pm-bubble__text {
  color: color-mix(in srgb, var(--j13-green) 72%, #0f172a);
}

.pm-bubble__time {
  align-self: center;
  width: 100%;
  font-size: 11px;
  color: var(--color-text-4);
  line-height: 1.2;
  text-align: center;
}

.pm-composer {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
}

.pm-composer--readonly {
  display: block;
  font-size: 12px;
  color: var(--color-text-3);
  text-align: center;
  padding: 14px;
}

.pm-composer__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-1);
  background: var(--j13-bg-workspace);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.pm-composer__input:focus {
  border-color: color-mix(in srgb, var(--j13-green) 40%, var(--j13-border-light));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--j13-green) 8%, transparent);
}

.pm-composer__embeds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.pm-composer__embed {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-workspace);
}

.pm-composer__embed img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pm-composer__embed-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #0f172a 72%, transparent);
  color: #fff;
  cursor: pointer;
}

.pm-composer__embed-remove:hover {
  background: #0f172a;
}

.pm-composer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.pm-composer__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.pm-composer__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.pm-composer__tool:hover:not(:disabled),
.pm-composer__tool.active {
  background: color-mix(in srgb, var(--j13-green) 10%, transparent);
  color: var(--j13-green);
}

.pm-composer__tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pm-composer__send {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--j13-green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s;
}

.pm-composer__send:hover:not(:disabled) {
  opacity: 0.92;
}

.pm-composer__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pm-composer__picker {
  margin-top: 8px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  overflow: hidden;
  background: var(--j13-bg-surface);
}

.pm-composer__hint {
  margin: 6px 2px 0;
  font-size: 11px;
  color: var(--color-text-4);
  text-align: right;
}

.pm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 24px;
  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 select,
.pm-field textarea {
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: var(--j13-bg-surface);
  color: var(--color-text-1);
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus {
  outline: none;
  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'],
.article-tool-btn--points.active {
  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;
}

/* 自定义单页：与首页帖子列表相同的 12px 留白，卡片铺满主栏 */
.page-wrap:has(.site-page) {
  padding: 12px;
  background: var(--j13-bg-surface);
}

.site-page {
  width: 100%;
  margin: 0;
  padding: 20px 16px 28px;
  box-sizing: border-box;
  background: var(--j13-bg-block);
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
}

.site-page__head h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.site-page__body {
  min-width: 0;
}

@media (max-width: 768px) {
  .page-wrap:has(.site-page) {
    padding: 0;
  }

  .site-page {
    padding: 16px 14px 24px;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* 友情链接 / 特殊帖 */
.links-page__head h1 { margin: 0 0 0.5rem; }
.links-page__hint { color: var(--muted-fg, #666); margin: 0 0 1rem; }
.links-page__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.links-page__list a { color: var(--primary, #2d6a4f); text-decoration: none; }
.compose-special { margin-top: 1rem; padding: 1rem; border: 1px solid var(--j13-border); border-radius: 8px; display: grid; gap: 0.75rem; }
.compose-special__head { display: flex; flex-direction: column; gap: 0.5rem; }
.compose-special__poll-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: var(--j13-bg-block-muted, #f9fafb);
  border: 1px solid var(--j13-border);
}
.compose-special__poll-mode label { font-size: 0.875rem; cursor: pointer; user-select: none; }
.compose-special__poll-deadline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: var(--j13-bg-block-muted, #f9fafb);
  border: 1px solid var(--j13-border);
}
.compose-special__poll-deadline-toggle,
.compose-special__poll-deadline-field {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}
.compose-special__poll-deadline label { font-size: 0.875rem; cursor: pointer; user-select: none; }
.compose-special__poll-deadline-label { margin: 0; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.compose-special__poll-deadline-input {
  width: auto;
  min-width: 11.5rem;
  max-width: 100%;
  flex: 0 0 auto;
}
.compose-special__max-choices-label,
.compose-special__max-choices-suffix { font-size: 0.8125rem; color: var(--color-text-3); }
.compose-special__max-choices { width: 4.5rem; }
.compose-special__options { display: grid; gap: 0.65rem; }
.compose-special__option-row { display: flex; gap: 0.5rem; align-items: center; }
.compose-special__hint { font-size: 0.85rem; color: var(--color-text-3); margin: 0; }
.post-type-badge { display: inline-flex; align-items: center; margin-right: 0.35rem; padding: 0.1rem 0.45rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.post-type-badge--poll { background: #dbeafe; color: #1d4ed8; }
.post-type-badge--bounty { background: #fef3c7; color: #b45309; }
.post-type-badge--lottery { background: #fce7f3; color: #be185d; }
.post-bounty-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-bounty-badge--detail {
  margin-right: 8px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
}
.post-bounty-badge--open {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.post-bounty-badge--awarded {
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border: 1px solid color-mix(in srgb, var(--j13-green) 20%, transparent);
}
.dark .post-bounty-badge--open {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.22);
}
.post-poll, .post-lottery, .post-bounty {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--j13-border);
  background: var(--j13-bg-surface);
}
.post-bounty__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.post-bounty__lead {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}
.post-bounty__icon { flex-shrink: 0; margin-top: 0.1rem; }
.post-bounty__titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.post-bounty__title { font-size: 0.9375rem; line-height: 1.35; }
.post-bounty__points {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.post-bounty__subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-3);
  font-weight: 500;
  line-height: 1.4;
}
.post-bounty__hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-3);
  line-height: 1.5;
}
.post-bounty__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}
.post-bounty__actions--inline { margin-top: 0.65rem; }
.post-bounty__jump {
  appearance: none;
  border: none;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--j13-green);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-bounty__jump:hover { opacity: 0.85; }
.post-bounty--open {
  background: color-mix(in srgb, #f59e0b 10%, var(--j13-bg-surface));
  border-color: color-mix(in srgb, #f59e0b 28%, var(--j13-border));
}
.post-bounty--open .post-bounty__icon,
.post-bounty--open .post-bounty__title,
.post-bounty--open .post-bounty__points { color: #b45309; }
.post-bounty--awarded {
  background: color-mix(in srgb, var(--j13-green) 8%, var(--j13-bg-surface));
  border-color: color-mix(in srgb, var(--j13-green) 22%, var(--j13-border));
}
.post-bounty--awarded .post-bounty__icon,
.post-bounty--awarded .post-bounty__title { color: var(--j13-green); }
.post-bounty--refunded {
  background: var(--j13-bg-block-muted);
  border-color: var(--j13-border);
}
.post-bounty--refunded .post-bounty__icon,
.post-bounty--refunded .post-bounty__title { color: var(--color-text-3); }
.dark .post-bounty--open {
  background: color-mix(in srgb, #f59e0b 12%, var(--j13-bg-block-muted));
  border-color: color-mix(in srgb, #f59e0b 24%, var(--j13-border));
}
.dark .post-bounty--open .post-bounty__icon,
.dark .post-bounty--open .post-bounty__title,
.dark .post-bounty--open .post-bounty__points { color: #fbbf24; }
.dark .post-bounty--awarded {
  background: color-mix(in srgb, var(--j13-green) 10%, var(--j13-bg-block-muted));
}
.compose-special__bounty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.compose-special__bounty-row input { width: min(100%, 10rem); }
.compose-special__balance {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-3);
  line-height: 1.45;
}
.compose-special__balance--over {
  color: hsl(var(--destructive));
  font-weight: 600;
}
.bounty-award-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--j13-border));
  background: color-mix(in srgb, #f59e0b 10%, var(--j13-bg-surface));
  color: #b45309;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.bounty-award-btn:hover {
  background: color-mix(in srgb, #f59e0b 16%, var(--j13-bg-surface));
  border-color: color-mix(in srgb, #f59e0b 45%, var(--j13-border));
}
.dark .bounty-award-btn {
  color: #fbbf24;
  background: color-mix(in srgb, #f59e0b 14%, var(--j13-bg-block-muted));
  border-color: color-mix(in srgb, #f59e0b 28%, var(--j13-border));
}
.waline-comment--bounty-awarded {
  position: relative;
  background: color-mix(in srgb, #f59e0b 6%, var(--j13-bg-surface));
  box-shadow: inset 3px 0 0 #f59e0b;
}
.dark .waline-comment--bounty-awarded {
  background: color-mix(in srgb, #f59e0b 10%, var(--j13-bg-block-muted));
  box-shadow: inset 3px 0 0 #fbbf24;
}
.waline-comment-bounty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--j13-green);
  background: var(--j13-green-bg);
  border: 1px solid color-mix(in srgb, var(--j13-green) 20%, transparent);
  vertical-align: middle;
}
.post-poll__head, .post-lottery__head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.post-lottery__winners { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-poll__meta { margin-left: auto; font-size: 0.8125rem; color: var(--color-text-3); font-weight: 500; }
.post-poll__deadline {
  font-size: 0.8125rem;
  color: var(--color-text-3);
  font-weight: 500;
}
.post-poll__options { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.5rem; }
button.post-poll__option,
.post-poll__option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  appearance: none;
  font: inherit;
  color: inherit;
  margin: 0;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--j13-border);
  background: color-mix(in srgb, var(--j13-green) 4%, var(--j13-bg-surface));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.post-poll__option:hover:not(:disabled) {
  border-color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 8%, var(--j13-bg-surface));
}
.post-poll__option.active {
  border-color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 12%, var(--j13-bg-surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--j13-green) 20%, transparent);
}
.post-poll__option.mine { border-color: var(--j13-green); }
.post-poll__option:disabled { cursor: default; opacity: 1; }
.post-poll__option-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}
.post-poll__option-indicator {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, var(--j13-border) 70%, #9ca3af);
  background: var(--j13-bg-surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.post-poll__option--single .post-poll__option-indicator { border-radius: 999px; }
.post-poll__option--multi .post-poll__option-indicator { border-radius: 3px; }
.post-poll__option.active .post-poll__option-indicator {
  border-color: var(--j13-green);
  background: var(--j13-green);
  box-shadow: inset 0 0 0 2px var(--j13-bg-surface);
}
.post-poll__option-text { flex: 1; min-width: 0; line-height: 1.4; }
.post-poll__option-stat {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-3);
  font-variant-numeric: tabular-nums;
}
.post-poll__option-bar {
  display: block;
  margin-top: 0.5rem;
  position: relative;
  height: 6px;
  background: var(--j13-bg-block-muted);
  border-radius: 999px;
  overflow: hidden;
}
.post-poll__option-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--j13-green);
  opacity: 0.45;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.post-poll__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.post-poll__login-hint,
.post-poll__select-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-3);
}
.dark .post-poll__option {
  background: color-mix(in srgb, var(--j13-green) 6%, var(--j13-bg-block-muted));
}
.dark .post-poll__option:hover:not(:disabled) {
  background: color-mix(in srgb, var(--j13-green) 10%, var(--j13-bg-block-muted));
}
.dark .post-poll__option.active {
  background: color-mix(in srgb, var(--j13-green) 14%, var(--j13-bg-block-muted));
}
.dark .post-poll__option-indicator { background: var(--j13-bg-block-muted); }
.dark .post-poll__option.active .post-poll__option-indicator {
  box-shadow: inset 0 0 0 2px var(--j13-bg-block-muted);
}
.dark .post-poll__option-bar { background: rgba(255, 255, 255, 0.08); }
.admin-links-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-links-page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-links-entry-card {
  margin-bottom: 16px;
}
.admin-links-entry-body {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.admin-links-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--foreground, #334155);
}
.admin-links-entry-row .admin-settings-switch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.admin-links-columns {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-links-apply-card { margin-bottom: 0; }
.admin-links-apply-card > .admin-card-head {
  gap: 12px;
  flex-wrap: wrap;
}
.admin-links-apply-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-links-reciprocal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.admin-links-reciprocal-toggle .admin-settings-switch:disabled {
  opacity: 0.6;
  cursor: default;
}
.admin-links-published-card { margin-bottom: 0; }
.admin-inline-link {
  margin: 0 4px;
  color: var(--j13-green);
  text-decoration: none;
}
.admin-inline-link:hover { text-decoration: underline; }

.admin-community-support-strip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--j13-green) 22%, var(--j13-border-light));
  border-left: 3px solid var(--j13-green);
  border-radius: 8px;
  background: color-mix(in srgb, var(--j13-green) 5%, var(--j13-bg-surface));
}

.admin-community-support-strip-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.admin-community-support-strip-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--j13-green);
}

.admin-community-support-strip-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 28rem;
}

.admin-community-support-strip-copy strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}

.admin-community-support-strip-copy span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-2);
}

.admin-community-support-strip .admin-settings-switch {
  flex-shrink: 0;
}

.admin-community-support-strip .admin-settings-switch:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .admin-community-support-strip {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-community-support-strip-copy {
    max-width: none;
  }
}

.admin-community-site {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-community-site strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-community-star {
  color: var(--j13-green);
  flex-shrink: 0;
}

.admin-community-url {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  word-break: break-all;
}

.showcase-panel {
  min-height: 0;
}

.showcase-head {
  border-bottom: 1px solid var(--j13-border-light);
  padding-bottom: 1rem;
  margin-bottom: 0;
}

.showcase-head__title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.showcase-head__title-row .page-title {
  margin: 0;
}

.showcase-head__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-3);
  letter-spacing: 0.02em;
}

.showcase-head .page-desc {
  margin-top: 0.45rem;
  max-width: none;
}

.showcase-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 64px 20px;
  text-align: center;
  color: var(--color-text-3);
  font-size: 13px;
}

.showcase-empty p {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-2);
}

.showcase-empty span {
  font-size: 12px;
}

.showcase-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.showcase-item {
  border-bottom: 1px solid var(--j13-border-light);
}

.showcase-item:last-child {
  border-bottom: 0;
}

.showcase-item-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.25rem;
  padding: 1.15rem 0.35rem 1.15rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border-left: 2px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.showcase-item-link:hover {
  background: color-mix(in srgb, var(--j13-green) 4%, transparent);
  border-left-color: var(--j13-green);
}

.showcase-item-favicon,
.showcase-item-mark {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface, #fff);
}

.showcase-item-favicon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.showcase-item-mark {
  font-size: 1rem;
  font-weight: 700;
  color: var(--j13-green);
  background: color-mix(in srgb, var(--j13-green) 8%, var(--j13-bg-surface, transparent));
}

.showcase-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.showcase-item-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text-1);
}

.showcase-item-url {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--j13-green);
  word-break: break-all;
}

.showcase-item-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-3);
}

.showcase-item-version {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--color-text-2);
  border: 1px solid var(--j13-border-light);
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--j13-muted, #94a3b8) 8%, transparent);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .showcase-item-link {
    align-items: flex-start;
    min-height: 0;
    padding: 1rem 0.25rem 1rem 0.55rem;
  }

  .showcase-item-version {
    align-self: flex-start;
    margin-top: 0.15rem;
  }
}

.admin-links-logo-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-links-logo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.admin-links-logo-thumb--placeholder {
  font-weight: 700;
  font-size: 14px;
  color: var(--j13-green);
  background: var(--j13-green-soft, #edfbf3);
}

.admin-links-row {
  display: grid;
  grid-template-columns: 72px 32px 140px minmax(120px, 1.4fr) minmax(120px, 1.2fr) 36px;
  grid-template-areas: 'order preview name url logo actions';
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.admin-links-row:last-of-type { border-bottom: none; }
.admin-links-row.is-dragging {
  opacity: 0.72;
  background: var(--muted, #f8fafc);
  border-radius: 6px;
}

.admin-links-table-head {
  display: grid;
  grid-template-columns: 72px 32px 140px minmax(120px, 1.4fr) minmax(120px, 1.2fr) 36px;
  grid-template-areas: 'order preview name url logo actions';
  gap: 8px;
  align-items: center;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground, #64748b);
}
.admin-links-table-body { gap: 0; }
.admin-links-editor { padding-top: 12px; }

.admin-sortable-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.admin-sortable-list--boxed {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card, #fff);
}
.admin-sortable-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
}
.admin-sortable-row:last-child { border-bottom: none; }
.admin-sortable-row.is-dragging {
  opacity: 0.72;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 1;
}
.admin-sortable-row__handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground, #64748b);
  cursor: grab;
  touch-action: none;
}
.admin-sortable-row__handle:active { cursor: grabbing; }
.admin-sortable-row__handle:hover {
  background: var(--muted, #f1f5f9);
  color: var(--foreground, #0f172a);
}
.admin-sortable-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin-sortable-row__label {
  font-weight: 600;
  color: var(--foreground, #0f172a);
}
.admin-sortable-row__field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  min-width: 0;
}
.admin-sortable-row__field-name {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--muted-foreground));
}
.admin-sortable-row__name-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 16rem;
}
.admin-sortable-row__name-wrap .admin-sortable-row__name-input {
  width: 100%;
  height: 36px;
  padding-right: 2rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.55);
  border: 1px solid hsl(var(--foreground) / 0.16);
  box-shadow: inset 0 1px 1px hsl(var(--foreground) / 0.04);
}
.admin-sortable-row__name-wrap .admin-sortable-row__name-input:hover {
  border-color: hsl(var(--foreground) / 0.28);
}
.admin-sortable-row__name-wrap .admin-sortable-row__name-input:focus-visible {
  background: hsl(var(--background));
  border-color: var(--j13-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--j13-green) 22%, transparent);
}
.admin-sortable-row__name-icon {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.admin-sortable-row__hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-foreground, #64748b);
}
.admin-sortable-row__order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.admin-sortable-row--widget {
  grid-template-columns: auto 1fr auto;
}
.admin-sortable-table-row.is-dragging {
  opacity: 0.72;
  background: var(--muted, #f8fafc);
}
.admin-sortable-grid-item {
  position: relative;
}
.admin-sortable-grid-item.is-dragging {
  opacity: 0.72;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 1;
}
.admin-sortable-grid-item__handle-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}

.admin-links-row__order {
  grid-area: order;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.admin-links-row__move {
  flex-direction: row;
}
.admin-links-row__preview {
  grid-area: preview;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px dashed var(--border, #cbd5e1);
  background: var(--muted, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--j13-green);
}
.admin-links-row__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.admin-links-field {
  min-width: 0;
}
.admin-links-field--name {
  grid-area: name;
  max-width: 140px;
}
.admin-links-field--url { grid-area: url; }
.admin-links-field--logo { grid-area: logo; }
.admin-links-row__actions {
  grid-area: actions;
  display: flex;
  justify-content: center;
}
.admin-links-editor__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #e5e7eb);
}

.admin-links-pending-list { display: grid; gap: 0.75rem; }
.admin-links-pending-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.875rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--background, #fff);
}
.admin-links-pending-row--warn {
  border-color: #fcd34d;
  background: #fffbeb;
}
.admin-links-pending-logo {
  width: 48px;
  height: 48px;
}
.admin-links-pending-main {
  flex: 1;
  min-width: 0;
}
.admin-links-pending-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}
.admin-links-pending-title a {
  color: var(--j13-green);
  font-size: 0.85rem;
  word-break: break-all;
}
.admin-links-pending-reciprocal {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-fg, #666);
  word-break: break-all;
}
.admin-links-pending-reciprocal a {
  color: var(--j13-green);
  margin-left: 0.25rem;
}
.admin-links-reciprocal-empty {
  margin-left: 0.25rem;
  color: var(--muted-fg, #999);
}
.admin-links-table-reciprocal {
  max-width: 280px;
  font-size: 12px;
  word-break: break-all;
}
.admin-links-table-reciprocal a {
  color: var(--j13-green);
}
.admin-links-pending-meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-fg, #888);
}
.admin-links-pending-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.admin-links-table-site__head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-links-table-site__head strong {
  display: block;
  margin-bottom: 2px;
}
.admin-links-table-site__head a {
  display: block;
  font-size: 12px;
  color: var(--j13-green);
  word-break: break-all;
}

.admin-links-apply-detail__preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: var(--j13-green-soft, #edfbf3);
  border: 1px solid color-mix(in srgb, var(--j13-green) 20%, var(--border, #e5e7eb));
  margin-bottom: 12px;
}
.admin-links-apply-detail__preview .admin-links-logo-thumb {
  width: 52px;
  height: 52px;
}
.admin-links-apply-detail__preview strong {
  display: block;
  margin-bottom: 4px;
}
.admin-links-apply-detail__preview a {
  font-size: 13px;
  color: var(--j13-green);
  word-break: break-all;
}
.admin-links-apply-detail__grid {
  margin: 0;
  display: grid;
  gap: 10px;
}
.admin-links-apply-detail__grid > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  font-size: 13px;
}
.admin-links-apply-detail__grid dt {
  margin: 0;
  color: var(--muted-fg, #64748b);
}
.admin-links-apply-detail__grid dd {
  margin: 0;
  min-width: 0;
  word-break: break-all;
}
.admin-links-apply-detail__logo-url {
  font-size: 12px;
}
.admin-links-apply-dialog__footer {
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 1100px) {
  .admin-main:has(.admin-links-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .admin-links-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .admin-links-page .admin-links-page-head {
    flex-shrink: 0;
  }
  .admin-links-columns {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .admin-links-columns > .admin-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .admin-links-columns > .admin-card > .admin-card-head,
  .admin-links-columns > .admin-card > .admin-card-desc {
    flex-shrink: 0;
  }
  .admin-links-apply-body,
  .admin-links-columns .admin-links-editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .admin-links-apply-body .admin-tabs,
  .admin-links-columns .admin-links-editor__foot,
  .admin-links-apply-body .admin-pagination {
    flex-shrink: 0;
  }
  .admin-links-apply-body .admin-pagination {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border, #e5e7eb);
  }
  .admin-links-apply-scroll,
  .admin-links-published-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }
  .admin-links-columns .admin-links-table-head,
  .admin-links-columns .admin-links-row {
    grid-template-columns: 40px 40px minmax(52px, 0.5fr) minmax(64px, 0.75fr) minmax(120px, 2fr) 32px;
    grid-template-areas: 'order preview name url logo actions';
    gap: 6px 8px;
  }
  .admin-links-columns .admin-links-table-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0 0 8px;
    background: hsl(var(--card));
  }
  .admin-links-columns .admin-links-row {
    padding: 8px 0;
    align-items: center;
  }
  .admin-links-columns .admin-links-field--name {
    max-width: none;
  }
  .admin-links-columns .admin-links-row__preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .admin-links-columns .admin-links-row__order {
    flex-direction: column;
    align-self: center;
    padding-top: 0;
  }
  .admin-links-columns .admin-links-row__move {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .admin-links-page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-links-page-head__actions {
    justify-content: flex-end;
  }
  .admin-links-table-head {
    display: none;
  }
  .admin-links-row {
    grid-template-columns: auto 32px 1fr 36px;
    grid-template-areas:
      'order preview name actions'
      'order url url actions'
      'order logo logo actions';
    gap: 6px 8px;
    padding: 10px 0;
  }
  .admin-links-row__order {
    grid-area: order;
    flex-direction: column;
    align-self: start;
    padding-top: 4px;
  }
  .admin-links-row__move {
    flex-direction: column;
  }
  .admin-links-row__preview {
    grid-area: preview;
    align-self: center;
  }
  .admin-links-field--name { grid-area: name; max-width: none; }
  .admin-links-field--url { grid-area: url; }
  .admin-links-field--logo { grid-area: logo; }
  .admin-links-row__actions {
    grid-area: actions;
    align-self: center;
  }
  .admin-links-pending-row {
    flex-direction: column;
  }
  .admin-links-pending-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.admin-page-dialog { max-width: min(920px, 96vw); }

/* ========== 单页编辑（全屏） ========== */
.admin-main:has(.admin-site-page-edit) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px 20px;
  background: var(--j13-bg-workspace, hsl(var(--background)));
}

.admin-site-page-edit {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: hsl(var(--card));
  border: 1px solid var(--j13-border);
  border-radius: 12px;
  box-shadow: var(--j13-shadow-card);
}

.admin-site-page-edit--loading {
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.admin-site-page-edit__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
}

.admin-site-page-edit__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-site-page-edit__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-site-page-edit__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-site-page-edit__meta {
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
}

.admin-site-page-edit__meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 120px;
  gap: 12px 16px;
}

.admin-site-page-edit__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.admin-site-page-edit__hint {
  margin: 0;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.admin-site-page-edit__hint--error {
  color: hsl(var(--destructive));
}

.admin-site-page-edit__switches {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 12px;
}

.admin-site-page-edit__switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.admin-site-page-edit__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px;
  background: var(--j13-bg-workspace, hsl(var(--background)));
}

.admin-site-page-edit__shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--j13-bg-surface);
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  box-shadow: var(--j13-shadow-soft);
}

.admin-site-page-edit__shell .article-editor {
  flex: 1;
  min-height: 0;
}

.admin-site-page-edit__footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--j13-border-light);
  background: var(--j13-bg-surface);
}

.admin-table-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--j13-green);
  cursor: pointer;
  text-align: left;
}

.admin-table-link:hover {
  text-decoration: underline;
}

.admin-table-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-table-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-table-muted {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.admin-page-publish-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.admin-page-publish-toggle__label {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-page-publish-toggle__label.is-on {
  color: var(--j13-green);
}

.admin-page-publish-toggle__label.is-off {
  color: hsl(var(--muted-foreground));
}

@media (max-width: 900px) {
  .admin-site-page-edit__meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-site-page-edit__field--narrow {
    max-width: 160px;
  }
}

@media (max-width: 768px) {
  .admin-main:has(.admin-site-page-edit) {
    padding: 12px;
  }

  .admin-site-page-edit__header {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .admin-site-page-edit__title {
    white-space: normal;
  }

  .admin-site-page-edit__meta,
  .admin-site-page-edit__body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .admin-site-page-edit__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .admin-site-page-edit__footer > * {
    width: 100%;
  }
}

/* 友情链接独立页 */
.links-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.links-page-board {
  padding: 16px;
  border-radius: 12px;
  background: var(--j13-bg-block-muted);
  border: 1px solid var(--j13-border-light);
}
.links-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
}
.links-page-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  min-height: 118px;
  border: 1px solid var(--j13-border-light);
  border-radius: 10px;
  background: var(--j13-bg-surface);
  box-shadow: var(--j13-shadow-soft);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.links-page-card:hover {
  border-color: color-mix(in srgb, var(--j13-green) 35%, var(--j13-border-light));
  box-shadow: var(--j13-shadow-card);
  transform: translateY(-1px);
}
.links-page-card__logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--j13-border-light);
  background: var(--j13-bg-block-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--j13-green);
}
.links-page-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.links-page-card__name {
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.links-page-empty {
  margin: 24px 0;
}
.links-page-summary {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--j13-green);
  line-height: 1.4;
}
.links-page-summary--pending {
  color: #c27803;
}
.links-page-summary--rejected {
  color: var(--muted-fg, #64748b);
}
.links-page-my {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.links-page-my__title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.links-page-my__empty {
  margin: 0 0 8px;
  color: var(--muted-fg, #64748b);
  font-size: 13px;
  line-height: 1.5;
}
.links-page-my-list {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}
.links-page-my-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--j13-border-light);
  border-radius: 12px;
  background: var(--j13-bg-block-muted);
}
.links-page-my-row__logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
}
.links-page-my-row__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.links-page-my-row__main {
  flex: 1;
  min-width: 0;
}
.links-page-my-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.links-page-my-row__url {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--j13-green);
  word-break: break-all;
}
.links-page-my-row__note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-fg, #64748b);
}
.links-page-my-row__meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-fg, #94a3b8);
}
.links-page-my-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.links-page-login-hint {
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted-fg, #64748b);
}
.links-page-login-hint a {
  margin: 0 4px;
}

/* ========== 网站监控 ========== */
.admin-monitor-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--j13-green) 30%, var(--j13-border));
  background: var(--j13-green-bg);
  font-size: 13px;
  color: var(--color-text-2);
}

.admin-monitor-section-bar {
  display: inline-block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--j13-green);
  flex-shrink: 0;
}
.admin-monitor-today-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-monitor-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.admin-monitor-today {
  padding: 16px 20px 20px;
  margin-bottom: 16px;
}
.admin-monitor-today-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px 12px;
}
.admin-monitor-today-item {
  min-width: 0;
  text-align: left;
  padding: 4px 8px;
}
.admin-monitor-today-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-monitor-today-hint {
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-monitor-today-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--j13-green);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-all;
}
.admin-monitor-map-sub {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.admin-monitor-main {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}
.admin-monitor-map-panel .admin-card-head,
.admin-monitor-map-head {
  gap: 12px;
  flex-wrap: wrap;
}
.admin-monitor-map-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.7fr);
  gap: 16px;
  min-height: 320px;
  padding-top: 12px;
}
.admin-monitor-map-visual {
  position: relative;
  min-height: 280px;
  border-radius: 8px;
  background: color-mix(in srgb, hsl(var(--muted)) 35%, hsl(var(--card)));
  overflow: hidden;
}
.admin-monitor-map-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: 360px;
  overflow: auto;
}

.admin-monitor-seg {
  display: inline-flex;
  border: 1px solid var(--j13-border);
  border-radius: 8px;
  overflow: hidden;
  background: hsl(var(--background));
}
.admin-monitor-seg-btn {
  height: 28px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.admin-monitor-seg-btn + .admin-monitor-seg-btn {
  border-left: 1px solid var(--j13-border);
}
.admin-monitor-seg-btn.active {
  background: var(--j13-green);
  color: #fff;
  font-weight: 600;
}

.admin-monitor-svg-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
}
.admin-monitor-svg-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
}
.admin-monitor-svg-path {
  cursor: default;
  transition: fill 0.15s ease, opacity 0.15s ease;
}
.admin-monitor-svg-path.has-data {
  cursor: pointer;
}
.admin-monitor-svg-path.has-data:hover {
  opacity: 0.88;
  filter: brightness(1.05);
}
.admin-monitor-map-tip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, hsl(var(--card)) 92%, transparent);
  border: 1px solid var(--j13-border);
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}
.admin-monitor-map-tip strong {
  font-weight: 600;
}
.admin-monitor-map-tip span {
  color: var(--j13-green);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.admin-monitor-map-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  background: color-mix(in srgb, hsl(var(--card)) 55%, transparent);
  pointer-events: none;
  padding: 16px;
}

.admin-monitor-map-side .admin-monitor-seg {
  margin-bottom: 10px;
}
.admin-monitor-rank .admin-monitor-geo-empty {
  margin-top: 4px;
}
.admin-monitor-geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-monitor-geo-table th,
.admin-monitor-geo-table td {
  padding: 8px 10px;
  text-align: left;
}
.admin-monitor-geo-table th:last-child,
.admin-monitor-geo-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.admin-monitor-geo-table thead th {
  background: var(--j13-green);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}
.admin-monitor-geo-table thead th:first-child {
  border-radius: 6px 0 0 0;
}
.admin-monitor-geo-table thead th:last-child {
  border-radius: 0 6px 0 0;
}
.admin-monitor-geo-table tbody tr:nth-child(even) {
  background: var(--j13-green-bg);
}
.admin-monitor-geo-table tbody td {
  border-bottom: 1px solid var(--j13-border);
  color: hsl(var(--foreground));
}
.admin-monitor-geo-empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.admin-monitor-rt-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-monitor-rt-card {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-monitor-rt-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--j13-green);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 8px 0 4px;
}
.admin-monitor-rt-spark-label {
  margin: 16px 0 6px;
}
.admin-monitor-spark {
  display: block;
  max-width: 100%;
}
.admin-monitor-muted {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.admin-monitor-log-filters {
  border-bottom: 1px solid var(--j13-border);
}
.admin-monitor-settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.admin-monitor-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-monitor-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.admin-monitor-textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--j13-border);
  background: hsl(var(--background));
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  resize: vertical;
}
.admin-monitor-geo-note code {
  display: inline-block;
  margin: 0 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--j13-green-bg);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .admin-monitor-today-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .admin-monitor-main,
  .admin-monitor-map-body {
    grid-template-columns: 1fr;
  }
  .admin-monitor-rt-value {
    font-size: 32px;
  }
}
@media (max-width: 640px) {
  .admin-monitor-today-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dark .admin-monitor-today-value,
.dark .admin-monitor-rt-value {
  color: var(--j13-green);
}
.dark .admin-monitor-map-visual {
  background: color-mix(in srgb, hsl(var(--muted)) 40%, hsl(var(--card)));
}
.dark .admin-monitor-geo-table thead th {
  background: var(--j13-green);
  color: #fff;
}

