/* ==========================================================================
   Picobbs · t00ls 风格主题（仿 www.t00ls.com / tusi 模板）
   --------------------------------------------------------------------------
   设计语言（取自 t00ls 线上样式表 forumdata/cache/style_6_tusi.css）：
     · 极简黑白灰：页面底 #f4f5f7，正文 #333，强调与主色都是近黑 #111
     · 58px 白色顶栏（1px 下边线 + 几乎看不见的阴影），不搞毛玻璃
     · 导航是「下边线式」：默认 2px 透明下边线，hover / 当前项变 #111
     · 搜索框胶囊形（180px，focus 时展开到 210px 并转白底黑边）
     · 容器 1160px，主列 + 300px 右侧栏（sticky top 84px）
     · 列表头是独立白卡片（48px 高），帖子列表是白卡片（圆角 10px）
     · 帖子行 44px 圆形头像 + 15px 标题 + 12.5px 元信息 + 右侧最后回复
     · 按钮是黑底白字圆角 6px，hover 上浮 1px
     · 主色克制，几乎不用阴影，圆角普遍 4 / 6 / 10px
   全站走 CSS 变量，改 :root 即可换色。深色令牌有两处，需同步修改。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌 · 浅色
   -------------------------------------------------------------------------- */
:root {
    color-scheme: light;

    /* 页面与容器 */
    --bg:          #f4f5f7;   /* 网页底色 */
    --panel:       #ffffff;   /* 内容卡片 */
    --panel-2:     #f7f7f7;   /* 输入框底 / 内嵌浅底 */
    --panel-3:     #f2f2f2;   /* 标签底（cat / badge） */
    --panel-4:     #fafbfc;   /* 列表行 hover */

    /* 文字 */
    --text:        #333333;   /* 正文 */
    --ink:         #111111;   /* 强调：标题、链接、当前项 */
    --text-2:      #555555;   /* 次要文字 */
    --muted:       #767676;   /* 元信息（AA 下限灰：白底 4.5:1） */
    --disabled:    #b0b0b0;

    /* 描边 */
    --border:      #ececec;   /* 卡片描边 */
    --border-2:    #f4f4f4;   /* 列表行分隔线 */
    --border-3:    #e2e2e2;   /* 输入框描边 */
    --border-4:    #e9e9e9;   /* 顶栏 / 页脚分隔线 */

    /* 主色：v3.15.5 改「烧饼黄」—— 标志块 / 主按钮用高饱和黄，
       正文强调仍走近黑（--ink），黄只出现在品牌位，可读性不受影响 */
    --brand:       #f5c518;
    --brand-hover: #e6b800;
    --brand-2:     #444444;
    --brand-fg:    #111111;
    --brand-soft:  #fdf6e0;
    --brand-line:  #f5c518;
    /* 黄底上的文字色：浅色主题用深字；深色主题黄底同样配深字（黄色明度高，
       深色模式下不该像其它语义色那样反转为浅字） */
    --on-brand:    #111111;
    /* 深底填充（--ink / 语义色做背景）上的文字颜色：
       浅色主题这些底都是深色系，用白字；深色主题里它们全部反转为浅色系，
       必须配深字，否则白字在浅灰底上完全看不见（v3.15.1 修复） */
    --on-ink:      #ffffff;

    /* 语义色 */
    --red:         #e74c3c;
    --red-soft:    #fdf0ef;
    --red-line:    rgba(231, 76, 60, .32);
    --green:       #2e9e5b;
    --green-soft:  #eefaf2;
    --green-line:  rgba(46, 158, 91, .32);
    --amber:       #b8860b;
    --amber-soft:  #fdf6e3;
    --amber-line:  rgba(184, 134, 11, .32);
    --blue:        #4a7ebb;
    --blue-soft:   #eef3fa;
    --blue-line:   rgba(74, 126, 187, .32);
    --purple:      #7c4dab;
    --purple-soft: #f3eefa;
    --purple-line: rgba(124, 77, 171, .32);
    --danger:      var(--red);
    --ok:          var(--green);
    --warn:        var(--amber);
    --info:        var(--blue);

    /* 顶栏 */
    --header-bg:       rgba(255, 255, 255, .98);
    --header-bg-solid: #ffffff;
    --header-text:     #111111;
    --header-muted:    #555555;
    --header-line:     #e9e9e9;
    --header-h:        58px;

    /* 圆角：克制 */
    --r-xs:   4px;
    --r-sm:   6px;
    --r-md:   10px;
    --r-lg:   12px;
    --r-xl:   14px;
    --r-full: 999px;
    --radius: var(--r-md);

    /* 阴影：几乎不用 */
    --shadow:   0 1px 2px rgba(0, 0, 0, .03);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .03);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, .05);
    --shadow-3: 0 10px 24px rgba(0, 0, 0, .10);
    --brand-shadow: 0 4px 10px rgba(0, 0, 0, .12);

    /* 字号阶梯 */
    --fs-xxs: 11px;
    --fs-xs:  11.5px;
    --fs-sm:  12.5px;
    --fs-md:  14px;
    --fs-lg:  16px;
    --fs-xl:  20px;

    --focus-ring: #111111;
    --focus-halo: rgba(17, 17, 17, .10);
    /* 滚动条（v3.15.6）：原写死 #c9c9c9，深色模式下右侧一条亮灰条很扎眼 */
    --scrollbar:       #c9c9c9;
    --scrollbar-hover: #aaaaaa;
    --ease: .15s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", "Courier New", monospace;
}

/* --------------------------------------------------------------------------
   2. 设计令牌 · 深色（两处内容必须保持一致）
   -------------------------------------------------------------------------- */

/* (a) 跟随系统 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg:          #141519;
        --panel:       #1e1f24;
        --panel-2:     #26272c;
        --panel-3:     #2a2b31;
        --panel-4:     #232429;
        --text:        #c9ccd4;
        --ink:         #e8eaee;
        --text-2:      #b8bcc6;
        --muted:       #8b8e97;
        --disabled:    #666a73;
        --border:      #2c2d33;
        --border-2:    #26272c;
        --border-3:    #33353c;
        --border-4:    #2a2b31;
        --brand:       #f5c518;
        --brand-hover: #ffd83d;
        --brand-2:     #8b8e97;
        --brand-fg:    #111111;
        --brand-soft:  rgba(245, 197, 24, .14);
        --brand-line:  rgba(245, 197, 24, .45);
        --on-brand:    #111111;
        --on-ink:      #141519;
        --red:         #e8837a;
        --red-soft:    rgba(232, 131, 122, .10);
        --red-line:    rgba(232, 131, 122, .30);
        --green:       #6cc48a;
        --green-soft:  rgba(108, 196, 138, .10);
        --green-line:  rgba(108, 196, 138, .30);
        --amber:       #d9ac4a;
        --amber-soft:  rgba(217, 172, 74, .10);
        --amber-line:  rgba(217, 172, 74, .30);
        --blue:        #7ba3d4;
        --blue-soft:   rgba(123, 163, 212, .10);
        --blue-line:   rgba(123, 163, 212, .30);
        --purple:      #b18ad6;
        --purple-soft: rgba(177, 138, 214, .10);
        --purple-line: rgba(177, 138, 214, .30);
        --danger:      var(--red);
        --ok:          var(--green);
        --warn:        var(--amber);
        --info:        var(--blue);
        --header-bg:       #1b1c21;
        --header-bg-solid: #1b1c21;
        --header-text:     #e8eaee;
        --header-muted:    #9aa0ab;
        --header-line:     #2a2b31;
        --shadow:   0 1px 2px rgba(0, 0, 0, .30);
        --shadow-1: 0 1px 2px rgba(0, 0, 0, .30);
        --shadow-2: 0 6px 24px rgba(0, 0, 0, .40);
        --shadow-3: 0 10px 24px rgba(0, 0, 0, .50);
        --brand-shadow: 0 4px 10px rgba(245, 197, 24, .22);
        --focus-ring: #f5c518;
        --focus-halo: rgba(245, 197, 24, .18);
        --scrollbar:       #3a3b42;
        --scrollbar-hover: #4c4d55;
    }
}

/* (b) 手动切换 */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg:          #141519;
    --panel:       #1e1f24;
    --panel-2:     #26272c;
    --panel-3:     #2a2b31;
    --panel-4:     #232429;
    --text:        #c9ccd4;
    --ink:         #e8eaee;
    --text-2:      #b8bcc6;
    --muted:       #8b8e97;
    --disabled:    #666a73;
    --border:      #2c2d33;
    --border-2:    #26272c;
    --border-3:    #33353c;
    --border-4:    #2a2b31;
    --brand:       #f5c518;
    --brand-hover: #ffd83d;
    --brand-2:     #8b8e97;
    --brand-fg:    #111111;
    --brand-soft:  rgba(245, 197, 24, .14);
    --brand-line:  rgba(245, 197, 24, .45);
    --on-brand:    #111111;
    --on-ink:      #141519;
    --red:         #e8837a;
    --red-soft:    rgba(232, 131, 122, .10);
    --red-line:    rgba(232, 131, 122, .30);
    --green:       #6cc48a;
    --green-soft:  rgba(108, 196, 138, .10);
    --green-line:  rgba(108, 196, 138, .30);
    --amber:       #d9ac4a;
    --amber-soft:  rgba(217, 172, 74, .10);
    --amber-line:  rgba(217, 172, 74, .30);
    --blue:        #7ba3d4;
    --blue-soft:   rgba(123, 163, 212, .10);
    --blue-line:   rgba(123, 163, 212, .30);
    --purple:      #b18ad6;
    --purple-soft: rgba(177, 138, 214, .10);
    --purple-line: rgba(177, 138, 214, .30);
    --danger:      var(--red);
    --ok:          var(--green);
    --warn:        var(--amber);
    --info:        var(--blue);
    --header-bg:       #1b1c21;
    --header-bg-solid: #1b1c21;
    --header-text:     #e8eaee;
    --header-muted:    #9aa0ab;
    --header-line:     #2a2b31;
    --shadow:   0 1px 2px rgba(0, 0, 0, .30);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .30);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, .40);
    --shadow-3: 0 10px 24px rgba(0, 0, 0, .50);
    --brand-shadow: 0 4px 10px rgba(245, 197, 24, .22);
    --focus-ring: #f5c518;
    --focus-halo: rgba(245, 197, 24, .18);
    --scrollbar:       #3a3b42;
    --scrollbar-hover: #4c4d55;
}

/* --------------------------------------------------------------------------
   3. 基础
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    min-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: var(--bg);
    font: var(--fs-md)/1.65 var(--font-sans);
    text-align: left;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: 17px; }
h3 { font-size: var(--fs-md); }
p  { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: #000; text-decoration: underline; }
:root[data-theme="dark"] a { color: var(--text-2); }
:root[data-theme="dark"] a:hover { color: var(--ink); text-decoration: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) a { color: var(--text-2); }
    :root:not([data-theme="light"]) a:hover { color: var(--ink); text-decoration: none; }
}
/* v3.15.5 深色补齐：五处 hover 写死 #000 的标题/用户名链接，深色下黑字
   贴深底不可读，统一改为提亮到 --ink */
:root[data-theme="dark"] .brand:hover,
:root[data-theme="dark"] .topic-title a:hover,
:root[data-theme="dark"] .author-name > a:hover,
:root[data-theme="dark"] .meta-list strong a:hover,
:root[data-theme="dark"] .post-username:hover { color: var(--ink); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .brand:hover,
    :root:not([data-theme="light"]) .topic-title a:hover,
    :root:not([data-theme="light"]) .author-name > a:hover,
    :root:not([data-theme="light"]) .meta-list strong a:hover,
    :root:not([data-theme="light"]) .post-username:hover { color: var(--ink); }
}

img { max-width: 100%; vertical-align: middle; }
hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

code {
    font-family: var(--font-mono);
    font-size: .875em;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    padding: .1em .35em;
}
mark { background: #fde68a; color: #4a3a12; padding: 0 .2em; border-radius: 3px; }
:root[data-theme="dark"] mark { background: #6a5715; color: #fde68a; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) mark { background: #6a5715; color: #fde68a; }
}

::selection { background: var(--ink); color: var(--panel); }
/* 焦点环用 outline：不受 overflow:hidden 卡片裁剪，对比度也够（v3.15.1） */
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* 行内小图标（tusi .tusi-ic：15px 描边，继承 currentColor） */
.icon {
    width: 15px; height: 15px; flex: 0 0 15px;
    color: currentColor; display: inline-block; vertical-align: -2.5px;
}

/* --------------------------------------------------------------------------
   4. 布局（tusi .tusi-container：1160px + 主列 + 300px 侧栏）
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

main.wrap { flex: 1 1 auto; padding-top: 16px; padding-bottom: 24px; }

/* 两栏：主列 + 右侧栏 */
.layout { display: flex; gap: 24px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; }
.col-side {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    /* 侧栏比视口还高时（版块多 / 卡片多）保证底部内容能滚到看到 */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
    display: grid;
    gap: 16px;
    align-content: start;
}
.col-side::-webkit-scrollbar { width: 6px; }
.col-side::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
.col-side::-webkit-scrollbar-track { background: transparent; }

/* 通用白色卡片：.card 仍被多处引用，.panel-box 已无引用（v3.15.6 清理） */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   5. 顶栏（tusi .tusi-topbar：58px 白底 + 1px 下边线）
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    color: var(--header-text);
}

.header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: var(--header-h);
    gap: 20px;
}

