/*
Theme Name: 曼巴线报 Manba Xianbao
Theme URI: https://bw4.cn
Author: WorkBuddy
Author URI: https://bw4.cn
Description: 曼巴线报专用 WordPress 主题。实时线报时间线、平台彩色标签、关键词筛选、线报时效标记、日期分组、新线报增量提醒、口令/链接一键复制、收藏与分享、白蓝双主题（含暗夜模式）、移动端底部快捷栏，内置用户注册登录、投稿线报、积分等级、收藏云同步、有用/失效反馈、自建流量统计、sitemap.xml 与结构化数据。纯 CSS 变量实现，无第三方依赖。
Version: 1.3.1
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: manba
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready, block-styles
*/

/* ============================================================
   1. 设计变量 —— 白 + 蓝
   ============================================================ */
:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --fs: 15px;
    --lh: 1.7;

    /* 主色：蓝 */
    --brand: #1A6DFF;
    --brand-2: #4A8DFF;
    --brand-deep: #0B4FD1;
    --brand-soft: #EAF2FF;
    --brand-line: #C9DEFF;

    --accent: #FF7A00;
    --danger: #E1251B;
    --ok: #12A150;

    /* 浅色：白底为主 */
    --bg: #F2F6FC;
    --bg-card: #FFFFFF;
    --bg-soft: #F5F8FD;
    --bg-code: #F5F8FD;
    --text: #16202E;
    --text-2: #4E5C70;
    --text-3: #8D9BB0;
    --border: #E4EBF5;
    --border-2: #D8E3F2;
    --shadow: 0 1px 2px rgba(16, 40, 81, .05), 0 4px 12px rgba(16, 40, 81, .05);
    --shadow-lg: 0 8px 28px rgba(16, 40, 81, .12);
    --radius: 8px;
}
[data-theme="dark"] {
    --brand: #4D8DFF;
    --brand-2: #7BAAFF;
    --brand-deep: #3A78E8;
    --brand-soft: #16243C;
    --brand-line: #2A4266;

    --bg: #0E131B;
    --bg-card: #161D28;
    --bg-soft: #1D2632;
    --bg-code: #1D2632;
    --text: #E7EDF6;
    --text-2: #A2B0C4;
    --text-3: #6D7C91;
    --border: #253141;
    --border-2: #2E3B4D;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, .55);
}

/* ============================================================
   2. 基础
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs);
    line-height: var(--lh);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; height: auto; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.4; }
p { margin: 0 0 10px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* 容器宽度：
   原来是固定 1160px，宽屏下两侧白得离谱（实测 1470 屏左右各空 171px、
   1920 屏各空 396px）。现在改成「贴着屏幕走」：
   - ≥1180px：宽度 = min(1880px, 视口 - 96px)，两侧只留 48px。
     右边这 48px 同时是「回到顶部 / 收藏」两个 40px 悬浮球的停车带
     （球占 18~58px，内容从 68px 才开始，不会再压住侧栏）；
   - 视口 >1976px 后封顶 1880px，防止超宽屏一行拉太长；
   - <1180px 不留停车带，小屏把宽度用满。
   用 @supports 兜一层 min()，老浏览器退回 1440px 固定上限。 */
:root { --wrap-max: 1880px; }
.mb-wrap {
    width: 100%; max-width: 1440px;
    margin: 0 auto; padding: 0 20px;
}
@supports (width: min(1px, 2px)) {
    @media (min-width: 1180px) {
        .mb-wrap { max-width: min(var(--wrap-max), calc(100% - 96px)); }
    }
}

/* 悬浮按钮（回到顶部 / 我的收藏）：默认待在右侧 48px 的停车带里；
   屏幕特别宽、容器已封顶时，跟着把按钮往外推到容器旁边。 */
@media (min-width: 1180px) {
    @supports (right: max(1px, 2px)) {
        .mb-totop, .mb-favtoggle {
            right: max(18px, calc((100vw - min(var(--wrap-max), 100vw - 96px)) / 2 - 46px));
        }
    }
}
.mb-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.mb-muted { color: var(--text-3); }
.mb-clear { clear: both; }

