/* ==========================================================================
   /forum/assets/forum.css  —  极客猫论坛 全站样式（重构版）
   目标：不依赖任何 CDN / 图标字体，一屏之内把「这是谁、说什么、多少回复」讲清楚。
   所有尺寸以 15px 正文为基准；移动端优先，>=1000px 才出现侧栏。
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:root {
  --brand: #6366f1;
  --brand-600: #4f46e5;
  --brand-weak: #eceefe;
  --ok: #0d9f6e;
  --warn: #d97706;
  --danger: #e11d48;

  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eceef5;

  --text: #15171e;
  --text-2: #414658;
  --muted: #6b7280;
  --line: #e5e7f0;

  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow: 0 1px 2px rgba(16, 18, 27, .04), 0 10px 26px -14px rgba(16, 18, 27, .16);
  --shadow-lg: 0 24px 60px -24px rgba(16, 18, 27, .35);

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

html.dark {
  --brand: #818cf8;
  --brand-600: #6366f1;
  --brand-weak: #1e2140;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;

  --bg: #0a0b0f;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --surface-3: #232734;

  --text: #eef0f6;
  --text-2: #c2c6d4;
  --muted: #9aa1b4;
  --line: #242835;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -18px rgba(0, 0, 0, .9);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
svg { display: inline-block; }
::selection { background: var(--brand-weak); color: var(--brand); }

.ico { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none;
       stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.ico-14 { width: 14px; height: 14px; }
.ico-16 { width: 16px; height: 16px; }
.ico-20 { width: 20px; height: 20px; }
.ico-22 { width: 22px; height: 22px; }
.ico-28 { width: 28px; height: 28px; }
.ico-40 { width: 40px; height: 40px; }

/* ── 骨架 ───────────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
@media (min-width: 900px) { .wrap { padding: 26px 24px 56px; } }

.layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
  .layout > aside { position: sticky; top: 82px; }
}
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── 顶栏 ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
html.dark .topbar { background: rgba(10, 11, 15, .86); }

.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 0 16px;
  height: 58px; display: flex; align-items: center; gap: 10px;
}
@media (min-width: 900px) { .topbar-in { padding: 0 24px; height: 64px; gap: 14px; } }

.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; font-weight: 800; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-logo { width: 26px; height: 26px; object-fit: contain; }
.brand-name { font-size: 16px; }
.brand-sub {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-weak); padding: 2px 6px; border-radius: 7px; letter-spacing: .04em;
}
@media (max-width: 400px) { .brand-sub { display: none; } }

.nav { display: none; align-items: center; gap: 2px; margin-left: 6px; }
@media (min-width: 900px) { .nav { display: flex; } }
.nav-item {
  height: 34px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--brand); background: var(--brand-weak); }

.search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 420px; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 36px; padding: 0 10px 0 34px; border-radius: 10px;
  border: 1px solid transparent; background: var(--surface-3); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s, background .15s;
  appearance: none; -webkit-appearance: none;
}
html.dark .search input { background: var(--surface-2); }
.search input::placeholder { color: var(--muted); }
.search input:focus { background: var(--surface); border-color: var(--brand); }
html.dark .search input:focus { background: var(--bg); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.only-desktop { display: none !important; }
.only-mobile { display: none !important; }
@media (min-width: 900px) { .only-desktop { display: inline-flex !important; } }
@media (max-width: 899px) { .only-mobile { display: inline-flex !important; } }

.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .badge {
  position: absolute; top: 0; right: -1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}
html.dark .icon-btn .badge { border-color: var(--bg); }

.me-link { display: inline-flex; margin-left: 2px; border-radius: 99px; }
.me-link .av { outline: 2px solid transparent; transition: outline-color .15s; }
.me-link:hover .av { outline-color: var(--brand); }

/* 移动端第二行 */
.mobar { border-top: 1px solid var(--line); }
.mobar-in {
  max-width: 1120px; margin: 0 auto; padding: 0 10px; height: 44px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.mobar-in::-webkit-scrollbar { display: none; }
/* 窄屏这一排只留文字，不放图标：360px 上连未读数一起刚好一行放下。 */
.mobar .tab { height: 30px; padding: 0 10px; font-size: 13px; gap: 4px; flex: 0 0 auto; }
.mobar .tab .ico { display: none; }
.mobar .tab .count { font-size: 10px; padding: 0 4px; }
/* 发帖钉在右边：胶囊再多也只是左侧滚动，按钮不会跑出屏幕 */
.mobar-compose { position: sticky; right: 0; flex: 0 0 auto; margin-left: auto; }
@media (min-width: 900px) { .mobar { display: none; } }

/* ── 按钮 ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  background: var(--surface-3); color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--text); filter: brightness(.97); }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .ico { margin-left: -2px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }

/* 已激活的按钮（点赞 / 收藏） */
.btn.on { border-color: var(--danger); color: var(--danger); }
.btn.on .ico { fill: currentColor; }
.btn.is-fav.on { border-color: var(--warn); color: var(--warn); }
.btn.is-fav.on .ico { fill: currentColor; }

/* ── 卡片 ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 750;
}
.card-hd .ico { color: var(--brand); }
.card-hd .more { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.card-hd .more:hover { color: var(--brand); }
.card-bd { padding: 16px; }
.card-ft { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.card-list > * + * { border-top: 1px solid var(--line); }

.sec-hd { display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 10px; }
.sec-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.sec-sub { font-size: 12.5px; color: var(--muted); }
.sec-hd .more { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ── 头像 ───────────────────────────────────────────────────────────────── */
.av {
  width: var(--av, 40px); height: var(--av, 40px); flex: 0 0 auto;
  border-radius: 50%; object-fit: cover; background: var(--surface-3);
  -webkit-user-select: none; user-select: none;
}
.av-sq { border-radius: 12px; }
.av-link { display: inline-flex; flex: 0 0 auto; border-radius: 50%; }
.av-link:hover { opacity: .88; }

/* ── 标签 ───────────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto;
  height: 20px; padding: 0 6px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .01em;
  background: var(--surface-3); color: var(--muted);
}
.tag .ico { width: 12px; height: 12px; }
.tag-brand { background: var(--brand-weak); color: var(--brand); }
.tag-pin { background: rgba(225, 29, 72, .1); color: var(--danger); }
.tag-lock { background: rgba(217, 119, 6, .12); color: var(--warn); }
.tag-op { background: var(--brand-weak); color: var(--brand); }
.tag-admin { background: rgba(225, 29, 72, .1); color: var(--danger); }
.tag-ok { background: rgba(13, 159, 110, .12); color: var(--ok); }
.tag a, a.tag { color: inherit; }
a.tag:hover { background: var(--brand); color: #fff; }

#boards { scroll-margin-top: 78px; }

/* ── 版块卡片 ────────────────────────────────────────────────────────────── */
.board-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.board-card {
  display: flex; gap: 12px; padding: 14px; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.board-card:hover { border-color: var(--brand); color: inherit; transform: translateY(-1px); }
.board-ico {
  width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-weak); color: var(--brand);
}
html.dark .board-ico { background: rgba(129, 140, 248, .14); }
.board-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.board-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.board-name { font-size: 14.5px; font-weight: 750; }
.board-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.board-last { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-last b { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ── 主题列表行 ──────────────────────────────────────────────────────────── */
/* 整行可点：标题链接的伪元素铺满整行，作者/版块等真链接浮到上层。 */
.row { display: flex; gap: 12px; padding: 14px 16px; transition: background .12s; position: relative; }
.row-title::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: var(--r-lg); }
.row .row-author, .row .row-tags .tag, .row .av-link, .row .row-stats { position: relative; z-index: 1; }
.row:hover { background: var(--surface-2); }
.row:hover .row-title { color: var(--brand); }
.row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.row-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 1px; }
.row-title {
  font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-excerpt {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.row-author { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text-2); }
.row-author:hover { color: var(--brand); }
.row-stats { display: none; flex: 0 0 auto; align-items: center; gap: 14px; align-self: center; }
@media (min-width: 700px) { .row-stats { display: flex; } }
.row-stat { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
.row-stat b { font-size: 14px; font-weight: 800; color: var(--text-2); line-height: 1.2; }
.row-stat span { font-size: 11px; color: var(--muted); }
.row-stats-m { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
@media (min-width: 700px) { .row-stats-m { display: none; } }

/* ── 主题详情：楼层 ──────────────────────────────────────────────────────── */
.thread-hero { padding: 18px 16px 14px; }
@media (min-width: 900px) { .thread-hero { padding: 22px 22px 16px; } }
.thread-title { font-size: 20px; font-weight: 800; line-height: 1.4; letter-spacing: -.01em; }
@media (min-width: 900px) { .thread-title { font-size: 23px; } }
.thread-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
/* 「图标 + 数字」这种小组用 flex 自己居中。
   靠 <svg> 的 vertical-align 凑基线时，带图标的那一格行盒会被撑高，
   外层 align-items:center 一居中，文字基线就和旁边的日期差 1~2px（线上截图反馈）。 */
.thread-meta > span:not(.tag),
.row-meta > span:not(.tag) { display: inline-flex; align-items: center; gap: 4px; }
.thread-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.post { display: flex; gap: 12px; padding: 16px; scroll-margin-top: 90px; }
@media (min-width: 900px) { .post { padding: 18px 22px; } }
.post-op { background: linear-gradient(180deg, var(--brand-weak), transparent 90%); }
html.dark .post-op { background: linear-gradient(180deg, rgba(129, 140, 248, .06), transparent 90%); }
.post-main { min-width: 0; flex: 1; }
.post-hd { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.post-name { font-size: 14px; font-weight: 750; }
.post-time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.post-body { margin-top: 6px; font-size: 15px; line-height: 1.75; color: var(--text-2); }
.post-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.act {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.act:hover { background: var(--surface-2); color: var(--text-2); }
.act.on { color: var(--danger); }
.act.on .ico { fill: currentColor; }
.act-reply:hover { color: var(--brand); }
.act-del:hover { color: var(--danger); }
.act-report:hover { color: var(--warn); }

.children { margin-top: 12px; border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.child { display: flex; gap: 10px; padding: 11px 13px; scroll-margin-top: 90px; }
.child + .child { border-top: 1px solid var(--line); }
.child-main { min-width: 0; flex: 1; }
.child-hd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.child-body { margin-top: 3px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.child-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.child-acts { display: flex; align-items: center; gap: 2px; margin-top: 5px; }
.child-acts .act { height: 24px; font-size: 12px; padding: 0 6px; }

/* ── 图片 ───────────────────────────────────────────────────────────────── */
.imgs { display: grid; gap: 8px; margin-top: 10px; }
.imgs-1 { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
.imgs-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.imgs-n { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; }
.img-item {
  position: relative; padding: 0; border: 0; background: var(--surface-3);
  border-radius: var(--r-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 1 / 1;
}
.imgs-1 .img-item { aspect-ratio: auto; max-height: 420px; }
.imgs-1 .img-item img { width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.img-item img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.img-item:hover img { opacity: .92; }

/* ── 正文 / 空态 / 分页 ──────────────────────────────────────────────────── */
.empty { padding: 46px 20px; text-align: center; }
.empty-ico {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.empty-title { font-size: 14px; font-weight: 700; }
.empty-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.empty .btn { margin-top: 14px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.pager-info { font-size: 12.5px; color: var(--muted); }

.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ── 表单 ───────────────────────────────────────────────────────────────── */
.field + .field { margin-top: 16px; }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.label .opt { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.input, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14.5px;
  outline: none; transition: border-color .15s, background .15s; appearance: none;
}
.input { height: 42px; }
.textarea { resize: vertical; line-height: 1.7; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus { border-color: var(--brand); background: var(--surface); }
html.dark .input:focus, html.dark .textarea:focus { background: var(--bg); }
.field-ft { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.field-ft .counter { margin-left: auto; font-variant-numeric: tabular-nums; }

.board-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.board-opt {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13.5px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.board-opt:hover { border-color: var(--brand); color: var(--brand); }
.board-opt input { position: absolute; opacity: 0; pointer-events: none; }
/* 选中态只用 .on 类（PHP 首屏给，JS 切换时补）——
   :has() 在旧版 WebView 里会让整条选择器失效，反而不如不用。 */
.board-opt.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.board-opt .ico { color: currentColor; }
.board-opt[data-off="1"] { opacity: .45; cursor: not-allowed; }

.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.thumb { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); aspect-ratio: 1 / 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .62); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.thumb-del .ico { width: 13px; height: 13px; }
.pick-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px;
  border: 1px dashed var(--line); border-radius: 10px; background: transparent;
  font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.pick-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── 标签页 ─────────────────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 2px; }
.tab {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  border-radius: 10px; border: 1px solid transparent; background: var(--surface);
  font-size: 13px; font-weight: 650; color: var(--text-2); white-space: nowrap;
  border-color: var(--line);
}
.tab:hover { color: var(--brand); border-color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab .count {
  font-size: 11px; font-weight: 800; padding: 1px 5px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted); line-height: 1.4;
}
.tab.active .count { background: rgba(255, 255, 255, .24); color: #fff; }

/* ── 个人卡片 ───────────────────────────────────────────────────────────── */
/* 结构：一行「头像 + 资料 + 操作」，统计格单独占满整行。
   之前统计格塞在资料列里，360px 屏上被压成一字一行（线上实测），所以拆出来。 */
.profile { padding: 18px; }
@media (min-width: 900px) { .profile { padding: 22px; } }
.profile-hd { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.profile-id { flex: 1 1 150px; min-width: 0; }
.profile-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 620px) {
  .profile-acts { width: 100%; margin-left: 0; margin-top: 2px; }
  .profile-acts .btn { flex: 1 1 0; }
}
.hero-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
.hero-bio { font-size: 13px; color: var(--text-2); margin-top: 7px; line-height: 1.6; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 14px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); padding: 10px 6px; text-align: center; display: block; }
a.stat:hover { background: var(--surface-2); }
.stat b { display: block; font-size: 16px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.stat span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.kv { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.kv + .kv { margin-top: 8px; }
.kv b { font-weight: 750; }
.kv .ok { color: var(--ok); }

/* ── 提醒 ───────────────────────────────────────────────────────────────── */
.notif { display: flex; gap: 11px; padding: 13px 16px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-weak); }
html.dark .notif.unread { background: rgba(129, 140, 248, .08); }
.notif-main { min-width: 0; flex: 1; }
.notif-text { font-size: 13px; line-height: 1.55; }
.notif-text b { font-weight: 750; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.notif-excerpt { font-size: 12px; color: var(--muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }

/* ── 私信 ───────────────────────────────────────────────────────────────── */
.pm-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pm-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
/* 手机上打开某个会话时，会话列表让位给对话 */
@media (max-width: 899px) { .pm-layout.with-peer .pm-side { display: none; } }
/* 一条私信都没有时，手机上没必要再显示「选择一个会话开始」那张卡 */
@media (max-width: 899px) { .pm-layout.no-convs .pm-chat-pane { display: none; } }
/* 手机上的对话页：铺满屏幕，不要再套一层大卡片 + 左右外边距。
   top 用 JS 量出来的 --topbar-h（论坛.js 在启动/resize 时写），
   这样顶栏高度改了这里不用跟着改数字。 */
@media (max-width: 899px) {
  .pm-layout.with-peer .pm-chat-pane {
    position: fixed; top: var(--topbar-h, 104px); left: 0; right: 0; bottom: 0;
    z-index: 20; min-width: 0;
  }
  .pm-layout.with-peer .pm-chat {
    height: 100%; border: 0; border-radius: 0; box-shadow: none;
  }
  .pm-layout.with-peer .pm-chat-hd { padding: 10px 12px; }
  .pm-layout.with-peer .pm-body { padding: 12px; }
  .pm-layout.with-peer .pm-input { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
}
/* 手机上看会话列表时不要「大卡片套小卡片」：
   拆掉卡片外壳，一行一个人，直接铺在页面上；右边的空态卡也不需要（点进会话才有对话）。 */
@media (max-width: 899px) {
  .pm-layout.list-mode .pm-side .card {
    background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }
  .pm-layout.list-mode .pm-side .card-hd {
    padding: 4px 2px 10px; border-bottom: 0; font-size: 13.5px;
  }
  .pm-layout.list-mode .pm-list { max-height: none; overflow: visible; }
  .pm-layout.list-mode .pm-conv { padding: 11px 2px; border-radius: 10px; }
  .pm-layout.list-mode .pm-chat-pane { display: none; }
}
.pm-list { max-height: min(62vh, 560px); overflow-y: auto; }
.pm-conv { display: flex; gap: 10px; padding: 12px 14px; align-items: center; }
.pm-conv:hover { background: var(--surface-2); }
.pm-conv.active { background: var(--brand-weak); }
html.dark .pm-conv.active { background: rgba(129, 140, 248, .1); }
.pm-conv-main { min-width: 0; flex: 1; }
.pm-conv-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.pm-conv-last { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.pm-conv-side { text-align: right; flex: 0 0 auto; }
.pm-conv-time { font-size: 11px; color: var(--muted); }
.pm-dot { display: inline-block; margin-top: 5px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; }

.pm-chat { display: flex; flex-direction: column; height: min(72vh, 640px); }
.pm-chat-hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pm-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.pm-msg { display: flex; }
.pm-msg.mine { justify-content: flex-end; }
/* 宽度上限放在「外层包裹」上：放在气泡上会变成「短消息也按 78% 换行」 */
.pm-msg > div { max-width: 78%; min-width: 0; }
.pm-bubble {
  max-width: 100%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px;
  white-space: pre-wrap; word-break: break-word;
}
.pm-msg.mine .pm-bubble {
  background: var(--brand); border-color: transparent; color: #fff; border-bottom-left-radius: 16px;
  border-bottom-right-radius: 5px;
}
.pm-time { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; }
.pm-msg:not(.mine) .pm-time { text-align: left; }
.pm-input { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.pm-input-row { display: flex; align-items: flex-end; gap: 8px; }

/* ── 页脚 ───────────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in {
  max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--muted);
}
@media (min-width: 700px) {
  .foot-in { flex-direction: row; align-items: center; justify-content: space-between; padding: 22px 24px; }
}
.foot-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--brand); }

/* ── 提示 / 弹窗 / 放大图 ────────────────────────────────────────────────── */
#snackHost {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: calc(100% - 32px); max-width: 340px; pointer-events: none;
}
.snack {
  padding: 9px 16px; border-radius: 11px; font-size: 13px; font-weight: 600; text-align: center;
  background: rgba(21, 23, 30, .93); color: #fff; box-shadow: var(--shadow-lg);
  animation: snackIn .22s cubic-bezier(.16, 1, .3, 1);
}
html.dark .snack { background: rgba(238, 240, 246, .96); color: #14161d; }
@keyframes snackIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10, 11, 15, .5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 18px;
  animation: popIn .18s cubic-bezier(.16, 1, .3, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 15.5px; font-weight: 800; }
.modal-desc { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.modal-acts { display: flex; gap: 8px; margin-top: 16px; }
.modal-acts .btn { flex: 1; }
.modal-input { margin-top: 12px; }

.lb {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99; background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out;
}
.lb img { max-width: 100%; max-height: 92vh; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 38px; height: 38px;
  border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ── 面包屑 ─────────────────────────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .ico { width: 13px; height: 13px; opacity: .6; }

/* ── 杂项 ───────────────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap-any { overflow-wrap: anywhere; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* 正文强制可选中：论坛一半价值是把别人的报错抄走 */
.prose, .prose * { -webkit-user-select: text; user-select: text; }
.prose code {
  font-family: var(--mono); font-size: .9em; padding: 1px 5px; border-radius: 5px;
  background: var(--surface-3); color: var(--text);
}

/* App 内嵌：去掉页脚，收紧留白 */
html.zn-app .foot { display: none; }
html.zn-app .wrap { padding-top: 14px; }

/* 主题按钮：深色显示太阳（点回浅色），浅色显示月亮 */
html.dark .ico-theme-sun { display: none; }
html:not(.dark) .ico-theme-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