.brand {
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.brand:hover { color: #000; text-decoration: none; }
/* v3.15.5：品牌标志块改为黄底圆角（烧饼风）—— 字符标志居中，黄块承载主色 */
.brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    color: var(--brand-fg);
    background: var(--brand);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 顶栏节点导航：下边线式（tusi 标志性交互） */
.forum-nav { flex: 1; white-space: nowrap; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.forum-nav .forum-link {
    display: inline-block;
    color: var(--header-muted);
    margin-right: 22px;
    font-size: var(--fs-md);
    line-height: var(--header-h);
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.forum-nav .forum-link:hover { color: var(--ink); text-decoration: none; }
.forum-nav .forum-link.active {
    color: var(--ink);
    font-weight: 600;
    border-bottom-color: var(--ink);
}
.forum-nav .forum-more {
    flex: 0 0 auto;
    display: inline-block;
    color: var(--header-muted);
    font-size: var(--fs-md);
    line-height: var(--header-h);
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    padding: 0;
    cursor: pointer;
    font-weight: 400;
}
.forum-nav .forum-more:hover { color: var(--ink); }

/* 顶栏搜索：浅底描边圆角矩形，图标放右侧（对齐设计稿 v3.13.6）。
   v3.15.5：底/边/图标/占位全部改走变量 —— 深色模式下不再靠四条覆盖规则兜底 */
.search-wrap { display: flex; align-items: center; position: relative; flex: 0 0 auto; }
/* 搜索图标：绝对定位在输入框右侧 */
.search-wrap .search-icon {
    position: absolute;
    right: 12px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease;
}
.search-wrap .search-icon:hover { color: var(--ink); }
.search-wrap .search-icon svg { width: 16px; height: 16px; }
.search-wrap input:focus ~ .search-icon,
.search-wrap .search-icon:focus { color: var(--ink); }
.search-wrap input {
    /* 定宽 230px：focus 不再变宽，避免整条顶栏跟着重排、右侧图标左右跳 */
    width: 230px;
    height: 36px;
    border: 1px solid var(--border-3);
    border-radius: 9px;
    background: var(--panel-2);
    padding: 0 38px 0 13px;   /* 右侧留出图标位 */
    font: 400 var(--fs-sm)/1 var(--font-sans);
    color: var(--text);
    outline: none;
    transition: background .2s ease, border-color .2s ease;
}
.search-wrap input:focus {
    background: var(--panel);
    border-color: var(--ink);
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap button[type="submit"] { display: none; }   /* 旧版按钮占位，已由 .search-icon 接管 */
@media (max-width: 900px) {
    /* 窄屏把搜索框收窄，给导航让位 */
    .search-wrap input { width: 160px; }
}

/* 顶栏右侧：搜索框旁的用户工具条 */
.user-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 3px 4px;
    background: var(--panel-2);
    border: 1px solid var(--border-2);
    border-radius: 20px;
    white-space: nowrap;
}
.nav-link {
    color: var(--text-2);
    margin-left: 16px;
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .15s ease;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
:root[data-theme="dark"] .nav-link { color: #9aa0ab; }
:root[data-theme="dark"] .nav-link:hover { color: var(--ink); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nav-link { color: #9aa0ab; }
    :root:not([data-theme="light"]) .nav-link:hover { color: var(--ink); }
}

.site-header .btn {
    margin-left: 10px;
    min-height: 32px;
    padding: 5px 14px;
    font-size: var(--fs-sm);
    font-weight: 400;
}

/* 账号下拉 */
.nav-menu { position: relative; display: inline-flex; }
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    line-height: 0;
    overflow: hidden;
}
.nav-avatar .avatar { width: 30px; height: 30px; font-size: var(--fs-xs); }
.nav-drop {
    display: none;
    position: absolute;
    right: -4px;
    top: calc(100% + 8px);
    z-index: 200;
    background: var(--panel);
    border: 1px solid var(--header-line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    min-width: 208px;
    padding: 4px;
    text-align: left;
}
.nav-menu:hover .nav-drop, .nav-menu:focus-within .nav-drop { display: block; }
.nav-drop::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: var(--panel);
    border-left: 1px solid var(--header-line);
    border-top: 1px solid var(--header-line);
    transform: rotate(45deg);
}
.nav-drop-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 10px 11px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.nav-drop-head .avatar { width: 32px; height: 32px; font-size: var(--fs-sm); }
.nav-drop-head .group-badge { margin-left: auto; flex: none; }
.ndh-info { flex: 1; min-width: 0; }
.ndh-info strong { display: block; font-size: 13px; color: var(--ink); line-height: 1.4; }
.ndh-info span { font-size: var(--fs-xs); color: var(--muted); }
/* 分组：每组一个小标题 + 紧凑菜单项（v3.13.5） */
.nav-drop-group { padding: 4px 0; }
.nav-drop-group + .nav-drop-group { border-top: 1px solid var(--border-2); }
.nav-drop-label {
    display: block;
    padding: 3px 10px 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--disabled);
    text-transform: uppercase;
}
.nav-drop a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--r-xs);
    font-size: var(--fs-sm);
    color: var(--text-2);
    white-space: nowrap;
    line-height: 1.3;
}
.nav-drop a .icon { width: 15px; height: 15px; flex: none; color: var(--muted); }
.nav-drop a:hover { background: var(--brand-soft); color: var(--ink); text-decoration: none; }
.nav-drop a:hover .icon { color: var(--ink); }
.nav-drop a.danger { color: var(--red); }
.nav-drop a.danger .icon { color: var(--red); }
.nav-drop a.danger:hover { background: var(--red-soft); color: var(--red); }
.nav-drop-badge {
    display: inline-block;
    margin-left: auto;
    min-width: 17px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--red);
    color: var(--on-ink);
    font-size: var(--fs-xxs);
    font-weight: 600;
    line-height: 17px;
    text-align: center;
    vertical-align: 1px;
}

/* 通知铃铛 / 私信 */
.nav-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-2);
    transition: color .15s ease, background .15s ease;
}
.nav-bell:hover { color: var(--ink); background: var(--panel-3); text-decoration: none; }
.nav-bell.has-unread { color: var(--ink); }
.nav-bell .icon { width: 18px; height: 18px; }
.nav-bell-dot {
    position: absolute;
    top: 1px;
    right: 2px;
    min-width: 15px;
    padding: 0 3px;
    border-radius: var(--r-full);
    background: var(--red);
    color: var(--on-ink);
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   13c. 通知列表（notifications.php）
   -------------------------------------------------------------------------- */
.notif-list {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--border-2);
    scroll-margin-top: 74px;
    transition: background .15s ease;
}
.notif-item:first-child { border-top: none; }
.notif-item:hover { background: var(--panel-4); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item.unread:hover { background: var(--panel-3); }
.notif-avatar { flex: 0 0 auto; display: block; line-height: 0; }
.notif-avatar .avatar { width: 34px; height: 34px; font-size: 14px; }
.notif-avatar-sys {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--panel-3);
    color: var(--text-2);
    font-size: 15px;
    font-weight: 700;
}
.notif-main { flex: 1; min-width: 0; }
.notif-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.notif-actor { font-weight: 600; font-size: var(--fs-md); color: var(--ink); }
.notif-actor:hover { color: var(--ink); text-decoration: none; }
.notif-verb { font-size: var(--fs-sm); color: var(--text-2); }
.notif-when {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.notif-text {
    margin-top: 3px;
    font-size: var(--fs-md);
    color: var(--text);
    word-break: break-word;
}
.notif-title { color: var(--ink); }
.notif-title:hover { text-decoration: none; border-bottom: 1px solid var(--ink); }
.notif-excerpt { color: var(--text-2); }
.notif-text .notif-title + .notif-excerpt { margin-left: 6px; }
.notif-act {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 7px;
    font-size: var(--fs-xs);
}
.notif-act a { color: var(--muted); }
.notif-act a:hover { color: var(--ink); text-decoration: none; }
.notif-unread-num { color: var(--red); }
@media (max-width: 680px) {
    .notif-item { padding: 12px 14px; gap: 10px; }
    .notif-when { margin-left: 0; width: 100%; }
}

/* --------------------------------------------------------------------------
   13d. 举报（report.php 的被举报内容摘要 + 后台举报列表）
   -------------------------------------------------------------------------- */
.report-quote {
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
}
.report-quote-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.report-quote-meta { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.report-quote-body { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.7; }

.report-row {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-2);
}
.report-row:first-child { border-top: 0; }
.report-main { flex: 1; min-width: 0; }
.report-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: var(--fs-sm);
    color: var(--text-2);
}
.report-reason { font-weight: 600; color: var(--text); }
.report-when { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
.report-body {
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--panel-2);
    border-left: 3px solid var(--border-3);
    border-radius: var(--r-xs);
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.7;
}
.report-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-xs); }
@media (max-width: 680px) {
    .report-row { padding: 12px 14px; }
    .report-when { margin-left: 0; width: 100%; }
}

/* 主题切换 */
.theme-toggle {
    margin-left: 16px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text-2);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color .15s ease, background .15s ease;
}
.theme-toggle:hover { color: var(--ink); background: var(--brand-soft); }
/* 深色下显示太阳（提示"切回浅色"）。v3.15.6 修：原只覆盖手动切换分支，
   「跟随系统」处于深色时图标仍是月亮 —— 语义反了 */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun  { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .i-sun  { display: inline; }
    :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* --------------------------------------------------------------------------
   6. 版块页横幅 + 节点网格
   -------------------------------------------------------------------------- */
/* v3.15.6 清理：.forum-strip（节点横条）已无任何模板引用，整块删除 */

/* --------------------------------------------------------------------------
   7. 列表头卡片 + 排序 Tab（tusi .tusi-list-header：48px 白卡片）
   -------------------------------------------------------------------------- */
.topic-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 12px;
    padding: 0 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    height: 48px;
}
.topic-toolbar .tab-bar {
    flex: 1; min-width: 0; margin: 0; padding: 0;
    background: none; border: 0; border-radius: 0;
    height: auto; gap: 22px; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.topic-toolbar .tab-bar::-webkit-scrollbar { display: none; }
.topic-toolbar .tab { height: auto; line-height: 1.9; }
.topic-toolbar .tab-post { flex-shrink: 0; margin-left: auto; }
/* 窄屏 tab 溢出提示（v3.15.6）：滚动条被隐藏后用户不知道右边还有「红包/抽奖」，
   由 app.js 依据 scrollWidth 打上 can-left / can-right，用遮罩做边缘渐隐。
   遮罩挂在滚动容器上，位置固定在元素框边缘，内容在下面滚过去。 */
@media (max-width: 680px) {
    .tab-bar.can-right {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
    }
    .tab-bar.can-left {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px);
        mask-image: linear-gradient(90deg, transparent, #000 30px);
    }
    .tab-bar.can-left.can-right {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
    }
}

.tab-bar {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0 0 12px;
    padding: 0 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    height: 48px;
    /* v3.13.5：横向可滚但**不显示滚动条**（原来溢出时会露出丑陋的滚动条） */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    font-size: var(--fs-md);
    color: var(--text-2);
    line-height: 1;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex: 0 0 auto;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   8. 帖子列表（tusi .tusi-threadlist：白卡片圆角 10px）
   -------------------------------------------------------------------------- */
/* v3.15.6 清理：.featured / .featured-icon / .featured-body / .featured-line
   （旧「置顶区」整块布局）已无模板引用，置顶帖改用行内 .is-sticky 高亮 */
.topic-list, .main-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
.list-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.list-head .tip { font-size: var(--fs-sm); }

/* 帖子行（tusi .tusi-thread-item） */
.topic-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-2);
    transition: background .12s ease;
}
.topic-row:first-child { border-top: 0; }
.topic-row:hover { background: var(--panel-4); }
/* 置顶帖行（v3.15.6）：淡黄底 + 左侧色条，扫一眼就知道哪条是公告 ——
   原先只有标题前一个「置顶」灰标签，混在列表里不显眼 */
.topic-row.is-sticky {
    background: var(--brand-soft);
    box-shadow: inset 3px 0 0 var(--brand);
}
.topic-row.is-sticky:hover { background: var(--brand-soft); filter: brightness(.985); }

.topic-avatar { flex-shrink: 0; display: block; line-height: 0; }