/* 平台标签配色 */
.mb-tag {
    display: inline-block; padding: 1px 7px; margin-right: 6px;
    font-size: 12px; line-height: 18px; border-radius: 3px;
    color: #fff; background: var(--text-3); white-space: nowrap; vertical-align: 1px;
}
.mb-tag[data-p="jd"]    { background: #E1251B; }
.mb-tag[data-p="tb"]    { background: #FF5000; }
.mb-tag[data-p="pdd"]   { background: #E02E24; }
.mb-tag[data-p="mt"]    { background: #FFC300; color: #4a3600; }
.mb-tag[data-p="elm"]   { background: #0085FF; }
.mb-tag[data-p="zfb"]   { background: #1677FF; }
.mb-tag[data-p="wx"]    { background: #07C160; }
.mb-tag[data-p="dy"]    { background: #111827; }
.mb-tag[data-p="ysf"]   { background: #C8102E; }
.mb-tag[data-p="bank"]  { background: #0066B3; }
.mb-tag[data-p="vip"]   { background: #7C4DFF; }
.mb-tag[data-p="tel"]   { background: #0FA47F; }
.mb-tag[data-p="other"] { background: #8a94a6; }

/* ============================================================
   3. 顶部
   ============================================================ */
.mb-topbar {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 60; box-shadow: var(--shadow);
}
.mb-topbar .mb-wrap { display: flex; align-items: center; height: 58px; gap: 16px; }
.mb-logo { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mb-logo img { height: 34px; width: auto; display: block; }
.mb-logo .mb-logo-txt { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.mb-logo .mb-logo-txt em { font-style: normal; color: var(--brand); }

/* 导航：宽度不够时横向可滚，而不是被 overflow:hidden 悄悄裁掉末端几项
   （登录前后右侧按钮宽度不同，靠固定宽度算很容易漏） */
.mb-nav {
    display: flex; flex: 1; min-width: 0; align-items: center; gap: 2px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none;
}
.mb-nav::-webkit-scrollbar { display: none; }
.mb-nav a {
    padding: 6px 12px; border-radius: 5px; font-size: 14px; color: var(--text-2); white-space: nowrap;
}
.mb-nav a:hover { background: var(--bg-soft); color: var(--brand); }
.mb-nav a.mb-on { color: #fff; background: var(--brand); }

.mb-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mb-search { position: relative; }
.mb-search input {
    width: 200px; height: 34px; padding: 0 34px 0 12px; color: var(--text);
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 17px; outline: none;
}
.mb-search input:focus { border-color: var(--brand); background: var(--bg-card); }
.mb-search button {
    position: absolute; right: 4px; top: 3px; width: 28px; height: 28px; cursor: pointer;
    border: 0; background: none; color: var(--text-3); font-size: 15px;
}
.mb-iconbtn {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%; background: var(--bg-soft);
    color: var(--text-2); cursor: pointer; font-size: 15px;
}
.mb-iconbtn:hover { color: var(--brand); border-color: var(--brand); }

/* 中窄屏：搜索框与导航项一起收一收，让 7 个菜单项在窄笔记本上也放得下。
   ⚠️ 必须写在 .mb-nav a / .mb-search input 的基础规则**之后**，否则会被同优先级覆盖。 */
@media (min-width: 940px) and (max-width: 1439px) {
    .mb-search input { width: 140px; }
    .mb-nav a { padding: 6px 8px; font-size: 13px; }
}
/* 登录后右侧会多出「投稿 + 头像 + 昵称」，比未登录宽不少。
   中窄屏把昵称文字收掉只留头像，给导航腾地方（点头像仍进个人中心）。 */
@media (min-width: 940px) and (max-width: 1279px) {
    .mb-user-name { display: none; }
}
/* 再窄就隐藏顶部导航（此时侧栏「线报分类」卡片接替） */
@media (max-width: 939px) { .mb-nav { display: none; } }

/* ============================================================
   4. 首页主体
   ============================================================ */
.mb-main { display: flex; gap: 16px; margin: 16px auto 24px; align-items: flex-start; }
.mb-col-l { flex: 1; min-width: 0; }
.mb-col-r { width: 320px; flex: 0 0 320px; }

.mb-notice {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 12px;
    font-size: 13px; color: #8a5a00; background: #fff8e6; border-left: 3px solid #ffb300;
    border-radius: var(--radius);
}
[data-theme="dark"] .mb-notice { background: #2a2416; color: #f0c674; }
.mb-notice b { color: var(--accent); }

/* 筛选栏 */
.mb-filter {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 12px 14px; margin-bottom: 12px;
}
.mb-filter .mb-flabel { font-size: 13px; color: var(--text-3); margin-right: 4px; }
.mb-chip {
    padding: 4px 12px; font-size: 13px; border-radius: 14px;
    border: 1px solid var(--border); color: var(--text-2); background: var(--bg-card);
}
.mb-chip:hover { border-color: var(--brand); color: var(--brand); }
.mb-chip.mb-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mb-filter .mb-spacer { flex: 1; }
.mb-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* 时间线列表 */
.mb-list { padding: 4px 0; }
.mb-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.mb-item:last-child { border-bottom: 0; }
.mb-item:hover { background: var(--bg-soft); }
.mb-time {
    flex: 0 0 62px; text-align: right; font-size: 12px; color: var(--text-3);
    padding-top: 2px; font-variant-numeric: tabular-nums;
}
.mb-item .mb-body { flex: 1; min-width: 0; }
.mb-item .mb-title {
    font-size: 15px; font-weight: 400; color: var(--text); line-height: 1.6;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-item a:hover .mb-title { color: var(--brand); }
.mb-item .mb-meta { margin-top: 4px; font-size: 12px; color: var(--text-3); display: flex; gap: 12px; }
.mb-badge-top {
    display: inline-block; padding: 0 6px; margin-right: 6px; font-size: 12px; line-height: 18px;
    border-radius: 3px; background: var(--accent); color: #fff;
}
.mb-item.is-top .mb-title { font-weight: 600; color: var(--accent); }
.mb-item.is-new .mb-time { color: var(--danger); font-weight: 600; }

/* 分页 / 加载更多 */
.mb-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; margin-top: 12px; }
.mb-pager .page-numbers, .mb-more {
    padding: 6px 14px; border-radius: 4px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-2); font-size: 14px; cursor: pointer;
}
.mb-pager .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.mb-more { width: 100%; border: 0; padding: 11px; color: var(--brand); background: var(--bg-card); }
.mb-more:hover { background: var(--bg-soft); }
.mb-more[disabled] { color: var(--text-3); cursor: default; }

/* ============================================================
   5. 侧栏组件
   ============================================================ */
.mb-widget { padding: 14px; margin-bottom: 14px; }
.mb-widget h3 {
    font-size: 15px; margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border); color: var(--text);
}
.mb-widget h3 span { float: right; font-size: 12px; font-weight: 400; color: var(--text-3); }
.mb-hot li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.mb-hot li:last-child { border-bottom: 0; }
.mb-hot .mb-hot-i { flex: 0 0 18px; height: 18px; line-height: 18px; text-align: center; font-size: 12px; border-radius: 3px; background: var(--bg-soft); color: var(--text-3); }
.mb-hot li:nth-child(1) .mb-hot-i { background: var(--danger); color: #fff; }
.mb-hot li:nth-child(2) .mb-hot-i { background: #ff7a45; color: #fff; }
.mb-hot li:nth-child(3) .mb-hot-i { background: #ffa940; color: #fff; }
.mb-hot .mb-hot-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-hot a { color: var(--text-2); }
.mb-hot a:hover { color: var(--brand); }

.mb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-cats a {
    padding: 5px 12px; font-size: 13px; border-radius: 4px;
    background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
}
.mb-cats a:hover { border-color: var(--brand); color: var(--brand); }
.mb-qr { text-align: center; }
.mb-qr img { width: 100%; max-width: 220px; border-radius: 6px; }
.mb-qr p { margin: 10px 0 0; font-size: 13px; color: var(--text-3); }
.mb-links { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-links a {
    flex: 0 0 calc(50% - 4px); padding: 8px 10px; font-size: 13px; border-radius: 4px;
    background: var(--bg-soft); color: var(--text-2); text-align: center; border: 1px solid var(--border);
}
.mb-links a:hover { border-color: var(--brand); color: var(--brand); }

/* ============================================================
   6. 详情页
   ============================================================ */
.mb-crumb { padding: 10px 14px; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.mb-crumb a { color: var(--text-2); }
.mb-crumb .mb-sep { margin: 0 6px; }

.mb-post { padding: 20px 22px; }
.mb-post h1 { font-size: 22px; line-height: 1.5; margin-bottom: 10px; }
.mb-post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
    font-size: 13px; color: var(--text-3);
}
.mb-go {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 4px;
    background: var(--brand); color: #fff !important; font-size: 14px;
}
.mb-go:hover { background: var(--brand-2); }
.mb-copy {
    padding: 6px 14px; border-radius: 4px; border: 1px solid var(--brand);
    color: var(--brand) !important; background: transparent; font-size: 13px; cursor: pointer;
}
.mb-content { padding: 18px 0 4px; font-size: 15px; line-height: 1.85; color: var(--text); word-wrap: break-word; }
.mb-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; display: block; }
.mb-content a { word-break: break-all; text-decoration: underline; }
.mb-content hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.mb-content .xdg { font-size: 15px; }
.mb-content p { margin: 0 0 12px; }
.mb-risk {
    margin-top: 18px; padding: 12px 14px; font-size: 13px; border-radius: var(--radius);
    background: #fff8e6; color: #8a5a00; border-left: 3px solid #ffb300;
}
[data-theme="dark"] .mb-risk { background: #2a2416; color: #f0c674; }

.mb-postnav { display: flex; gap: 12px; margin-top: 12px; }
.mb-postnav a {
    flex: 1; padding: 12px 14px; font-size: 13px; border-radius: var(--radius);
    background: var(--bg-card); box-shadow: var(--shadow); color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-postnav a:hover { color: var(--brand); }
.mb-rel { padding: 14px 16px; margin-top: 12px; }
.mb-rel li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.mb-rel li:last-child { border-bottom: 0; }
.mb-rel a { color: var(--text-2); }
.mb-rel a:hover { color: var(--brand); }

/* ============================================================
   7. 归档 / 搜索
   ============================================================ */
.mb-arch-head { padding: 16px 18px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mb-arch-head h1 { font-size: 19px; }
.mb-arch-head .mb-muted { font-size: 13px; }
.mb-empty { padding: 60px 20px; text-align: center; color: var(--text-3); }

/* ============================================================
   8. 页脚
   ============================================================ */
.mb-footer { margin-top: 30px; padding: 26px 0 20px; background: var(--bg-card); border-top: 1px solid var(--border); }
.mb-footer .mb-fgrid { display: flex; gap: 30px; flex-wrap: wrap; }
.mb-footer .mb-fcol { flex: 1; min-width: 200px; }
.mb-footer h4 { font-size: 14px; margin-bottom: 10px; color: var(--text); }
.mb-footer li { padding: 3px 0; font-size: 13px; }
.mb-footer li a { color: var(--text-3); }
.mb-footer li a:hover { color: var(--brand); }
.mb-footer .mb-copy-line {
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-3); text-align: center; line-height: 1.9;
}
/* 底部备案号：跟随版权文字颜色，悬停才变蓝，不抢眼 */
.mb-footer .mb-copy-line a.mb-icp { color: var(--text-3); }
.mb-footer .mb-copy-line a.mb-icp:hover { color: var(--brand); text-decoration: underline; }

/* 移动端底部栏 */
.mb-mbar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--bg-card); border-top: 1px solid var(--border);
}
.mb-mbar a { flex: 1; padding: 9px 0; text-align: center; font-size: 12px; color: var(--text-2); }
.mb-mbar a.mb-on { color: var(--brand); }
.mb-mbar .mb-mb-i { display: block; font-size: 17px; line-height: 1.4; }

.mb-totop {
    position: fixed; right: var(--float-r, 18px); bottom: 70px; z-index: 65;
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-2); cursor: pointer; display: none;
    box-shadow: var(--shadow-lg); font-size: 16px;
}
.mb-totop.show { display: block; }

/* Toast */
.mb-toast {
    position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%); z-index: 200;
    padding: 10px 20px; border-radius: 6px; background: rgba(0,0,0,.82); color: #fff; font-size: 14px;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.mb-toast.show { opacity: 1; }

/* ============================================================
   9. 响应式
   ============================================================ */
@media (max-width: 900px) {
    .mb-col-r { display: none; }
    .mb-nav { display: none; }
    .mb-search input { width: 140px; }
    .mb-post h1 { font-size: 19px; }
    .mb-post { padding: 16px; }
    .mb-mbar { display: flex; }
    body { padding-bottom: 56px; }
    .mb-time { flex-basis: 54px; font-size: 11px; }
    .mb-item .mb-title { font-size: 14px; white-space: normal; }
}

/* ============================================================
   10. 增强模块
   ============================================================ */

/* ---- 统计条 ---- */
.mb-statbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
    padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text-2);
}
.mb-statbar .mb-stat b { color: var(--brand); font-size: 15px; }
.mb-statbar .mb-spacer { flex: 1; }
.mb-statbar .mb-stat-rss {
    font-size: 12px; padding: 3px 10px; border-radius: 12px;
    border: 1px solid var(--border); color: var(--text-3);
}
.mb-statbar .mb-stat-rss:hover { border-color: var(--accent); color: var(--accent); }

/* ---- 日期分隔 ---- */
.mb-daysep {
    padding: 10px 16px 4px; font-size: 12px; color: var(--text-3);
}
.mb-daysep span {
    display: inline-block; padding: 2px 12px; border-radius: 10px;
    background: var(--brand-soft); border: 1px solid var(--brand-line);
    color: var(--brand); font-weight: 600;
}
.mb-daysep.is-topsep span {
    background: #FFF4E5; border-color: #FFD8A8; color: #B26A00;
}
[data-theme="dark"] .mb-daysep.is-topsep span {
    background: #2E2314; border-color: #5C471F; color: #E0A94A;
}

/* ---- 失效线报 ---- */
.mb-tag-exp { background: #9AA3B0 !important; }
.mb-item.is-exp .mb-title { color: var(--text-3); }
.mb-expnote {
    margin: 14px 0 0; padding: 12px 14px; font-size: 13px; line-height: 1.8;
    border-radius: var(--radius); background: #fff1f0;
    border-left: 3px solid var(--danger); color: #8c1f16;
}
[data-theme="dark"] .mb-expnote { background: #2c1a19; color: #ff9d95; }
.mb-expnote a { color: var(--danger); text-decoration: underline; }

/* ---- 新线报提示条 ---- */
.mb-newbar {
    display: flex; align-items: center; justify-content: center;
    padding: 10px; margin: 8px 12px 0; cursor: pointer; font-size: 13px;
    border-radius: 16px; background: var(--brand); color: #fff;
    animation: mb-drop .25s ease-out;
}
.mb-newbar[hidden] { display: none; }
.mb-newbar:hover { background: var(--brand-2); }
@keyframes mb-drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- 热门搜索 ---- */
.mb-hotsearch {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 12px 14px; margin-bottom: 12px;
}
.mb-hotsearch .mb-flabel { font-size: 13px; color: var(--text-3); margin-right: 4px; }

/* ---- 收藏面板 ---- */
.mb-favbar {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 150;
    width: 300px; max-width: 86vw; padding: 16px; overflow-y: auto;
    background: var(--bg-card); box-shadow: -4px 0 20px rgba(0,0,0,.15);
    transform: translateX(100%); transition: transform .22s ease-out;
}
.mb-favbar.show { transform: none; }
.mb-favbar h3 { font-size: 15px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mb-favbar .mb-favitem { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.mb-favbar .mb-favitem a { color: var(--text-2); display: block; }
.mb-favbar .mb-favitem a:hover { color: var(--brand); }
.mb-favbar .mb-favitem .mb-favdel { float: right; color: var(--text-3); cursor: pointer; font-size: 12px; }
.mb-favbar .mb-favnone { color: var(--text-3); font-size: 13px; padding: 20px 0; text-align: center; }
.mb-favtoggle {
    position: fixed; right: var(--float-r, 18px); bottom: 122px; z-index: 66;
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-2); cursor: pointer;
    box-shadow: var(--shadow-lg); font-size: 15px;
}
.mb-favtoggle:hover { color: var(--brand); border-color: var(--brand); }
#mb-fav.is-on { background: var(--brand); color: #fff !important; border-color: var(--brand); }

@media (max-width: 900px) {
    .mb-statbar { gap: 10px; font-size: 12px; padding: 9px 12px; }
    .mb-totop { bottom: 116px; }
    .mb-favtoggle { bottom: 168px; right: 14px; }
}

/* ============================================================
   11. 用户系统
   ============================================================ */

/* ---- 头像 / 等级 ---- */
.mb-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; font-weight: 600; flex: 0 0 auto;
    line-height: 1; user-select: none; letter-spacing: 0;
}
.mb-lv {
    display: inline-block; padding: 1px 7px; border-radius: 3px;
    font-size: 11px; line-height: 17px; color: #fff; white-space: nowrap; vertical-align: 1px;
}

/* ---- 顶部登录态 ---- */
.mb-user-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
    border-radius: 17px; border: 1px solid var(--border); background: var(--bg-soft);
    color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.mb-user-btn:hover { border-color: var(--brand); color: var(--brand); }
.mb-user-btn.is-reg { background: var(--brand); border-color: var(--brand); color: #fff; }
.mb-user-btn.is-reg:hover { background: var(--brand-2); color: #fff; }
.mb-user-btn .mb-user-ico { font-size: 14px; }

/* ---- 登录 / 注册页 ---- */
.mb-auth {
    display: flex; gap: 16px; align-items: flex-start;
    max-width: 900px; margin: 24px auto 40px;
}
.mb-auth-card { flex: 1; min-width: 0; padding: 24px 26px; }
.mb-auth-brand { text-align: center; margin-bottom: 18px; }
.mb-auth-brand p { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.mb-auth-logo { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.mb-auth-logo em { font-style: normal; color: var(--brand); }

.mb-auth-tabs {
    display: flex; gap: 4px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.mb-auth-tab {
    flex: 1; text-align: center; padding: 9px 0; font-size: 14px;
    color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mb-auth-tab.is-on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.mb-form { display: block; }
.mb-field { display: block; margin-bottom: 14px; }
.mb-field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.mb-field input[type=text],
.mb-field input[type=email],
.mb-field input[type=password],
.mb-field input[type=url],
.mb-field input[type=number],
.mb-field select,
.mb-field textarea {
    width: 100%; padding: 9px 12px; color: var(--text);
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; outline: none;
}
.mb-field input:focus, .mb-field select:focus, .mb-field textarea:focus {
    border-color: var(--brand); background: var(--bg-card);
}
.mb-field input:disabled { color: var(--text-3); cursor: not-allowed; }
.mb-field textarea { resize: vertical; line-height: 1.7; }
.mb-check { display: flex; align-items: center; gap: 7px; margin: 0 0 16px; font-size: 13px; color: var(--text-2); }
.mb-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text-2); cursor: pointer; font-size: 14px;
}
.mb-btn:hover { border-color: var(--brand); color: var(--brand); }
.mb-btn[disabled] { opacity: .65; cursor: default; }
.mb-btn-primary {
    width: 100%; background: var(--brand); border-color: var(--brand); color: #fff; font-size: 15px;
}
.mb-btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.mb-form .mb-btn-primary { margin-top: 4px; }
.mb-form-flat .mb-btn-primary { width: auto; padding: 10px 26px; }
.mb-form-tip { margin: 14px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
.mb-form-note {
    margin: 0 0 16px; padding: 10px 12px; font-size: 13px; line-height: 1.7;
    background: var(--brand-soft); border-radius: 6px; color: var(--text-2);
}
.mb-auth-msg {
    margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 13px;
}
.mb-auth-msg.is-ok { background: #eaf7ef; color: #0f7a3d; }
.mb-auth-msg.is-no { background: #fdeceb; color: #b32d2e; }
[data-theme="dark"] .mb-auth-msg.is-ok { background: #17321f; color: #63d68f; }
[data-theme="dark"] .mb-auth-msg.is-no { background: #3a1f1e; color: #ff9d95; }
.mb-auth-done { padding: 40px; text-align: center; }

.mb-auth-side { width: 320px; flex: 0 0 320px; padding: 20px 22px; }
.mb-auth-side h3 { font-size: 15px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mb-auth-perks li {
    padding: 8px 0; font-size: 13px; line-height: 1.7; color: var(--text-2);
    border-bottom: 1px dashed var(--border);
}
.mb-auth-perks li:last-child { border-bottom: 0; }
.mb-auth-perks b { color: var(--text); }
.mb-auth-lv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ---- 个人中心 ---- */
.mb-user { display: flex; gap: 16px; align-items: flex-start; margin: 16px auto 30px; }
.mb-user-side { width: 260px; flex: 0 0 260px; padding: 18px; position: sticky; top: 74px; }
.mb-user-me { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.mb-user-me-t { min-width: 0; }
.mb-user-me-t b { display: block; font-size: 15px; margin-bottom: 4px; word-break: break-all; }
.mb-user-pts { padding: 14px 0; border-bottom: 1px solid var(--border); }
.mb-user-pts-n { font-size: 13px; color: var(--text-2); }
.mb-user-pts-n b { font-size: 22px; color: var(--brand); font-weight: 600; }
.mb-bar { height: 6px; margin: 8px 0 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.mb-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.mb-user-pts-t { font-size: 12px; color: var(--text-3); }
.mb-user-pts-t b { color: var(--brand); }
.mb-user-nav { display: block; padding: 8px 0; }
.mb-user-nav a {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 2px;
    border-radius: 6px; font-size: 14px; color: var(--text-2);
}
.mb-user-nav a:hover { background: var(--bg-soft); color: var(--brand); }
.mb-user-nav a.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.mb-user-nav a em {
    margin-left: auto; font-style: normal; font-size: 11px; padding: 0 7px; line-height: 17px;
    border-radius: 9px; background: var(--danger); color: #fff;
}
.mb-user-logout {
    display: block; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-3); text-align: center;
}
.mb-user-logout:hover { color: var(--danger); }

.mb-ucard { padding: 18px 20px; margin-bottom: 14px; }
.mb-ucard h2 {
    font-size: 15px; margin-bottom: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.mb-ustats { display: flex; gap: 10px; flex-wrap: wrap; }
.mb-ustats a {
    flex: 1; min-width: 92px; padding: 12px 10px; text-align: center; border-radius: 8px;
    background: var(--bg-soft); border: 1px solid var(--border);
}
.mb-ustats a:hover { border-color: var(--brand); }
.mb-ustats a b { display: block; font-size: 22px; color: var(--brand); font-weight: 600; line-height: 1.4; }
.mb-ustats a span { font-size: 12px; color: var(--text-3); }
.mb-rule li {
    display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px;
    color: var(--text-2); border-bottom: 1px dashed var(--border);
}
.mb-rule li:last-child { border-bottom: 0; }
.mb-rule b { color: var(--ok); }
.mb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mb-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.mb-table tr:last-child td { border-bottom: 0; }

/* 我的投稿 */
.mb-mypost { padding: 11px 0; border-bottom: 1px dashed var(--border); }
.mb-mypost:last-child { border-bottom: 0; }
.mb-mypost-t { font-size: 14px; color: var(--text); line-height: 1.6; }
.mb-mypost-m { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.mb-st { padding: 1px 8px; border-radius: 3px; font-size: 11px; line-height: 17px; }
.mb-st.is-ok { background: #eaf7ef; color: #0f7a3d; }
.mb-st.is-wait { background: #fff5e6; color: #a86a00; }
.mb-st.is-no { background: #fdeceb; color: #b32d2e; }
[data-theme="dark"] .mb-st.is-ok { background: #17321f; color: #63d68f; }
[data-theme="dark"] .mb-st.is-wait { background: #33280f; color: #e0ab52; }
[data-theme="dark"] .mb-st.is-no { background: #3a1f1e; color: #ff9d95; }

/* 收藏页 */
.mb-favlist-page { display: block; }
.mb-fav-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    border-bottom: 1px dashed var(--border); font-size: 14px;
}
.mb-fav-row:last-child { border-bottom: 0; }
.mb-fav-row > a { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-fav-row > a:hover { color: var(--brand); }
.mb-fav-row .mb-muted { font-size: 12px; white-space: nowrap; }
.mb-fav-rm {
    padding: 3px 10px; font-size: 12px; border-radius: 4px; cursor: pointer;
    border: 1px solid var(--border); background: transparent; color: var(--text-3); white-space: nowrap;
}
.mb-fav-rm:hover { border-color: var(--danger); color: var(--danger); }

/* 投稿人 */
.mb-contrib {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 14px;
    background: var(--bg-soft); border-radius: var(--radius); border: 1px solid var(--border);
}
.mb-contrib b { font-size: 14px; margin-right: 6px; }
.mb-contrib .mb-muted { margin-top: 2px; }

/* ---- 阅读进度条 ---- */
.mb-progress {
    position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 90;
    background: transparent; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.mb-progress.show { opacity: 1; }
.mb-progress i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---- 有用 / 失效 投票 ---- */
.mb-vote {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px;
    padding: 14px 16px; border-radius: var(--radius);
    background: var(--bg-soft); border: 1px solid var(--border);
}
.mb-vote-q { font-size: 14px; color: var(--text-2); margin-right: 4px; }
.mb-vbtn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
    border-radius: 18px; border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-2); font-size: 14px; cursor: pointer;
}
.mb-vbtn:hover { border-color: var(--brand); color: var(--brand); }
.mb-vbtn b { color: var(--brand); font-variant-numeric: tabular-nums; }
.mb-vbtn-dead:hover { border-color: var(--danger); color: var(--danger); }
.mb-vbtn-dead b { color: var(--danger); }
.mb-vote-tip { font-size: 12px; }
.mb-expnote-hot { margin-bottom: 14px; }

/* ---- 图片放大 ---- */
.mb-lightbox {
    position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: rgba(8, 14, 24, .9); cursor: zoom-out;
    animation: mb-fade .18s ease-out;
}
.mb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
@keyframes mb-fade { from { opacity: 0; } to { opacity: 1; } }

/* 相关线报右侧时间 */
.mb-rel a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-rel-t { float: right; font-size: 12px; margin-left: 10px; }

@media (max-width: 900px) {
    .mb-user-btn { display: none; }
    .mb-user-btn.mb-user-login { display: inline-flex; padding: 0 10px; }
    .mb-auth { flex-direction: column; margin: 12px auto 24px; }
    .mb-auth-side { width: 100%; flex: 1 1 auto; }
    .mb-auth-card { padding: 20px 18px; }
    .mb-user { flex-direction: column; }
    .mb-user-side { width: 100%; flex: 1 1 auto; position: static; }
    .mb-user-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .mb-user-nav a { flex: 1 1 44%; margin-bottom: 0; }
    .mb-vote { padding: 12px; }
    .mb-vote-q { width: 100%; }
    .mb-vote-tip { display: none; }
    .mb-progress { top: 0; }
}