.topic-main { flex: 1; min-width: 0; }
.topic-title {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 5px;
    word-break: break-word;
    /* v3.15.6：整块改 flex —— 标签在最前、标题占剩余宽度并截到 2 行。
       原先纯 inline 流 + 100 字标题会撑到 3-4 行，列表节奏全乱；
       只用 max-height 又会把第 2 行硬切（没有省略号）。
       注意 -webkit-line-clamp 必须落在单一盒子上，所以标签与标题要分成两个盒。 */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 6px;
}
.topic-title .tag { margin-right: 0; }          /* 间距交给上面的 gap，避免双份 */
.topic-title > a {
    flex: 1 1 auto;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.topic-title a { color: var(--ink); font-weight: 500; }
.topic-title a:hover { color: #000; text-decoration: none; }
:root[data-theme="dark"] .topic-title a { color: var(--ink); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .topic-title a { color: var(--ink); }
}

.topic-meta {
    font-size: var(--fs-sm);
    color: var(--muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 14px;
}
.topic-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.topic-meta .icon { color: var(--muted); }
.topic-meta a { color: var(--text-2); }
.topic-meta a:hover { color: var(--ink); text-decoration: none; }
.topic-meta .sep { color: var(--border); }

/* v3.15.6 清理：.topic-last（右侧「最后回复」列）—— index/board/tag/search/user
   五个列表页已统一为「meta 行放最后回复人 + .topic-end 放版块徽标」，
   原右列样式没人再用。插件若要沿用旧结构，请改用 .topic-end。 */

/* 右侧板块徽章（tusi .tusi-cat） */
.row-badge {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-block;
    background: var(--panel-3);
    color: var(--text-2);
    padding: 1px 8px;
    border-radius: var(--r-xs);
    font-size: var(--fs-xs);
}
.row-badge:hover { background: var(--panel-3); color: var(--ink); text-decoration: none; }
/* 放在 .topic-meta 里时不参与右侧对齐 */
.topic-meta .row-badge { margin-left: 0; }

/* ---- v3.15.5 行尾版块徽标列：烧饼风列表行结构 ----
   版块徽标从 meta 行移到行尾独立列（灰底圆角小徽章），meta 行腾出位置
   放「发帖时间 + 最后回复人」，信息密度对齐参考稿。 */
.topic-end {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 64px;
    justify-content: flex-end;
}
.topic-end .row-badge {
    margin-left: 0;
    padding: 2px 10px;
    border-radius: var(--r-full);
    color: var(--muted);
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topic-end .row-badge:hover { background: var(--brand-soft); color: var(--text); }
.topic-meta .meta-time { color: var(--muted); }
.topic-meta .meta-last { color: var(--muted); }
.topic-meta .meta-last .icon { opacity: .7; }

/* ---- 侧栏「今日热门」排行榜（v3.15.5）：序号前三高亮 ---- */
.side-rank {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}
.side-rank li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.side-rank li + li { border-top: 1px solid var(--border-2); }
.side-rank .sr-no {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: var(--panel-3);
    color: var(--muted);
    font-size: var(--fs-xxs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.side-rank .sr-no-1 { background: var(--red);   color: var(--on-ink); }
.side-rank .sr-no-2 { background: var(--amber); color: var(--on-ink); }
.side-rank .sr-no-3 { background: var(--blue);  color: var(--on-ink); }
.side-rank li > a {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-rank li > a:hover { color: var(--ink); text-decoration: none; }
.side-rank .sr-num {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: var(--fs-xxs);
    font-variant-numeric: tabular-nums;
}

/* ---- 侧栏「最新帖子」（v3.15.5）：纯列表 + 标题前小圆点 ---- */
.side-newlist {
    margin: 0;
    padding: 0;
    list-style: none;
}
.side-newlist li {
    padding: 6px 0;
    font-size: var(--fs-sm);
    line-height: 1.55;
    border-bottom: 1px solid var(--border-2);
}
.side-newlist li:last-child { border-bottom: 0; padding-bottom: 0; }
.side-newlist li:first-child { padding-top: 0; }
.side-newlist a {
    display: block;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-newlist a::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand);
    margin-right: 7px;
    vertical-align: 2.5px;
}
.side-newlist a:hover { color: var(--ink); text-decoration: none; }

/* v3.15.6 清理：.topic-count（旧回复数徽章）已无模板引用 —— 回复数现在在
   .topic-meta 里以「图标 + 数字」呈现 */

.excerpt, .post-excerpt {
    color: var(--muted);
    font-size: var(--fs-sm);
    margin-top: 3px;
    word-break: break-word;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chip {
    display: inline-flex;
    align-items: center;
    background: var(--panel-3);
    border-radius: var(--r-xs);
    padding: 0 8px;
    height: 19px;
    font-size: var(--fs-xs);
    color: var(--text-2);
}
a.chip:hover { background: var(--ink); color: var(--on-ink); text-decoration: none; }

/* 元信息里的作者名（tusi .tusi-author） */
.topic-meta .meta-author { color: var(--text-2); font-weight: 500; }
.topic-meta .meta-author:hover { color: var(--ink); text-decoration: none; }

/* 标签（tusi .tusi-badge：默认灰底，置顶黑底白字） */
.tag {
    display: inline-block;
    font-size: var(--fs-xxs);
    color: var(--text-2);
    background: var(--panel-3);
    border-radius: var(--r-xs);
    padding: 1px 6px;
    margin-right: 6px;
    vertical-align: 1px;
}
.tag-sticky { color: var(--on-ink); background: var(--ink); }
.tag-locked { color: var(--on-ink); background: var(--blue); }
.tag-digest { color: var(--ink); background: var(--panel); border: 1px solid var(--ink); padding: 0 5px; }
.tag-hidden { color: var(--on-ink); background: var(--red); }

/* ---- 主题类型标签（v3.11.0 起，v3.13.3 强化）：4 类各一色，全部走变量保证深色可读 ---- */
.tag.type-normal   { color: var(--text-2); background: var(--panel-3); }
.tag.type-bounty   { color: var(--on-ink); background: var(--amber); }
.tag.type-vote     { color: var(--on-ink); background: var(--blue); }
.tag.type-lottery  { color: var(--on-ink); background: var(--purple); }
.tag.type-redpack  { color: var(--on-ink); background: var(--red); }
/* 类型标签更醒目一点：比普通 tag 略重，保证标题前一眼可辨 */
.topic-title .tag[class*="type-"],
h1 > .tag[class*="type-"],
.post-head .tag[class*="type-"] { font-weight: 600; letter-spacing: .02em; }

/* UID 标签：紧跟用户名后的小灰标 */
.uid-label {
    display: inline-block;
    font-size: var(--fs-xxs);
    color: var(--muted);
    background: var(--panel-3);
    border: 1px solid var(--border-3);
    border-radius: var(--r-xs);
    padding: 0 5px;
    line-height: 1.5;
    vertical-align: 1px;
    cursor: default;
}
.post-author .uid-label { margin-left: 4px; }
.author-uid { margin-top: 4px; }

/* 通用：次要文字。多处提示行复用，别写一堆各自为政的灰色 */
.muted { color: var(--muted); }

/* 被隐藏的内容：整块压成灰底，正文只在有权限时渲染 */
.post-hidden { background: var(--panel-2); }
.post-hidden .muted { font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   10. 侧栏卡片（tusi .tusi-side-box：padding 18px 20px）
   -------------------------------------------------------------------------- */
.side-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    padding: 18px 20px;
}
.side-title {
    margin: 0 0 10px;
    padding: 0;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.side-title .icon { color: var(--ink); }
.side-title span { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.side-body { padding: 0; }

/* 侧栏个人信息卡（v3.13.4 重构：头部 + 4 格统计 + 两列图标菜单 + 发帖按钮） */
.user-card { padding: 14px 14px 14px; position: relative; }

/* ---- 右上角在线状态（v3.13.5）---- */
.up-online {
    position: absolute;
    top: 13px;
    right: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xxs);
    color: var(--muted);
    line-height: 1;
    pointer-events: none;
}
.up-online.on { color: #16a34a; }
/* v3.15.5 深色适配：在线文字提亮一档（#16a34a 在深底上偏暗） */
:root[data-theme="dark"] .up-online.on { color: #4ade80; }
.uc-online.on { color: #16a34a; }
:root[data-theme="dark"] .uc-online.on { color: #4ade80; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .up-online.on,
    :root:not([data-theme="light"]) .uc-online.on { color: #4ade80; }
}
.up-online .presence-dot {
    position: static;
    border: 0;
    width: 7px;
    height: 7px;
}
.up-online .presence-dot.on  { box-shadow: 0 0 0 2px rgba(34, 197, 94, .18); }
.up-online .presence-dot.off { box-shadow: inset 0 0 0 1px var(--muted); }

/* ---- 头部：头像 + 用户名 + 等级行 ---- */
.up-head { display: flex; align-items: center; gap: 11px; }
.up-avatar {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 0 0 1px var(--border);
}
.up-avatar .avatar { width: 46px; height: 46px; font-size: 19px; }
.up-info { flex: 1; min-width: 0; }
.up-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}
.up-name a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-name a:hover { text-decoration: underline; }
.up-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.up-dot { color: var(--muted); font-size: var(--fs-xs); }
.up-title { font-size: var(--fs-xs); color: var(--text-2); }

/* ---- 4 格统计：积分 / 成长值 / 主题 / 精华 ---- */
.up-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--border-2);
}
.up-stats a {
    position: relative;
    display: block;
    text-align: center;
    min-width: 0;
    text-decoration: none;
    padding: 2px 0;
    border-radius: var(--r-xs);
    transition: background var(--ease);
}
.up-stats a:hover { background: var(--panel-3); }
.up-stats a + a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 22px;
    margin-top: -11px;
    background: var(--border-2);
    pointer-events: none;
}
.up-stats strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.up-stats span {
    display: block;
    margin-top: 1px;
    font-size: var(--fs-xs);
    color: var(--muted);
    white-space: nowrap;
}

/* ---- 两列图标菜单 ---- */
.up-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-2);
}
.up-menu a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    color: var(--text-2);
    text-decoration: none;
    min-width: 0;
    transition: background var(--ease), color var(--ease);
}
.up-menu a:hover { background: var(--panel-3); color: var(--ink); }
.up-menu a .icon { flex: none; width: 15px; height: 15px; opacity: .75; }
.up-menu a:hover .icon { opacity: 1; }
.up-menu a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 底部发帖按钮 ---- */
.user-card .up-post { margin-top: 12px; margin-bottom: 0; }

.guest-card .guest-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.guest-card p { margin: 0; font-size: var(--fs-sm); }
.guest-card .user-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.guest-card .user-card-actions.one { grid-template-columns: 1fr; }
.guest-card .user-card-actions .btn { margin: 0 !important; text-align: center; }

/* --------------------------------------------------------------------------
   10b. 积分明细（v3.9.0）
   -------------------------------------------------------------------------- */
.points-panel { margin-top: 6px; }
.points-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.points-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    text-align: center;
}
.points-card strong {
    display: block;
    font-size: var(--fs-xl);
    color: var(--ink);
    line-height: 1.2;
}
.points-card span { font-size: var(--fs-xs); color: var(--muted); }
.points-rules {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.points-rules h3 { margin: 0 0 10px; font-size: var(--fs-md); color: var(--ink); }
.points-rules ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.9; }
.points-log-title { margin: 0 0 10px; font-size: var(--fs-md); color: var(--ink); }
.points-table {
    width: 100%;
    /* separate + spacing 0：collapse 模式下 border-radius 不生效，圆角会被吃掉 */
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    font-size: var(--fs-sm);
}
.points-table th,
.points-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    text-align: left;
}
.points-table th { background: var(--panel-2); color: var(--text-2); font-weight: 600; }
.points-table tr:last-child td { border-bottom: none; }
.points-plus { color: var(--green); font-weight: 600; }
.points-minus { color: var(--red); font-weight: 600; }
@media (max-width: 720px) {
    .points-overview { grid-template-columns: 1fr; }
    .points-table th, .points-table td { padding: 8px; font-size: var(--fs-xs); }
}

/* 版块导航树 */
.node-list { display: flex; flex-direction: column; font-size: var(--fs-sm); line-height: 2.2; }
.node-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}
.node-list a:hover { color: var(--ink); text-decoration: none; }
.node-list a.on { color: var(--ink); font-weight: 600; }
.node-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-3); flex: 0 0 auto; }
.node-list .node-num { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }

/* 三格统计（v3.13.8 站点统计）：标签在上、数字在下，无边框无分隔线 */
.side-stat-3 {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    gap: 6px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: none;
    text-align: center;
}
.side-stat-3 > div {
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    position: static;
    text-align: center;
}
.side-stat-3 > div + div::before { display: none; }
.side-stat-3 span {
    display: block;
    margin: 0 0 5px;
    font-size: var(--fs-xs);
    color: var(--muted);
}
.side-stat-3 strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* 侧栏统计：自动按格数均衡铺开（1-4 格都能排整齐），相邻格之间用极细分隔线 */
.side-stat {
    display: grid;
    grid-template-columns: repeat(var(--stat-cols, 3), 1fr);
    gap: 0;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.side-stat div {
    position: relative;
    text-align: center;
    /* v3.13.5：与个人卡 .up-stats 统一字号 / 内距，两处数字不再一大一小 */
    padding: 11px 4px 10px;
}
/* 非首格左侧加竖线；换行时（2 列布局的第 3 格起）改为顶部横线 */
.side-stat div + div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    width: 1px;
    height: 64%;
    background: var(--border-2);
}
.side-stat strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.25;
}
.side-stat span { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; display: block; }

/* 两格：并排一行 */
.side-stat:has(> div:only-child),
.side-stat { --stat-cols: 3; }
.side-stat:has(> div:nth-child(2):last-child) { --stat-cols: 2; }
.side-stat:has(> div:only-child) { --stat-cols: 1; }
/* 四格：2×2 网格 */
.side-stat:has(> div:nth-child(4)) { --stat-cols: 2; }
.side-stat:has(> div:nth-child(4)) div:nth-child(1),
.side-stat:has(> div:nth-child(4)) div:nth-child(2) { border-bottom: 1px solid var(--border-2); }
.side-stat:has(> div:nth-child(4)) div:nth-child(1)::before,
.side-stat:has(> div:nth-child(4)) div:nth-child(3)::before { display: none; }

/* 最新用户：头像 + 用户名上下排列的两行网格（v3.13.8，对齐参考稿） */
.side-new-users { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-2); }
.snu-head { margin-bottom: 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.snu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
}
.snu-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-decoration: none;
    color: var(--text-2);
}
.snu-cell:hover { color: var(--ink); text-decoration: none; }
.snu-cell .avatar { width: 38px; height: 38px; font-size: 15px; border-radius: 9px; }
.snu-cell span {
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--fs-xxs); text-align: center;
}
/* v3.15.6 清理：.snu-list / .snu-item（旧版小标签式"最新用户"）与
   .side-user（旧版侧栏用户行）全站已无引用，最新用户统一用 .snu-grid 头像网格 */

/* 主题页侧栏：作者个人信息卡片 */
.author-card { text-align: center; }
.author-card .side-title { justify-content: center; }
.author-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.author-name { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.author-name > a {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    word-break: break-all;
}
.author-name > a:hover { color: #000; text-decoration: none; }
.author-bio {
    margin: 12px 0 0;
    font-size: var(--fs-sm);
    color: var(--muted);
    line-height: 1.7;
    text-align: left;
    word-break: break-word;
}
.author-card .side-stat { margin-top: 14px; }
.author-meta {
    list-style: none;
    margin: 12px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border-2);
    font-size: var(--fs-xs);
}
.author-meta li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    line-height: 2.15;
    color: var(--muted);
}
.author-meta li span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; }
.author-card .btn-block { margin-top: 12px; }

/* v3.13.5：主题作者并入「本帖数据」卡片顶部的一行（原独立卡片已移除） */
.topic-author-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-2);
}
.topic-author-line .tal-av { flex: none; line-height: 0; }
.topic-author-line .tal-av .avatar { width: 36px; height: 36px; font-size: 15px; }
.topic-author-line .tal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topic-author-line .tal-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topic-author-line .tal-name:hover { text-decoration: underline; }
.topic-author-line .tal-sub { font-size: var(--fs-xxs); color: var(--muted); }

/* 侧栏键值列表（帖子数据 / 统计明细） */
.meta-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.meta-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--border-2);
}
.meta-list li:first-child { border-top: 0; padding-top: 0; }
.meta-list li:last-child { padding-bottom: 0; }
.meta-list span { color: var(--muted); flex: 0 0 auto; }
.meta-list strong {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-list strong a { color: var(--ink); }
.meta-list strong a:hover { color: #000; }

/* --------------------------------------------------------------------------
   11. 版块页横幅（tusi .tusi-forum-banner）
   -------------------------------------------------------------------------- */
.forum-banner {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 24px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.forum-banner-text { min-width: 0; flex: 1; }
.forum-banner h1 { margin: 0; font-size: var(--fs-xl); font-weight: 800; color: var(--ink); line-height: 1.3; }
.forum-banner .page-desc { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.forum-banner .btn { flex-shrink: 0; }

/* v3.15.6 清理：.board-grid / .board-card / .board-dot / .board-name /
   .board-desc / .board-meta（旧版「板块卡片网格」）与 .hero 系列
   （首页深色横幅）全站无引用，板块入口现由侧栏「所有节点」+ 顶栏导航承担 */


/* --------------------------------------------------------------------------
   12. 页头 / 面包屑
   -------------------------------------------------------------------------- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.page-head h1 { margin: 6px 0 4px; font-size: var(--fs-xl); font-weight: 800; letter-spacing: .3px; }
.page-desc { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.crumbs {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-sm);
    color: var(--muted);
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-md);
    font-weight: 700;
    margin: 20px 0 10px;
    padding: 0;
    border: none;
    color: var(--ink);
}
.section-title .icon { color: var(--ink); }
.card-form > .section-title:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   13. 帖子详情（tusi .tusi-post：白卡 + 浅灰头部横排 + 正文区）
        帖子头部：头像 38px | 用户名 + 组徽章 + 楼主标 + N帖 | 楼层 | 时间
        正文区独立 padding，底部操作行虚线上边线靠右
   -------------------------------------------------------------------------- */
.post {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    overflow: hidden;
    scroll-margin-top: 74px;
    transition: border-color .15s ease;
}
.post:hover { border-color: var(--border-3); }
.post:target { border-color: var(--ink); }
/* 回帖后跳到新楼（URL 带 #reply-N）：短暂高亮一下，让用户确认发到了哪层 */
.post:target, .sub-item:target { animation: pb-target-flash 1.8s ease .15s both; }
@keyframes pb-target-flash {
    0%   { box-shadow: 0 0 0 3px var(--focus-halo), 0 0 0 1px var(--ink); }
    70%  { box-shadow: 0 0 0 3px var(--focus-halo), 0 0 0 1px var(--ink); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}
.post-op { border-color: var(--border-3); }

/* 帖子头部横排（tusi .tusi-post-head：浅灰底 + 下边线） */
.post-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-2);
    background: var(--panel-4);
}
.post-avatar { flex: 0 0 auto; display: block; line-height: 0; }
.post-avatar .avatar { width: 38px; height: 38px; font-size: 16px; }
.post-author {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
}
.post-username {
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.post-username:hover { color: #000; text-decoration: none; }
.post-activity { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.post-badge {
    padding: 1px 6px;
    border-radius: var(--r-xs);
    background: var(--ink);
    color: var(--on-ink);
    font-size: var(--fs-xxs);
    font-weight: 600;
    line-height: 17px;
}
.post-floor {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
    color: #dcdcdc;
    letter-spacing: .3px;
    font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .post-floor { color: #43454e; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .post-floor { color: #43454e; }
}
.post-when {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
/* 窄头部：楼层和时间都要保住，作者名先缩 */
@media (max-width: 680px) {
    .post-head { padding: 11px 14px; gap: 8px; }
    .post-username { max-width: 130px; font-size: var(--fs-sm); }
    .post-activity { display: none; }
    .post-floor { font-size: 13px; }
}

/* 正文区（tusi .tusi-post-content：18/22/20 内边距） */
.post-content {
    padding: 18px 22px 20px;
    font-size: 15px;
    line-height: 1.85;
    word-break: break-word;
}
.post-content a { word-break: break-all; }

/* 底部操作行（编辑 / 删除 / 置顶 / 锁定 / 插件钩子），靠右 */
.post-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 22px;
    padding: 9px 0 14px;
    border-top: 1px solid var(--border-2);
    font-size: var(--fs-sm);
}
.post-foot a { color: var(--muted); }
.post-foot a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 680px) {
    .post-foot { margin: 0 14px; justify-content: flex-start; }
}

/* 楼层操作：回复 / 引用（与编辑 / 删除同一行，靠右排） */
.post-act { color: var(--muted); white-space: nowrap; }
.post-act:hover { color: var(--ink); text-decoration: none; }

/* --------------------------------------------------------------------------
   13b. 楼中楼（子回复）
        只做两层：主楼层（parent_id = 0）下面平铺一排小卡，
        小卡共用 .post-content 的 Markdown 样式，只是更紧凑。
   -------------------------------------------------------------------------- */
.sub-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 22px 18px;
    padding: 6px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.sub-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    scroll-margin-top: 74px;
    transition: border-color .15s ease;
}
.sub-item:hover { border-color: var(--border-3); }
.sub-item:target { border-color: var(--ink); }
.sub-avatar { flex: 0 0 auto; display: block; line-height: 0; }
.sub-avatar .avatar { width: 28px; height: 28px; font-size: 12px; }
.sub-main { flex: 1; min-width: 0; }
.sub-meta {
    display: flex;
    align-items: center;
    gap: 4px 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}
.sub-name { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.sub-name:hover { color: var(--ink); text-decoration: none; }
.sub-when {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
/* 覆盖 .post-content 的正文内边距与字号，Markdown 样式照旧复用 */
.sub-body {
    padding: 0;
    font-size: 14px;
    line-height: 1.75;
}
.sub-act {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 7px;
    font-size: var(--fs-xs);
}
.sub-act a { color: var(--muted); }
.sub-act a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 680px) {
    .sub-list { margin: 0 14px 14px; }
    .sub-item { padding: 9px 10px; gap: 8px; }
}

/* 回复框上方的「正在回复某人」提示条 */
.reply-target {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    color: var(--text-2);
}
.reply-target[hidden] { display: none; }
.reply-target .rt-user { color: var(--ink); }
.reply-target .rt-cancel {
    margin-left: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    cursor: pointer;
}
.reply-target .rt-cancel:hover { color: var(--ink); }

.reply-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 22px;
    margin-top: 16px;
    scroll-margin-top: 74px;
}
.reply-box h3 { margin: 0 0 14px; font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.reply-box:target { border-color: var(--ink); }

/* 主题页标题卡（tusi .tusi-post-header：面包屑 + 大标题 + 元信息 + 右侧操作） */
.topic-header {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 22px 16px;
    margin-bottom: 12px;
}
.topic-header .page-head { margin-bottom: 0; align-items: center; }
.topic-header h1 { font-size: 21px; line-height: 1.4; margin: 8px 0 6px; }
@media (max-width: 680px) {
    .topic-header { padding: 15px 14px 13px; }
    .topic-header h1 { font-size: 18px; }
}

/* --------------------------------------------------------------------------
   14. 头像（tusi：44px 圆形 + 1px 描边）
   -------------------------------------------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* v3.13.5：整站头像由圆形改为「正方形 + 小圆角」 */
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    user-select: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar-md { width: 44px; height: 44px; font-size: var(--fs-lg); }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 27px; }

/* ---- 在线状态（v3.13.5）---- */
/* 行内圆点：在线绿色实心，离线灰色空心 */
.presence {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    vertical-align: middle;
    flex: none;
}
.presence.on  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, .18); }
.presence.off { background: #cbd0d8; box-shadow: inset 0 0 0 1px #b6bcc6; }
[data-theme="dark"] .presence.off { background: #4a5158; box-shadow: inset 0 0 0 1px #5c636b; }
@media (prefers-color-scheme: dark) {
    .presence.off { background: #4a5158; box-shadow: inset 0 0 0 1px #5c636b; }
}
/* 头像右下角角标 */
.av-wrap { position: relative; display: inline-block; line-height: 0; }
.presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--panel);
    box-sizing: content-box;
}
.av-wrap-sm .presence-dot { width: 8px;  height: 8px;  right: -3px; bottom: -3px; }
.av-wrap-lg .presence-dot { width: 11px; height: 11px; }
.av-wrap-xl .presence-dot { width: 13px; height: 13px; }
.presence-dot.on  { background: #22c55e; }
.presence-dot.off { background: #cbd0d8; }
[data-theme="dark"] .presence-dot.off { background: #4a5158; }
@media (prefers-color-scheme: dark) {
    .presence-dot.off { background: #4a5158; }
}
/* 悬浮名片的在线文字块本轮已改绝对定位（v3.13.7，见 .uc-online） */
/* 侧栏个人卡 / 作者卡里的小圆点跟随文字色，补点间距 */
.up-meta .presence { margin: 0 1px; }
.author-name .presence { margin-left: 4px; }
.profile-head h1 .presence { margin-left: 4px; }

/* 自定义头像：<img> 版，靠 object-fit 保证不变形（无 GD 未裁剪时尤其重要） */
img.avatar {
    display: inline-block;
    object-fit: cover;
    background: var(--panel-2);
    border: 1px solid var(--border);
    text-shadow: none;
}

/* 头像设置区 */
.avatar-card { margin-bottom: 16px; }
.avatar-edit {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}
.avatar-preview {
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-2);
    line-height: 0;
}
.avatar-preview .avatar { border-radius: 10px; }
.avatar-edit-main { flex: 1 1 260px; min-width: 0; }
.avatar-file {
    display: block;
    width: 100%;
    max-width: 360px;
    margin-bottom: 8px;
    padding: 8px;
    font-size: var(--fs-sm);
    color: var(--text-2);
    background: var(--panel);
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
}
.avatar-status {
    display: block;
    min-height: 18px;
    font-size: var(--fs-sm);
    color: var(--muted);
}
.avatar-status.bad { color: var(--red); }
.avatar-status.ok { color: var(--green); }

/* ---- 修改用户名（v3.13.5） ---- */
.rename-current {
    font-size: var(--fs-sm);
    color: var(--text-2);
    margin-bottom: 12px;
}
.rename-current strong { color: var(--ink); }
.rename-history {
    margin-left: 8px;
    font-size: var(--fs-xs);
    color: var(--muted);
    background: var(--panel-3);
    padding: 1px 7px;
    border-radius: var(--r-full);
}
.rename-blocked {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    font-size: var(--fs-sm);
    color: var(--muted);
    line-height: 1.7;
}
.rename-input-row { display: flex; gap: 8px; align-items: center; }
.rename-input-row input { flex: 1; min-width: 0; }
.rename-input-row .btn { flex: none; white-space: nowrap; }
.rename-msg { min-height: 17px; margin: 6px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.rename-msg.ok  { color: var(--green); }
.rename-msg.bad { color: var(--red); }
.rename-tip { margin: 4px 0 14px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.75; }
.rename-tip strong { color: var(--ink); }
.avatar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-2);
}
.hidden-form { display: none; }

/* ---------- 隐私设置（v3.13.8）：开关式选项 ---------- */
.privacy-intro {
    margin: -2px 0 18px;
    font-size: var(--fs-xs);
    color: var(--muted);
    line-height: 1.7;
}
.privacy-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-2);
    cursor: pointer;
}
.privacy-row:first-of-type { padding-top: 4px; }
.privacy-row:last-of-type { border-bottom: 0; }
.privacy-switch { position: relative; flex: none; display: inline-flex; padding-top: 1px; }
.privacy-switch input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    margin: 0;
}
.privacy-track {
    display: inline-block;
    width: 40px; height: 23px;
    border-radius: 999px;
    background: var(--border-3);
    transition: background .18s ease;
    position: relative;
}
.privacy-knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: var(--panel);   /* v3.15.5：走面板色，深色模式下开关球不会突兀发白 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    transition: transform .18s ease;
}
.privacy-switch input:checked + .privacy-track { background: var(--ink); }
.privacy-switch input:checked + .privacy-track .privacy-knob { transform: translateX(17px); }
.privacy-switch input:focus-visible + .privacy-track { outline: 2px solid var(--ink); outline-offset: 2px; }
.privacy-text { flex: 1 1 auto; min-width: 0; }
.privacy-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); line-height: 1.6; }
.privacy-desc { display: block; margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.75; }
.privacy-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-2); }

/* 隐私受限提示（游客视角）：主页整块 / 帖子正文内联 */
.privacy-locked { margin-bottom: 12px; }
.privacy-locked .eb-desc a { color: var(--ink); border-bottom: 1px solid var(--border-2); }
.privacy-locked-inline {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 18px;
    background: var(--panel-2);
    border: 1px dashed var(--border-2);
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.7;
}
.privacy-locked-inline a { color: var(--ink); border-bottom: 1px solid var(--border-2); }

/* 后台用户表里的头像 + 用户名 */
.admin-user { display: flex; align-items: center; gap: 9px; }
.admin-user .avatar { width: 26px; height: 26px; font-size: var(--fs-xxs); }

/* --------------------------------------------------------------------------
   15. 按钮（tusi .tusi-btn：黑底白字，圆角 6px）
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    background: var(--brand);
    color: var(--brand-fg);
    padding: 8px 20px;
    font: 400 var(--fs-sm)/1.4 var(--font-sans);
    border: 1px solid var(--brand);
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    margin: 2px;
    transition: background .15s ease, border-color .15s ease, color .15s ease,
                transform .15s ease, box-shadow .15s ease, opacity .15s ease, filter .15s ease;
}
.btn:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: var(--brand-fg);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--brand-shadow);
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); border-radius: 999px; }
/* hover：浅色主题压到纯黑（--brand-fg 白字成立）；深色主题 --ink 是浅色，
   hover 反而要再提亮一档而不是写死 #000（黑底黑字不可读，v3.15.5 修复） */
.btn-primary:hover { background: #000; border-color: #000; color: var(--brand-fg); }
:root[data-theme="dark"] .btn-primary:hover {
    background: #f5f7fb; border-color: #f5f7fb; color: #141519;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn-primary:hover {
        background: #f5f7fb; border-color: #f5f7fb; color: #141519;
    }
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
/* 禁用态统一处理：任何 .btn 变体（含 .btn-danger）被 disabled 时都要明显变灰，
   否则红色按钮看起来完全可点，用户点了没反应会以为坏了（v3.13.6 修复）。 */
.btn:disabled,
.btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    filter: saturate(.3);
    transform: none !important;
    box-shadow: none !important;
}
.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
}
.btn-danger { background: var(--red); border-color: var(--red); color: var(--on-ink); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: var(--on-ink); filter: brightness(1.05); }
.btn-gray { background: var(--panel-2); color: var(--text-2); border-color: var(--border-3); }
.btn-gray:hover { background: var(--border); color: var(--ink); box-shadow: none; }
.btn-sm { padding: 5px 14px; font-size: var(--fs-xs); }
.btn-xs { padding: 3px 10px; font-size: 11px; }
.btn-lg { padding: 10px 26px; font-size: var(--fs-md); }
.btn-block { display: block; width: 100%; margin: 2px 0 8px; text-align: center; }

.linkbtn {
    background: none; border: none; color: var(--muted);
    cursor: pointer; font: inherit; font-size: var(--fs-sm); padding: 0;
    transition: color .15s ease;
}
.linkbtn:hover { color: var(--ink); text-decoration: underline; }
.linkbtn.danger { color: var(--red); }
.danger { color: var(--red); }
.inline-form { display: inline; margin: 0; }

/* --------------------------------------------------------------------------
   16. 提示 / 空状态
   -------------------------------------------------------------------------- */
.alert {
    border-radius: var(--r-md);
    padding: 11px 16px;
    margin: 0 0 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.65;
}
.alert-ok   { background: var(--green-soft); border-color: var(--green-line);  color: var(--green); }
.alert-warn { background: var(--amber-soft); border-color: var(--amber-line);  color: var(--amber); }
.alert-bad  { background: var(--red-soft);   border-color: var(--red-line);    color: var(--red); }

.notice-bar {
    background: var(--panel-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 16px;
    margin-bottom: 12px;
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.65;
}
.empty {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 44px 40px;
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
}
.topic-list .empty, .main-panel .empty { border: none; border-radius: 0; }
.tip { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }

/* --------------------------------------------------------------------------
   17. 表单
   -------------------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=number], .field select, .field textarea,
.card-form textarea, .reply-box textarea,
.search-page-form input {
    width: 100%;
    padding: 8px 11px;
    font: 400 var(--fs-sm)/1.6 var(--font-sans);
    color: var(--text);      /* v3.15.5：原写死 #333，深色模式下输入黑字几乎不可读 */
    background: var(--panel);
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea, .card-form textarea, .reply-box textarea { resize: vertical; min-height: 88px; }
.field input::placeholder, .field textarea::placeholder { color: var(--disabled); opacity: 1; }
.field input:focus, .field textarea:focus, .field select:focus,
.card-form textarea:focus, .reply-box textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--focus-halo);
}
.field input:disabled { opacity: .6; cursor: not-allowed; }
.field .tip { display: block; margin-top: 6px; font-weight: 400; }

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5l4-4' stroke='%23555555' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    cursor: pointer;
}
:root[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5l4-4' stroke='%238b8e97' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5l4-4' stroke='%238b8e97' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}

input[type=checkbox], input[type=radio] {
    width: 15px; height: 15px; accent-color: var(--ink);
    cursor: pointer; vertical-align: -2px; margin-right: 5px;
}

/* 验证码：输入框 + 图片并排 */
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row input { flex: 1 1 auto; min-width: 0; }
.captcha-img {
    flex: 0 0 auto;
    width: 118px;
    height: 38px;
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    cursor: pointer;
    display: block;
    user-select: none;
    transition: border-color .15s ease;
}
.captcha-img:hover { border-color: var(--ink); }

.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1 1 0; min-width: 0; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.card-form {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 22px;
    margin-bottom: 12px;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.auth-box {
    width: 100%;
    max-width: 400px;
    margin: 48px auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px 38px;
    box-shadow: var(--shadow-2);
}
.auth-box h1 { margin: 0 0 20px; font-size: 20px; text-align: center; font-weight: 800; }
.auth-box .tip { text-align: center; margin: 16px 0 0; }

.search-page-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-page-form input { flex: 1 1 auto; }
.search-page-form .btn { flex: 0 0 auto; margin: 0; }

/* --------------------------------------------------------------------------
   18. 分页
   -------------------------------------------------------------------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 18px 0; font-size: var(--fs-sm); }
.pager a, .pager .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--panel);
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pager a:hover { background: var(--panel-3); color: var(--ink); text-decoration: none; }
.pager .current {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-ink);
    font-weight: 700;
}
/* 首页 / 末页直达 + 省略号（v3.15.6） */
.pager .pager-jump { color: var(--text-2); }
.pager .pager-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 30px;
    color: var(--muted);
    user-select: none;
}
.pager-info { color: var(--muted); margin-left: 8px; }

/* --------------------------------------------------------------------------
   19. 用户主页
   -------------------------------------------------------------------------- */
/* v3.13.5：主页头部卡片整体重做 —— 头像区留白、等级条整行铺开、统计格与
   .side-stat / .up-stats 统一字号与分隔线口径 */
.profile {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 22px 24px 18px;
    margin-bottom: 12px;
}
.profile-head { display: flex; gap: 20px; align-items: flex-start; }
.profile-av {
    display: inline-block;
    flex: 0 0 auto;
    padding: 3px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    line-height: 0;
}
.profile-av .avatar { border: 0; border-radius: 10px; }
.profile-head > div { flex: 1 1 auto; min-width: 0; }
.profile-head h1 {
    margin: 0 0 5px;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    word-break: break-all;
}
.profile-head h1 .presence { margin-left: 0; }
.profile-head .page-desc { margin: 0; }
.profile-level { margin-top: 9px; }
.profile-level .level-badge { margin-bottom: 7px; }
.profile-level .level-bar { max-width: 340px; }
.profile-bio {
    margin: 11px 0 0;
    padding-top: 11px;
    border-top: 1px dashed var(--border-2);
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.7;
    word-break: break-word;
}
.profile-mods { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.profile-mods a { color: var(--ink); border-bottom: 1px solid var(--border-2); }
.profile-mods a:hover { border-bottom-color: var(--ink); }
/* 发私信：固定在主卡右上角（v3.13.8，对齐图 1） */
.profile-pm {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--on-ink);
    background: var(--ink);
    border-radius: var(--r-sm);
    text-decoration: none;
    line-height: 1.4;
    transition: opacity .15s;
}
.profile-pm:hover { opacity: .85; }
.profile-pm svg { width: 14px; height: 14px; }
/* 右上角按钮较宽时，给用户名行留出避让空间 */
.profile-head { padding-right: 94px; }

/* 统计格：与侧栏 .side-stat 同一套「细线分格 + 居中数字」语言 */
.profile-stat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 0;
    margin-top: 18px;
    padding-top: 0;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.profile-stat div { position: relative; text-align: center; padding: 12px 4px 10px; }
.profile-stat div + div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    width: 1px;
    height: 64%;
    background: var(--border-2);
}
.profile-stat strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.profile-stat span { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }

/* 主页内的 tab 条与主题列表贴合主卡：去掉重复外框，只留一条下边线 */
.profile-tabs { margin: 12px 0; }

/* 主页空态：图标 + 主文案 + 说明，比一行灰字更有信息量 */
.empty-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
}
.empty-box .eb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--panel-3);
    color: var(--muted);
}
.empty-box .eb-icon svg { width: 22px; height: 22px; }
.empty-box .eb-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.empty-box .eb-desc { margin-top: 6px; font-size: var(--fs-sm); line-height: 1.7; }
.empty-box .eb-desc a { color: var(--ink); border-bottom: 1px solid var(--border-2); }
.empty-box .eb-desc a:hover { border-bottom-color: var(--ink); text-decoration: none; }
/* 嵌在白卡里用：去掉自身的边框底色，按钮行留出上边距 */
.empty-box.flush { border: none; background: none; }
.empty-box .eb-actions { margin: 14px 0 0; }
.empty-box .eb-actions .btn { margin: 0; }
.empty-box .eb-actions .eb-btn2 { margin-left: 8px; }

/* --------------------------------------------------------------------------
   20. 后台
   -------------------------------------------------------------------------- */
/* ---- 后台骨架（v3.13.5）：桌面端左侧竖导航 + 右侧内容区 ---- */
.admin-page-head { margin-bottom: 14px; }
.admin-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    background: var(--ink);
    color: var(--on-ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    vertical-align: 3px;
}
.admin-shell {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.admin-nav {
    position: sticky;
    top: 84px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
}
.admin-nav-group + .admin-nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-2); }
.admin-nav-label {
    padding: 2px 10px 6px;
    font-size: var(--fs-xxs);
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .08em;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.4;
    transition: background var(--ease), color var(--ease);
}
.admin-nav a:hover { background: var(--panel-3); color: var(--ink); text-decoration: none; }
.admin-nav a.on { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.admin-nav a .admin-dot { margin-left: auto; }
.admin-nav a.on .admin-dot { background: var(--on-ink); color: var(--ink); }
.admin-body { min-width: 0; }

/* 旧横向标签条：插件页 / 兼容保留，仍按原样工作 */
.admin-tabs {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}
.admin-tabs a {
    font-size: var(--fs-md);
    color: var(--text-2);
    line-height: 44px;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.admin-tabs a:hover { text-decoration: none; color: var(--ink); }
.admin-tabs a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
/* 待处理数字红点（举报入口） */
.admin-dot {
    display: inline-block;
    margin-left: 4px;
    min-width: 17px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--red);
    color: var(--on-ink);
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    vertical-align: 1px;
    font-variant-numeric: tabular-nums;
}

/* 版块版主指派（v3.5.0） */
.board-mods-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
}
.board-mods-title { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.mod-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mod-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--panel);
    border: 1px solid var(--border-2);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
}
.mod-chip a { color: var(--ink); font-weight: 600; }
.board-mod-add { gap: 6px; }
.board-mod-add input[type="text"] {
    width: 190px;
    padding: 4px 8px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-xs);
    background: var(--panel);
    color: var(--text);
    font-size: var(--fs-sm);
}
/* 后台举报列表：被举报内容摘要占一栏 */
.report-row > .report-quote { flex: 1 1 280px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 14px 13px;
    text-align: center;
}
.stat-card strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.stat-card span { display: block; margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }

.admin-note {
    margin-top: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 20px;
    font-size: var(--fs-sm);
}
.admin-note h3 { margin: 0 0 10px; font-size: var(--fs-md); color: var(--ink); }
.admin-note ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.9; }
.admin-note code {
    padding: 1px 6px;
    border-radius: var(--r-xs);
    background: var(--panel-3);
    color: var(--text-2);
    font-size: var(--fs-xs);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.admin-body > .card-form:first-child,
.admin-body > .admin-tabs:first-child { margin-top: 0; }

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    font-size: var(--fs-sm);
    margin-bottom: 12px;
}
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.admin-table th { background: var(--panel-2); font-weight: 600; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.admin-table tbody tr:hover { background: var(--panel-4); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td input[type=text], .admin-table td input[type=number] {
    padding: 6px 9px;
    border: 1px solid var(--border-3);
    border-radius: var(--r-xs);
    background: var(--panel);
    color: var(--text);
    font: 400 var(--fs-sm)/1.5 var(--font-sans);
    width: 100%;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-table td input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus-halo); }

.nowrap { white-space: nowrap; }
.mini { width: 66px !important; flex: 0 0 66px; }

.board-edit-list { display: flex; flex-direction: column; gap: 12px; }
.board-edit-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    flex-wrap: wrap;
    transition: border-color .15s ease;
}
.board-edit-card:hover { border-color: var(--border-3); }
.board-edit-form { flex: 1 1 auto; min-width: 250px; }
.board-edit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.board-edit-row input[type=text] { flex: 1 1 140px; min-width: 0; }
.board-edit-row input {
    padding: 7px 10px;
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    background: var(--panel);
    color: var(--text);
    font: 400 var(--fs-sm)/1.5 var(--font-sans);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.board-edit-row input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus-halo); }
.board-edit-meta { display: flex; gap: 16px; font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; }
.board-edit-del { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   20b. 日志（运行日志 / 审计日志，v3.7.0）
   -------------------------------------------------------------------------- */
.log-level {
    display: inline-block;
    padding: 1px 7px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border-3);
    background: var(--panel-2);
    color: var(--text-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.log-error { color: var(--red);   background: var(--red-soft);   border-color: var(--red-line); }
.log-warn  { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.log-info  { color: var(--blue);  background: var(--blue-soft);  border-color: var(--blue-line); }
.log-debug { color: var(--muted); background: var(--panel-2);    border-color: var(--border-3); }

/* 附加上下文 / URI：单行小字，等宽，超长自动断行 */
.log-ctx {
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--fs-xs);
    font-family: var(--font-mono);
    word-break: break-all;
    line-height: 1.6;
}

/* 后台表格单元里的多个小按钮并排（v3.14.0：找回密码的「生成链接 / 作废」） */
.cell-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cell-actions form { margin: 0; }

/* --------------------------------------------------------------------------
   20c. 图片灯箱 + @ 补全浮层（v3.8.0）
   -------------------------------------------------------------------------- */
img.post-img { cursor: zoom-in; }

body.lb-open { overflow: hidden; }
.pb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, .88);
    padding: 48px 56px;
}
.pb-lightbox .lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--r-sm);
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.pb-lightbox .lb-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border: none;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}
.pb-lightbox .lb-btn:hover { background: rgba(255, 255, 255, .26); }
.pb-lightbox .lb-prev { left: 10px; }
.pb-lightbox .lb-next { right: 10px; }
.pb-lightbox .lb-close {
    top: 14px;
    right: 14px;
    transform: none;
    width: 40px;
    height: 40px;
    font-size: 28px;
}
.pb-lightbox .lb-num {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    text-align: center;
    color: rgba(255, 255, 255, .78);
    font-size: var(--fs-sm);
}
@media (max-width: 720px) {
    .pb-lightbox { padding: 56px 10px; }
    .pb-lightbox .lb-btn { width: 36px; height: 48px; font-size: 22px; }
    .pb-lightbox .lb-prev { left: 2px; }
    .pb-lightbox .lb-next { right: 2px; }
}

.mention-pop {
    position: fixed;
    z-index: 900;
    max-height: 220px;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-2);
    padding: 4px;
}
.mention-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: var(--r-xs);
    background: none;
    color: var(--text);
    font: 400 var(--fs-sm)/1.5 var(--font-sans);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mention-item.on, .mention-item:hover { background: var(--panel-3); color: var(--ink); }

/* --------------------------------------------------------------------------
   20d. 私信 —— 聊天窗口（v3.10.0）
   左会话列表 + 右聊天区（头部 / 消息流 / 底部输入条），整体是一张白卡，
   消息流用浅灰底衬托气泡，窄屏转上下堆叠。
   -------------------------------------------------------------------------- */
.pm-wrap {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

/* 左：会话列表 */
.pm-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
.pm-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink);
}
.pm-side-unread {
    display: inline-block;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--brand);
    color: var(--brand-fg);
    font-size: 11px;
    font-style: normal;
    line-height: 17px;
}
.pm-new-btn {
    flex: none;
    font-size: var(--fs-xs);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-xs);
    /* v3.13.5：#f5c518 黄框按钮 */
    color: #6b5300;
    background: #f5c518;
    border: 1px solid #e0b400;
    text-decoration: none;
    line-height: 1.6;
    transition: filter .15s ease;
}
.pm-new-btn:hover { color: #5a4500; background: #ffd43b; text-decoration: none; }
.pm-new-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    padding: 9px 22px;
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: #6b5300;
    background: #f5c518;
    border: 1px solid #e0b400;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    transition: filter .15s ease;
}
.pm-new-cta:hover { color: #5a4500; background: #ffd43b; text-decoration: none; }
.pm-list { flex: 1; overflow-y: auto; }
.pm-empty { padding: 18px 14px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.8; }
.pm-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    color: var(--text);
    text-decoration: none;
}
.pm-item:last-child { border-bottom: none; }
.pm-item:hover { background: var(--panel-4); text-decoration: none; }
.pm-item.on { background: var(--brand-soft); }
.pm-item.on .pm-item-name { color: var(--ink); }
.pm-item-main { flex: 1; min-width: 0; }
.pm-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}
.pm-item-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-item-when { flex: none; color: var(--muted); font-size: var(--fs-xs); }
.pm-item-preview {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-me { color: var(--text-2); }
.pm-badge {
    flex: none;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--red);
    color: var(--on-ink);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.pm-item.on .pm-badge { background: var(--brand); color: var(--brand-fg); }

/* 右：聊天窗口 */
.pm-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 600px;
    max-height: calc(100vh - 190px);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}
.pm-chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-2);
}
.pm-chat-peer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    text-decoration: none;
}
.pm-chat-peer:hover { text-decoration: none; }
.pm-chat-peer:hover .pm-chat-name { text-decoration: underline; }
.pm-chat-name { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.pm-chat-uid { font-size: var(--fs-xs); }
.pm-chat-spacer { flex: 1; }
.pm-chat-link { font-size: var(--fs-xs); color: var(--text-2); text-decoration: none; }
.pm-chat-link:hover { color: var(--ink); text-decoration: underline; }
.pm-chat-tip { font-size: var(--fs-xs); }
.pm-alert { margin: 12px 14px 0; }

.pm-thread {
    flex: 1;
    min-height: 0;
    padding: 14px 16px 4px;
    background: var(--panel-2);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pm-thread-empty {
    margin: auto;
    padding: 40px 0;
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
}
.pm-thread-empty-icon {
    margin: 0 auto 10px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--panel-3);
    color: var(--muted);
    font-size: 20px;
    line-height: 46px;
}
/* 日期分隔条 */
.pm-day { margin: 8px 0 12px; text-align: center; }
.pm-day span {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--panel-3);
    color: var(--muted);
    font-size: 11px;
}
.pm-msg { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px; }
.pm-msg:last-child { margin-bottom: 4px; }
.pm-msg-avatar { flex: none; line-height: 0; }
/* 系统消息头像（message.php 系统会话）：复用通知页的圆形占位样式，尺寸对齐私信头像 */
.pm-msg-avatar.notif-avatar-sys { line-height: 1; }
.pm-msg-col { min-width: 0; max-width: 74%; }
.pm-bubble {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 2px 10px 10px 10px;
    background: var(--panel);
    font-size: var(--fs-sm);
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.pm-msg-when { margin-top: 4px; color: var(--muted); font-size: 11px; }

/* 自己发的：头像到右边，气泡黑底白字 */
.pm-msg.mine { flex-direction: row-reverse; }
.pm-msg.mine .pm-msg-col { text-align: right; }
.pm-msg.mine .pm-bubble {
    border-radius: 10px 2px 10px 10px;
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-fg);
    text-align: left;
}
.pm-msg.mine .pm-bubble a { color: var(--brand-fg); text-decoration: underline; }
.pm-msg.mine .pm-bubble code {
    background: rgba(255, 255, 255, .16);
    color: var(--brand-fg);
    border-color: rgba(255, 255, 255, .28);
}
.pm-msg.mine .pm-bubble blockquote {
    border-left-color: rgba(255, 255, 255, .45);
    color: rgba(255, 255, 255, .85);
}

/* 底部输入条 */
.pm-send {
    border-top: 1px solid var(--border-2);
    padding: 10px 12px;
    background: var(--panel);
}
.pm-send-to {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.pm-send-to label { flex: none; font-size: var(--fs-xs); color: var(--text-2); }
.pm-send-to input { flex: 1; min-width: 0; padding: 6px 10px; font-size: var(--fs-sm); }
.pm-send-tip { flex: none; font-size: 11px; color: var(--muted); }
.pm-send-row { display: flex; align-items: flex-end; gap: 8px; }
.pm-send-row textarea {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    max-height: 160px;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    line-height: 1.6;
    resize: none;
}
.pm-send-btn { flex: none; padding: 9px 22px; }
.pm-err {
    margin: 0 12px;
    padding: 7px 10px;
    border: 1px solid var(--red-line);
    border-radius: var(--r-sm);
    background: var(--red-soft);
    color: var(--red);
    font-size: var(--fs-xs);
}

@media (max-width: 900px) {
    .pm-wrap { grid-template-columns: 1fr; }
    .pm-side { max-height: 260px; }
    .pm-chat { height: auto; min-height: 460px; max-height: none; }
    .pm-send-tip { display: none; }
    .pm-msg-col { max-width: 82%; }
}

/* --------------------------------------------------------------------------
   20f. 通用弹窗（v3.10.0，举报弹窗用）
   遮罩用 flex 居中；卡片自身限高，内容多时 body 内部滚动。
   -------------------------------------------------------------------------- */
.pb-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .42);
    animation: pb-modal-in .14s ease;
}
@keyframes pb-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.pb-modal-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    overflow: hidden;
}
.pb-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-2);
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ink);
}
.pb-modal-close {
    flex: none;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 20px;
    line-height: 24px;
    cursor: pointer;
    border-radius: var(--r-sm);
}
.pb-modal-close:hover { background: var(--panel-3); color: var(--ink); }
.pb-modal-body {
    flex: 1;
    min-height: 0;
    padding: 14px;
    overflow-y: auto;
}
.pb-modal-body .field:last-child { margin-bottom: 0; }
.pb-modal-body textarea { min-height: 72px; }
/* 弹窗打开时锁背景滚动（app.js 给 body 加 .pb-modal-open） */
body.pb-modal-open { overflow: hidden; }
/* 自绘确认弹窗（替代 window.confirm）：支持多行文案 */
.pb-confirm-msg {
    padding: 4px 0 6px;
    font-size: var(--fs-sm);
    line-height: 1.9;
    color: var(--text);
    white-space: pre-line;
    word-break: break-word;
}
.pb-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-2);
    background: var(--panel-4);
}
.pb-modal-foot .btn { margin: 0 !important; }
.pb-modal-msg {
    padding: 10px 2px;
    font-size: var(--fs-sm);
    line-height: 1.8;
    color: var(--text);
}
.pb-modal-msg.bad { color: var(--red); }
.pb-modal-loading { padding: 18px 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.pb-modal-tip { margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.7; }

/* ---- 新建私信弹窗（收件人联想） ---- */
.pmn-field { margin-bottom: 14px; }
.pmn-to-wrap { position: relative; }
.pmn-to-wrap input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: var(--fs-sm);
}
.pmn-to-wrap input:focus { outline: none; border-color: var(--ink); }
/* 联想下拉：浮在输入框正下方，内容多时可滚，但不撑高弹窗 */
.pmn-pop {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    max-height: 232px;
    overflow-y: auto;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--border-3);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-3);
}
.pmn-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--r-xs);
    font-size: var(--fs-sm);
    color: var(--text);
    cursor: pointer;
}
.pmn-user.on, .pmn-user:hover { background: var(--panel-4); }
.pmn-user-avatar { flex: none; display: inline-flex; align-items: center; }
.pmn-user-name { flex: none; font-weight: 500; color: var(--ink); }
.pmn-user-group { flex: 1; min-width: 0; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmn-user-uid { flex: none; font-size: var(--fs-xxs); color: var(--muted); font-variant-numeric: tabular-nums; }
/* 校验 / 网络错误的提示条：留在表单里，不清空已填内容，用户改完能直接重发 */
.pmn-err {
    margin-bottom: 12px;
    padding: 8px 11px;
    border-radius: var(--r-sm);
    background: var(--red-soft);
    color: var(--red);
    font-size: var(--fs-xs);
    line-height: 1.7;
}
/* 收件人输入框获得焦点时，联想的层级要压过后面的字段 */
.pmn-field:focus-within { position: relative; z-index: 2; }

@media (max-width: 560px) {
    .pb-modal { padding: 12px; align-items: flex-end; }
    .pb-modal-box { max-width: none; }
}

/* --------------------------------------------------------------------------
   20e. 用户名悬浮名片（v3.10.0）
   position:fixed 直接按视口坐标定位，省掉 offsetParent 的坑。
   -------------------------------------------------------------------------- */
.pb-usercard {
    position: fixed;
    z-index: 1200;
    width: 272px;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
    color: var(--text);
    font-size: var(--fs-sm);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease;
    pointer-events: none;
}
.pb-usercard.on { opacity: 1; transform: none; pointer-events: auto; }
.uc-head { display: flex; align-items: center; gap: 10px; }
.uc-avatar { flex: none; line-height: 0; }
.uc-avatar .avatar { width: 48px; height: 48px; font-size: 20px; }
.uc-info { min-width: 0; }
.uc-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ink);
    min-width: 0;
}
.uc-name > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uc-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
/* v3.13.7：UID 挪到用户名同行 —— 用灰底小胶囊，与 .uid-label 的纯文字区分开 */
.uc-name .uc-uid {
    flex: none;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-2);
    background: var(--panel-3);
    border: 1px solid var(--border-2);
    border-radius: var(--r-xs);
    padding: 1px 6px;
}
/* v3.13.7：在线 / 离线状态固定在名片右上角 */
.uc-online {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
}
.uc-online.on { color: #16a34a; }
.uc-online .presence { width: 7px; height: 7px; }
.uc-title {
    font-size: var(--fs-xs);
    color: var(--text-2);
    background: var(--panel-3);
    border-radius: var(--r-xs);
    padding: 1px 6px;
}
.uc-banned { font-size: var(--fs-xs); color: var(--red); }
.uc-bio {
    margin-top: 10px;
    color: var(--text-2);
    font-size: var(--fs-xs);
    line-height: 1.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* v3.13.11：对方设了隐私时，名片只显示公开信息 + 这条提示 */
.uc-private {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    background: var(--panel-2);
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.6;
}
.uc-stats {
    display: grid;
    /* 2 格（关闭积分或看别人）与 4 格都要铺满，不留空位 */
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid var(--border-2);
}
.uc-stats div { text-align: center; min-width: 0; }
.uc-stats strong {
    display: block;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}
.uc-stats span { font-size: 11px; color: var(--muted); }
.uc-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
}
.uc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.uc-actions .btn { margin: 0 !important; text-align: center; }
.uc-actions.one { grid-template-columns: 1fr; }
.uc-loading { padding: 8px 0; color: var(--muted); font-size: var(--fs-xs); text-align: center; }
.uc-level { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.uc-level .level-progress { flex: 1; }

/* --------------------------------------------------------------------------
   20h. 我的附件（v3.13.5：改为整页列表卡片 + 右侧删除按钮）
   -------------------------------------------------------------------------- */
.attach-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    margin-bottom: 14px;
}
.attach-card .section-title { margin: 0 0 6px; }
.attach-card .attach-desc { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.7; }
.attach-quota-bar { display: flex; align-items: center; gap: 12px; }
.attach-progress {
    flex: 1;
    height: 8px;
    background: var(--panel-3);
    border-radius: 4px;
    overflow: hidden;
}
.attach-progress span {
    display: block;
    height: 100%;
    background: var(--ink);
    border-radius: 4px;
    transition: width .3s ease;
}
.attach-quota-text { flex: none; font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.attach-quota-text strong { color: var(--ink); }
.attach-quota-tip { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.7; }
/* 顶部筛选：全部 / 回收站 两个胶囊 */
.attach-filter { display: flex; gap: 8px; margin-top: 14px; }
.attach-filter a {
    padding: 6px 18px;
    border-radius: var(--r-full);
    border: 1px solid var(--border-2);
    background: var(--panel);
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.4;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.attach-filter a:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.attach-filter a.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }

/* 附件列表：一行一个 */
.attach-list {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 12px;
}
.attach-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-2);
    transition: background var(--ease);
}
.attach-row:last-child { border-bottom: none; }
.attach-row:hover { background: var(--panel-4); }
.attach-row.is-bin { opacity: .9; }
.attach-row .attach-thumb {
    flex: none;
    width: 68px;
    height: 68px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-2);
    background: var(--panel-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.attach-row .attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-row .attach-thumb a { display: block; width: 100%; height: 100%; }
.attach-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.attach-ext {
    padding: 4px 8px;
    border-radius: var(--r-xs);
    background: var(--panel-3);
    color: var(--text-2);
    font-size: var(--fs-xxs);
    font-weight: 700;
    letter-spacing: .04em;
}
.attach-row .attach-info { flex: 1; min-width: 0; }
.attach-row .attach-name {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}
.attach-row .attach-name a { color: var(--ink); }
.attach-row .attach-name a:hover { text-decoration: underline; }
.attach-row .attach-meta {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.attach-row .attach-meta span { white-space: nowrap; }
.attach-claimed { color: var(--green); }
a.attach-claimed { color: var(--green); text-decoration: none; border-bottom: 1px dashed currentColor; }
a.attach-claimed:hover { color: var(--green); opacity: .8; }
.attach-warn { color: var(--red); }
.attach-row .attach-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.attach-row .attach-actions .btn { margin: 0 !important; }
.attach-row .attach-actions .btn-danger { border-radius: var(--r-full); padding: 7px 20px; }
.attach-tip { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
@media (max-width: 640px) {
    .attach-row { gap: 12px; padding: 12px 14px; }
    .attach-row .attach-thumb { width: 54px; height: 54px; }
    .attach-row .attach-name { font-size: var(--fs-sm); }
    .attach-row .attach-actions .btn-danger { padding: 6px 14px; }
    .attach-quota-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --------------------------------------------------------------------------
   20g. 等级系统（v3.10.0）
   等级按当前成长值计算，与积分头衔互相独立。
   -------------------------------------------------------------------------- */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: var(--r-xs);
    background: var(--panel-3);
    color: var(--text-2);
    font-size: var(--fs-xs);
    white-space: nowrap;
}
.level-badge strong { color: var(--ink); font-weight: 700; }
.level-progress {
    height: 6px;
    background: var(--panel-3);
    border-radius: 3px;
    overflow: hidden;
}
.level-progress span {
    display: block;
    height: 100%;
    /* v3.13.5：统一指定的靛蓝色进度条（深色主题下同样够亮，能压住深色底） */
    background: #33408f;
    border-radius: 3px;
    transition: width .3s ease;
}
/* v3.15.5 深色适配：靛蓝在深底上偏暗，进度条改亮一档的蓝紫 */
[data-theme="dark"] .level-progress span { background: #5b6fd6; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .level-progress span { background: #5b6fd6; }
}
.level-pct {
    flex: none;
    font-size: var(--fs-xs);
    color: #33408f;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
[data-theme="dark"] .level-pct { color: #8b9ce8; }
@media (prefers-color-scheme: dark) {
    .level-pct { color: #8b9ce8; }
}
.level-need { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.level-bar { display: flex; align-items: center; gap: 8px; }
.level-bar .level-progress { flex: 1; }
.level-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px;
    margin-bottom: 14px;
}
.level-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.level-card-lv { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.level-card-name { font-size: var(--fs-sm); color: var(--text-2); }
.level-card-bar { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.level-card-bar .level-progress { flex: 1; }
.level-card-need { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.level-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
.level-table-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    color: var(--text);
}
.level-table-row:nth-child(odd) { background: var(--panel-4); }
.level-table-row.on { background: var(--brand-soft); color: var(--ink); }
.level-table-row .lv { flex: none; min-width: 40px; color: var(--muted); }
.level-table-row .name { flex: 1; min-width: 0; }
.level-table-row .val { flex: none; color: var(--muted); }
@media (max-width: 720px) {
    .level-table { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .level-table { grid-template-columns: 1fr; }
}

/* 后台导航响应式：<=900px 收成横向可滚动的分组标签条 */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; gap: 14px; }
    .admin-nav {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        padding: 8px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-nav-group { display: flex; gap: 6px; align-items: center; }
    .admin-nav-group + .admin-nav-group { margin-top: 0; padding-top: 0; padding-left: 8px; border-top: 0; border-left: 1px solid var(--border-2); }
    .admin-nav-label { display: none; }
    .admin-nav a { white-space: nowrap; padding: 6px 12px; border: 1px solid var(--border-2); }
    .admin-nav a.on { border-color: var(--ink); }
}

/* --------------------------------------------------------------------------
   21. 安装向导
   -------------------------------------------------------------------------- */
.install-page {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 16px;
}
.install-box {
    width: 100%;
    max-width: 480px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px 38px;
    box-shadow: var(--shadow-2);
}
.install-box .logo {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .5px;
    text-align: center;
    color: var(--ink);
}
.logo-sub { margin: 6px 0 22px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.check-list { list-style: none; margin: 0 0 18px; padding: 0; font-size: var(--fs-sm); }
.check-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    margin-bottom: 6px;
    background: var(--panel-2);
    border: 1px solid var(--border);
}
.check-list li.ok::before  { content: "✓"; color: var(--green); font-weight: 700; flex: 0 0 auto; }
.check-list li.bad::before { content: "✕"; color: var(--red); font-weight: 700; flex: 0 0 auto; }
.check-list li.bad { background: var(--red-soft); border-color: var(--red-line); }

/* --------------------------------------------------------------------------
   22. Markdown 正文
   -------------------------------------------------------------------------- */
.post-content > p { margin: 0 0 12px; line-height: 1.8; word-break: break-word; }
.post-content > p:last-child { margin-bottom: 0; }
.post-content h3, .post-content h4, .post-content h5, .post-content h6 { margin: 20px 0 10px; line-height: 1.4; font-weight: 700; color: var(--ink); }
.post-content h3 { font-size: 17px; }
.post-content h4 { font-size: var(--fs-lg); }
.post-content h5, .post-content h6 { font-size: var(--fs-md); color: var(--text-2); }
.post-content ul, .post-content ol { margin: 0 0 12px 20px; padding: 0; }
.post-content li { margin: 5px 0; line-height: 1.75; }
.post-content li > ul, .post-content li > ol { margin-bottom: 0; }
.post-content blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--ink);
    background: var(--panel-4);
    color: var(--text-2);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.post-content blockquote > p:last-child { margin-bottom: 0; }
.post-content code {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    padding: .1em .35em;
    font-size: var(--fs-sm);
}
.post-content pre {
    margin: 14px 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    line-height: 1.65;
}
.post-content pre code { background: none; border: none; padding: 0; font-size: var(--fs-sm); color: var(--text); }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---- 代码块复制按钮（v3.15.1）：hover 浮现，触屏常显 ---- */
.code-block { position: relative; }
.code-block pre { margin: 0; }
.code-block { margin: 14px 0; }
.code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px 10px;
    font: 600 var(--fs-xxs)/1.4 var(--font-sans);
    color: var(--text-2);
    background: var(--panel);
    border: 1px solid var(--border-3);
    border-radius: var(--r-xs);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease, color .15s ease, border-color .15s ease;
}
.code-block:hover .code-copy,
.code-block:focus-within .code-copy { opacity: 1; visibility: visible; }
.code-copy:hover { color: var(--ink); border-color: var(--ink); }
@media (hover: none) {
    .code-copy { opacity: 1; visibility: visible; }
}

/* Markdown 表格与任务列表（v3.15.0） */
.md-table-wrap { margin: 14px 0; overflow-x: auto; }
.md-table {
    width: 100%;
    /* separate + spacing 0：collapse 模式下圆角不生效 */
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-sm);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.md-table th, .md-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-2);
    border-right: 1px solid var(--border-2);
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
}
.md-table th { background: var(--panel-2); font-weight: 600; color: var(--ink); white-space: nowrap; }
.md-table tr:last-child td { border-bottom: none; }
.md-table th:last-child, .md-table td:last-child { border-right: none; }
.post-content ul.task-list { list-style: none; margin-left: 2px; }
.post-content ul.task-list > li.task { position: relative; padding-left: 24px; }
.post-content ul.task-list > li.task::before {
    content: "";
    position: absolute;
    left: 0;
    top: .42em;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--border-3);
    border-radius: var(--r-xs);
    background: var(--panel);
}
.post-content ul.task-list > li.task.done { color: var(--muted); text-decoration: line-through; }
.post-content ul.task-list > li.task.done::before {
    background: var(--ink);
    border-color: var(--ink);
}
.post-content ul.task-list > li.task.done::after {
    content: "";
    position: absolute;
    left: 5px;
    top: .72em;
    width: 4px;
    height: 8px;
    border: solid var(--panel);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.post-content img, img.post-img {
    max-width: 100%;
    /* v3.15.6：限高 —— 一张 8000px 的手机长截图原来会让单帖占满十几屏，
       整页滚动条瞬间失控。max-width + max-height 同时存在时浏览器按比例缩放，
       图片完整可见（不裁切），要看原图点进 lightbox。 */
    max-height: 640px;
    height: auto;
    display: block;
    margin: 12px 0;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}
.post-content a { text-decoration: none; border-bottom: 1px solid var(--border-3); }
.post-content a:hover { border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   23. 编辑器
   -------------------------------------------------------------------------- */
.editor {
    border: 1px solid var(--border-3);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--panel);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.editor:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus-halo); }
.editor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 7px 8px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--border);
}
.editor-bar button {
    min-width: 30px;
    height: 28px;
    padding: 0 9px;
    cursor: pointer;
    background: var(--panel);
    color: var(--text-2);
    border: 1px solid var(--border-3);
    border-radius: var(--r-xs);
    font: 600 var(--fs-sm)/1 var(--font-sans);
    transition: background .14s ease, border-color .14s ease, color .14s ease;
    /* v3.15.6：按钮内是 SVG + 可选文字，用 flex 保证图标与文字垂直居中 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.editor-bar button .icon { color: currentColor; }
.editor-bar button:hover { background: var(--panel-3); border-color: var(--ink); color: var(--ink); }
.editor-bar button:disabled { opacity: .45; cursor: not-allowed; }
/* 预览按钮推到工具栏最右侧，跟其它格式按钮区分开 */
.editor-bar .editor-preview-btn { margin-left: auto; }

/* 草稿恢复提示：写长帖刷新丢内容太痛，这里给一个可恢复 / 可丢弃的横条 */
.draft-tip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 8px 14px;
    font-size: var(--fs-sm);
    color: var(--amber);
    background: var(--amber-soft);
    border-bottom: 1px solid var(--amber-line);
}
.draft-tip button {
    height: 24px;
    padding: 0 10px;
    cursor: pointer;
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--border-3);
    border-radius: var(--r-xs);
    font: 600 var(--fs-xs)/1 var(--font-sans);
}
.draft-tip button:hover { border-color: var(--ink); background: var(--panel-3); }
.draft-tip .draft-drop { color: var(--muted); font-weight: 400; }

/* 预览区：内容由后端 format_content() 渲染，样式与正式帖子一致 */
.editor-preview {
    padding: 14px 16px;
    min-height: 80px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--border-2);
    font-size: var(--fs-md);
    line-height: 1.85;
    color: var(--text);
    overflow-wrap: break-word;
}
/* display:none 必须显式写：JS 用 hidden 属性切换，而上面没设 display，
   不加这条在部分浏览器里 [hidden] 会被 flex 布局盖掉 */
.editor-preview[hidden] { display: none; }
/* 预览态把输入框换掉（而不是叠一层），用户看到的就是发布后的样子 */
.editor.previewing > textarea { display: none; }
.editor textarea {
    display: block;
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 14px;
    margin: 0;
    resize: vertical;
    font: 400 var(--fs-md)/1.75 var(--font-sans);
    outline: none;
    background: var(--panel);
    color: var(--text);
    box-shadow: none;
}
.editor textarea:focus { border: none; box-shadow: none; }
.editor textarea.drag { background: var(--panel-4); box-shadow: inset 0 0 0 2px var(--ink); }
.editor-status { min-height: 18px; padding: 6px 14px 0; font-size: var(--fs-sm); color: var(--green); }
.editor-status.bad { color: var(--red); }
.editor-tip {
    margin: 0;
    padding: 8px 14px 11px;
    font-size: var(--fs-xs);
    color: var(--muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-2);
}

/* --------------------------------------------------------------------------
   24. 页脚 & 回到顶部（tusi .tusi-footer：白底 + 上边线，居中）
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: 44px;
    padding: 30px 0 36px;
    border-top: 1px solid var(--border-4);
    background: var(--panel);
    text-align: center;
}
.site-footer .wrap { display: block; }
.site-footer span { font-size: var(--fs-sm); color: var(--muted); }
.site-footer strong { color: var(--text-2); font-weight: 600; }
.foot-sep { opacity: .5; margin: 0 5px; }
.foot-info { display: block; margin-top: 6px; font-size: var(--fs-xs); color: var(--disabled); }

.to-nav {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.to-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text-2);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease, background .18s ease, color .18s ease;
    padding: 0;
}
.to-btn svg { width: 17px; height: 17px; }
.to-btn.show { opacity: 1; visibility: visible; transform: none; }
.to-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* --------------------------------------------------------------------------
   25. 工具类
   -------------------------------------------------------------------------- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   26. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
    .forum-nav { display: none; }
}

@media (max-width: 1020px) {
    .layout { flex-direction: column; align-items: stretch; }
    .col-side {
        width: auto;
        position: static;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
    /* 侧栏转平铺后，作者卡片改成横向排布更省高度 */
    .author-card { text-align: left; }
    .author-card .side-title { justify-content: flex-start; }
    .author-top { flex-direction: row; align-items: center; gap: 14px; }
    .author-name { align-items: flex-start; }
}

@media (max-width: 680px) {
    .wrap { padding: 0 10px; }
    .header-inner { gap: 14px; height: 52px; }
    .forum-nav .forum-link, .forum-nav .forum-more { line-height: 52px; }
    .search-wrap input { width: 130px; }
    /* 窄屏保持定宽（与上面 .search-wrap 的注释一致），focus 展宽会挤爆 52px 顶栏 */
    .site-header .btn { padding: 5px 10px; }
    .two-col { grid-template-columns: 1fr; }
    .topic-row { padding: 13px 14px; gap: 11px; }
    .side-card { padding: 14px 12px; }
    .forum-banner { flex-direction: column; align-items: flex-start; padding: 16px 14px; gap: 10px; }
    .forum-banner h1 { font-size: 17px; }
    .forum-banner .btn { margin-left: 0; align-self: flex-start; }

    .post { margin-bottom: 10px; }

    /* 触控目标放大（v3.15.1）：桌面端的 26-30px 小按钮在手机上难点中，
       ≤680px 统一放大到 ≥36px（仍受顶栏 52px 高度约束，铃铛/主题切 40px） */
    .nav-bell, .theme-toggle { width: 40px; height: 40px; }
    .nav-avatar { width: 38px; height: 38px; }
    .pager a, .pager .current { min-width: 36px; height: 36px; }
    .editor-bar button { height: 36px; }
    .pb-modal-close { width: 36px; height: 36px; font-size: 24px; }
    .forum-strip a { min-height: 34px; }
    .pb-modal-foot .btn, .form-actions .btn { padding-top: 9px; padding-bottom: 9px; }

    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .field-row { flex-direction: column; gap: 0; }
    .to-nav { right: 12px; bottom: 12px; }
}

@media (max-width: 400px) {
    .wrap { padding: 0 6px; }
    .pager a, .pager .current { min-width: 28px; padding: 0 7px; }
    /* 超窄屏：行尾版块徽标让位给标题（v3.15.6） */
    .topic-end { display: none; }
}

/* --------------------------------------------------------------------------
   26.5 用户组徽章 / 收藏 / 权限表单 / 插件页
   -------------------------------------------------------------------------- */

/* 用户组徽章（用户名后面那一小片彩色标签） */
.group-badge {
    display: inline-block;
    vertical-align: middle;
    padding: 1px 6px;
    margin: 0 2px;
    border-radius: var(--r-xs);
    font-size: var(--fs-xxs);
    line-height: 17px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    /* background 由 core.php group_badge() 内联给出（用户组自定义颜色） */
}
.profile-head h1 .group-badge { font-size: var(--fs-xs); padding: 2px 8px; }

/* 页头右侧按钮组 */
.page-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 收藏按钮 */
.fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.fav-btn .fav-star { font-size: 13px; line-height: 1; }
.fav-btn .fav-text { line-height: 1; }
.fav-btn.on { background: var(--amber); border-color: var(--amber); color: var(--on-ink); }
.fav-btn .fav-num {
    min-width: 16px;
    padding: 0 5px;
    border-radius: var(--r-xs);
    background: rgba(255, 255, 255, .18);
    font-size: var(--fs-xxs);
    font-variant-numeric: tabular-nums;
}
.fav-btn.on .fav-num { color: var(--on-ink); }
.fav-btn:disabled { opacity: .6; cursor: default; }

/* 后台：版块权限编辑框 */
.perm-box {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border-3);
    border-radius: var(--r-sm);
    background: var(--panel-2);
}
.perm-title {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: .02em;
}
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 7px 12px;
}
.perm-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--text-2);
}
.perm-grid select {
    flex: 1;
    min-width: 78px;
    padding: 4px 7px;
    font-size: var(--fs-xs);
}
.perm-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 8px;
}
.perm-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-xs);
    color: var(--text-2);
    white-space: nowrap;
}
.ok-text { color: var(--green); font-size: var(--fs-sm); font-weight: 600; }
.warn-text { color: var(--amber); font-size: var(--fs-sm); font-weight: 600; }

/* 后台：插件卡片 */
.plugin-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--panel);
    margin-bottom: 10px;
    flex-wrap: wrap;
    transition: border-color .15s ease;
}
.plugin-card:hover { border-color: var(--border-3); }
.plugin-card .plugin-meta { flex: 1; min-width: 220px; }
.plugin-card .plugin-name { font-weight: 600; font-size: var(--fs-md); color: var(--ink); }
.plugin-card .plugin-desc { color: var(--muted); font-size: var(--fs-xs); margin-top: 3px; }
.plugin-card .plugin-info { color: var(--muted); font-size: var(--fs-xs); margin-top: 5px; }
.plugin-card .plugin-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.plugin-slug {
    color: var(--muted);
    font-size: var(--fs-xs);
    padding: 1px 6px;
    border-radius: var(--r-xs);
    background: var(--panel-3);
}

/* 后台：计划任务表 */
.cron-row code { background: var(--panel-2); padding: 2px 6px; border-radius: var(--r-xs); }

/* 后台：伪静态配置展示（v3.13.5） */
.rw-box {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    padding: 0 12px;
}
.rw-box > summary {
    cursor: pointer;
    padding: 10px 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
    list-style: none;
}
.rw-box > summary::-webkit-details-marker { display: none; }
.rw-box > summary::before { content: "▸ "; color: var(--muted); }
.rw-box[open] > summary::before { content: "▾ "; }
.rw-box > .tip { margin: 4px 0; }
.rw-code {
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--panel);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

@media (max-width: 560px) {
    .perm-grid { grid-template-columns: 1fr 1fr; }
    .group-badge { font-size: 10px; padding: 1px 5px; }
}

/* --------------------------------------------------------------------------
   26b. 正文里的附件链接（v3.10.1）
   指向本站 uploads 的链接是「上传的附件」，用绿色（浅色 #2e9e5b）跟站外链接区分开。
   颜色走 --green 变量：深色模式自动切到亮一点的绿，保证在深底上可读。
   -------------------------------------------------------------------------- */
.post-content a.file-link,
.file-link { color: var(--green); }
.post-content a.file-link { border-bottom-color: var(--green-line); }
.file-link:hover { color: var(--green); text-decoration: underline; }

/* --------------------------------------------------------------------------
   26c. 主题类型面板（v3.11.0）
   悬赏 / 投票 / 抽奖 / 红包各自的小提示块，夹在帖子标题卡和楼主之间。
   配色一律走变量：深色模式下自动切换到亮色版本。
   -------------------------------------------------------------------------- */
.type-panel {
    background: var(--panel);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--border-3);
    border-radius: var(--r-sm);
    padding: 13px 16px;
    margin: 0 0 14px;
    box-shadow: var(--shadow-1);
}
.tp-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink); line-height: 1.55; }
.tp-title strong { font-variant-numeric: tabular-nums; }
.tp-sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.65; }
.tp-sub a { color: var(--blue); }
.tp-icon {
    float: left;
    width: 34px;
    height: 34px;
    margin: 1px 12px 0 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--on-ink);
    background: var(--border-3);
}
.tp-main { overflow: hidden; }

/* 悬赏：琥珀色；已解决改绿 */
.bounty-panel { border-left-color: var(--amber); }
.bounty-panel .tp-icon { background: var(--amber); }
.bounty-panel.done { border-left-color: var(--green); }
.bounty-panel.done .tp-icon { background: var(--green); }

/* 投票：蓝色；抽奖紫；红包红 */
.vote-panel { border-left-color: var(--blue); }
.lottery-panel { border-left-color: var(--purple); }
.lottery-panel .tp-icon { background: var(--purple); }
.redpack-panel { border-left-color: var(--red); }
.redpack-panel .tp-icon { background: var(--red); }

/* ---- 投票选项（未投票：单选框） ---- */
.vote-pick {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    margin-top: 8px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--text);
    transition: border-color .12s ease, background .12s ease;
}
.vote-pick:hover { border-color: var(--border-3); background: var(--panel-2); }
.vote-pick input { flex: 0 0 auto; margin: 0; accent-color: var(--ink); }
.vote-pick span { overflow: hidden; text-overflow: ellipsis; }

/* ---- 投票结果条 ---- */
.vote-row {
    position: relative;
    padding: 9px 12px;
    margin-top: 8px;
    border-radius: var(--r-sm);
    background: var(--panel-2);
    overflow: hidden;
}
.vote-row.mine { box-shadow: inset 0 0 0 1px var(--blue-line); }
.vote-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--blue-soft);
    border-right: 2px solid var(--blue);
    transition: width .3s ease;
}
.vote-row.mine .vote-bar { background: var(--green-soft); border-right-color: var(--green); }
.vote-label {
    position: relative;   /* 压在 .vote-bar 之上 */
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--fs-sm);
    color: var(--text);
}
.vote-label em { font-style: normal; font-size: var(--fs-xs); color: var(--green); margin-left: 4px; }
.vote-num { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.vote-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.vote-note { margin-top: 10px; font-size: var(--fs-xs); color: var(--muted); }

/* ---- 最佳答案（采纳后） ---- */
.post-best { box-shadow: inset 3px 0 0 var(--green), var(--shadow-1); }
.best-badge {
    display: inline-block;
    font-size: var(--fs-xxs);
    color: var(--on-ink);
    background: var(--green);
    border-radius: var(--r-xs);
    padding: 1px 6px;
}

/* ---- 抽奖：倒计时 / 参与按钮 / 中奖名单 ---- */
.lt-prize-num {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: var(--fs-xxs);
    font-weight: 500;
    color: var(--purple);
    background: var(--purple-soft);
    border-radius: var(--r-xs);
    vertical-align: 1px;
}
.lt-countdown { color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-countdown.due { color: var(--amber); font-weight: 600; }
.lt-done { color: var(--green); }
.lt-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-2);
}
/* .tp-icon 是 float，操作区要清一下浮动，否则按钮会顶到图标右侧 */
.lt-actions, .lt-winners { clear: both; }
.lt-sub-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-2);
    font-size: var(--fs-xs);
    color: var(--muted);
}
.lt-winner-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.lt-winner {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 4px;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    background: var(--panel-2);
    font-size: var(--fs-sm);
    color: var(--text);
}
.lt-winner:hover { border-color: var(--border-3); }
.lt-winner .avatar { flex: 0 0 auto; }
.lt-winner-prize {
    font-size: var(--fs-xxs);
    color: var(--purple);
    background: var(--purple-soft);
    border-radius: var(--r-xs);
    padding: 0 5px;
}
/* ---- 抽奖：模式标签 / 参与费 / 奖品清单 / 参与要求 / 参与名单（v3.13.0） ---- */
.lt-mode-tag,
.rp-mode-tag,
.rp-split-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: var(--fs-xxs);
    font-weight: 500;
    color: var(--text-2);
    background: var(--panel-3);
    border: 1px solid var(--border-2);
    border-radius: var(--r-xs);
    vertical-align: 1px;
}
.lt-cost-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: var(--fs-xxs);
    font-weight: 500;
    color: var(--red);
    background: var(--red-soft);
    border-radius: var(--r-xs);
    vertical-align: 1px;
}
.lt-pending { color: var(--amber); }
.lt-prizes, .lt-requires, .lt-players { clear: both; }
.lt-prize-list, .lt-require-list, .lt-player-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.lt-prize-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    font-size: var(--fs-sm);
}
.lt-prize-idx {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xxs);
    font-weight: 600;
    color: var(--on-ink);
    background: var(--purple);
    border-radius: 50%;
}
.lt-prize-name { flex: 1 1 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-prize-count { flex: 0 0 auto; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.lt-require {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    font-size: var(--fs-sm);
    color: var(--text);
    cursor: pointer;
    line-height: 1.55;
}
.lt-require:hover { border-color: var(--border-3); }
.lt-require input { flex: 0 0 auto; margin-top: 3px; }
.lt-player {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--panel-2);
    font-size: var(--fs-sm);
}
.lt-player-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text);
}
.lt-player-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-player-name .avatar { flex: 0 0 auto; }
.lt-player-state {
    flex: 0 0 auto;
    font-size: var(--fs-xxs);
    padding: 1px 7px;
    border-radius: var(--r-xs);
    color: var(--muted);
    background: var(--panel-3);
}
.lt-player-state.s1 { color: var(--green); background: var(--green-soft); }
.lt-player-state.s2 { color: var(--muted); background: var(--panel-3); }
.lt-player-ops { flex: 0 0 auto; display: inline-flex; gap: 6px; }

/* ---- 红包：发放方式（v3.13.0） ---- */
.rp-countdown { color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-countdown.due { color: var(--amber); font-weight: 600; }
.rp-records .rp-record-amount ~ .rp-record-name { flex: 1 1 auto; }

/* ---- 红包：剩余份数 / 我的战绩 / 领取记录 ---- */
.rp-left-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: var(--fs-xxs);
    font-weight: 500;
    color: var(--red);
    background: var(--red-soft);
    border-radius: var(--r-xs);
    vertical-align: 1px;
}
.rp-left-tag strong { font-variant-numeric: tabular-nums; }
/* 领完 / 过期：整体压暗，红色标签换成中性色 */
.redpack-panel.expired { border-left-color: var(--border-3); }
.redpack-panel.expired .tp-icon { background: var(--border-3); }
.redpack-panel.expired .rp-left-tag { color: var(--muted); background: var(--panel-2); }

.rp-actions {
    clear: both;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-2);
}
.rp-mine {
    clear: both;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 10px 13px;
    border-radius: var(--r-sm);
    background: var(--red-soft);
    font-size: var(--fs-sm);
    color: var(--text);
}
.rp-mine-label { color: var(--muted); }
.rp-mine-amount { font-size: var(--fs-lg); font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.rp-mine-unit { font-size: var(--fs-xs); color: var(--muted); }
.rp-best-badge {
    margin-left: auto;
    padding: 2px 9px;
    font-size: var(--fs-xxs);
    font-weight: 600;
    color: var(--on-ink);
    background: var(--amber);
    border-radius: var(--r-xs);
}
.rp-best-tip { font-size: var(--fs-xs); color: var(--amber); }
/* JS 领到红包后会往 .rp-record-list 里插 .rp-record-avatar 包一层，这里是它的落点 */
.rp-record-avatar { flex: 0 0 auto; display: inline-flex; align-items: center; }
.rp-records { clear: both; }
/* 已报名名单和领取记录同构，只是没有金额列 */
.rp-player-list { max-height: 264px; overflow-y: auto; margin-top: 6px; }
.rp-record-list {
    /* 记录可能很长，给个上限免得把整页撑爆 */
    max-height: 264px;
    overflow-y: auto;
    margin-top: 6px;
}
.rp-record {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 2px;
    font-size: var(--fs-sm);
    color: var(--text);
}
.rp-record + .rp-record { border-top: 1px solid var(--border-2); }
.rp-record .avatar { flex: 0 0 auto; }
.rp-record-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-record-amount {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--red);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.rp-record-best {
    flex: 0 0 auto;
    padding: 1px 6px;
    font-size: var(--fs-xxs);
    color: var(--on-ink);
    background: var(--amber);
    border-radius: var(--r-xs);
}

/* ---- 红包拆开动效 ----
   领取成功后，面板会浮出一个「+N 积分」气泡向上飘并淡出，
   面板本身轻微弹一下。用 transition + 一次 reflow 触发，无 keyframe。 */
.redpack-panel { position: relative; }
.redpack-panel.rp-pop-host { animation: rp-host-pop .7s ease-out; }
@keyframes rp-host-pop {
    0%   { transform: scale(1); }
    22%  { transform: scale(1.022); }
    55%  { transform: scale(.995); }
    100% { transform: scale(1); }
}
.rp-pop {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 20px;
    border-radius: var(--r-md);
    background: var(--red);
    color: var(--on-ink);
    box-shadow: var(--shadow-3);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.8);
    transition: opacity .28s ease, transform .62s cubic-bezier(.2, .9, .3, 1.2);
    pointer-events: none;
    white-space: nowrap;
}
.rp-pop.on {
    opacity: 1;
    transform: translate(-50%, -170%) scale(1.04);
}
.rp-pop-amount {
    font-size: var(--fs-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.rp-pop-tip {
    font-size: var(--fs-xxs);
    opacity: .85;
}
/* 动效期间按钮处于「正在拆…」，这里让它看起来是被按下去的 */
.redpack-panel #rp-claim[disabled] { opacity: .75; }
/* 无障碍：用户开了「减少动态效果」就只保留淡入淡出，不做位移与缩放 */
@media (prefers-reduced-motion: reduce) {
    .redpack-panel.rp-pop-host { animation: none; }
    .rp-pop { transition: opacity .2s ease; transform: translate(-50%, -50%); }
    .rp-pop.on { transform: translate(-50%, -50%); }
}

/* ---- 采纳按钮 ---- */
.post-act.accept-btn {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--green);
    cursor: pointer;
}
.post-act.accept-btn:hover { text-decoration: underline; }
.post-act.accept-btn[disabled] { opacity: .5; cursor: default; text-decoration: none; }
.accept-amount {
    display: inline-block;
    margin-left: 4px;
    font-size: var(--fs-xxs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ---- 发帖页：类型附加字段 ---- */
.type-fields {
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--border-3);
    border-radius: var(--r-sm);
    padding: 14px 16px 2px;
    margin-bottom: 18px;
    background: var(--panel-2);
}
.type-fields .field:last-of-type { margin-bottom: 11px; }
.type-cost {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 9px 0 0;
    margin-bottom: 13px;
    font-size: var(--fs-sm);
    color: var(--muted);
    border-top: 1px dashed var(--border-2);
}
.type-cost strong { color: var(--amber); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }

/* 单选药丸（参与方式 / 发放方式）：横向铺开，选中时描边加粗变色 */
.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 2px;
}
.radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid var(--border-3);
    border-radius: 999px;
    background: var(--panel);
    font-size: var(--fs-sm);
    color: var(--text);
    cursor: pointer;
    line-height: 1.5;
}
.radio-pill:hover { border-color: var(--border-4); }
.radio-pill input { margin: 0; }
.radio-pill:has(input:checked) {
    border-color: var(--ink);
    background: var(--panel-3);
    color: var(--ink);
    font-weight: 500;
}

/* 奖品动态列表：序号 + 名称 + 名额 + 兑换码 */
.prize-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 9px;
}
.prize-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1.6fr) 84px minmax(0, 1.4fr);
    gap: 8px;
    align-items: center;
}
.prize-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: var(--fs-xxs);
    font-weight: 600;
    color: var(--on-ink);
    background: var(--purple);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
}
.prize-no:hover { background: var(--red); }
.prize-row input { min-width: 0; }
.btn-mini {
    padding: 4px 11px;
    font-size: var(--fs-xs);
    border-radius: var(--r-xs);
}

/* ---- 轻提示（投票成功 / 采纳结果之类） ---- */
.pb-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translate(-50%, 12px);
    z-index: 9999;
    max-width: min(90vw, 420px);
    padding: 10px 18px;
    border-radius: 20px;
    background: var(--ink);
    color: var(--on-ink);
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-3);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.pb-toast.on { opacity: 1; transform: translate(-50%, 0); }
.pb-toast.bad { background: var(--red); }

@media (max-width: 720px) {
    .type-panel { padding: 11px 13px; margin-bottom: 12px; }
    .tp-icon { width: 28px; height: 28px; margin-right: 10px; font-size: var(--fs-sm); }
    .vote-label { flex-direction: column; gap: 2px; }
    .vote-num { align-self: flex-start; }
    .vote-actions { flex-wrap: wrap; }
    .type-fields { padding: 12px 13px 0; }
    .lt-actions { flex-wrap: wrap; }
    .lt-winner-list { gap: 6px; }
    .rp-mine { padding: 9px 11px; }
    .rp-best-badge { margin-left: 0; }
    .rp-record-list { max-height: 218px; }
    .pb-toast { bottom: 22px; width: calc(100% - 32px); max-width: none; text-align: center; }
}

/* --------------------------------------------------------------------------
   27. 无障碍与打印
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: more) {
    :root { --border: #7c8798; --border-2: #8b95a5; --border-3: #5a6474; --muted: #4a5563; --text-2: #2b3547; }
}

@media print {
    .site-header, .site-footer, .to-nav, .mobile-tab, .admin-tabs, .admin-nav, .admin-page-head, .pager, .editor-bar, .reply-box, .col-side { display: none !important; }
    body { background: #fff; color: #000; }
    .post, .topic-list, .card-form { break-inside: avoid; box-shadow: none; }
}

/* ==========================================================================
   v3.15.0：主题标签 / 点赞 / 登录设备 / 移动端底部 tab
   ========================================================================== */

/* ---- 标签胶囊（主题页、标签页、标签云共用）---- */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--r-full);
    background: var(--panel-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: var(--fs-xs);
    line-height: 1.9;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.tag-chip:hover { background: var(--panel-4); color: var(--ink); border-color: var(--border-3); }
.tag-chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tag-chip em { font-style: normal; color: var(--muted); font-size: 10px; }
.tag-chip.on em { color: var(--panel-4); }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-cloud-card { margin-top: 18px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- 点赞 ---- */
.react-btn, .react-btn-sm { display: inline-flex; align-items: center; gap: 5px; }
.react-btn .react-ico, .react-btn-sm .react-ico { font-size: 13px; line-height: 1; color: var(--muted); }
.react-btn.on .react-ico, .react-btn-sm.on .react-ico { color: var(--red); }
.react-btn .react-num, .react-btn-sm .react-num { font-variant-numeric: tabular-nums; }
.react-btn-sm {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--text-2);
    cursor: pointer;
}
.react-btn-sm:hover { color: var(--ink); }
.react-btn-sm.on { color: var(--red); }
.react-btn:disabled, .react-btn-sm:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 登录设备列表 ---- */
.login-list { list-style: none; margin: 0 0 14px; padding: 0; }
.login-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-2);
    font-size: var(--fs-sm);
}
.login-list li:last-child { border-bottom: none; }
.login-ua { min-width: 140px; color: var(--ink); }
.login-ip { font-family: var(--font-mono); color: var(--text-2); font-size: var(--fs-xs); }
.login-when { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }

/* ---- 移动端底部 tab：窄屏才出现，桌面端 display:none ---- */
.mobile-tab { display: none; }

@media (max-width: 640px) {
    .mobile-tab {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        background: var(--panel);
        border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -1px 6px rgba(0, 0, 0, .04);
    }
    .mt-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        position: relative;
        padding: 4px 0;
        color: var(--muted);
        font-size: 10.5px;
        text-decoration: none;
    }
    .mt-item .icon { width: 20px; height: 20px; }
    .mt-item.on { color: var(--ink); }
    .mt-item.mt-post { color: var(--ink); }
    .mt-dot {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(6px);
        min-width: 15px;
        height: 15px;
        padding: 0 4px;
        border-radius: var(--r-full);
        background: var(--red);
        color: var(--on-ink);
        font-size: 9.5px;
        font-style: normal;
        line-height: 15px;
        text-align: center;
    }
    /* 给底栏让位：否则页面最后一段内容会被盖住 */
    body { padding-bottom: 64px; }
    .to-nav { bottom: 76px; }
}
