/* 校园墙 · 全局样式（移动优先，移动端底部导航） */
:root {
    --bg: #f2f4f9;
    --card: #ffffff;
    --text: #1a1d29;
    --muted: #7c8494;
    --line: #e6e9f0;
    --primary: #4a6cf7;
    --primary-d: #3a55d6;
    --primary-s: #eef2ff;
    --danger: #e5484d;
    --danger-s: #fdecec;
    --ok: #12a150;
    --warn: #f59e0b;
    --radius: 14px;
    --shadow: 0 2px 14px rgba(26, 34, 66, .06);
    --nav-h: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 属性必须压过组件自身的 display（否则 .modal{display:flex} 会让弹窗关不掉） */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd5e3; border-radius: 8px; }

.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.req { color: var(--danger); }
.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--danger); font-weight: 700; }
.hide { display: none !important; }

/* ---------- 顶栏 ---------- */
.appbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 12px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.brand .logo { font-size: 20px; }
.brand-text { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; color: var(--muted);
    background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--primary-s); color: var(--primary); }
/* UI 图标：真实 SVG 图片文件 via mask，颜色继承 currentColor */
.ic {
    display: inline-block; width: 20px; height: 20px; flex: 0 0 auto;
    background: currentColor; vertical-align: -4px;
    -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain;
    mask-position: center; mask-repeat: no-repeat; mask-size: contain;
}

/* ---------- 布局 ---------- */
.shell { display: flex; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 12px; align-items: flex-start; }
.main { flex: 1 1 auto; min-width: 0; }
.sidebar { display: none; }

@media (min-width: 861px) {
    body { padding-bottom: 0; }
    .sidebar {
        display: block; position: sticky; top: 66px;
        width: 210px; flex: 0 0 210px;
        display: flex; flex-direction: column; gap: 10px;
    }
    .fab { display: none; }
}

.side-nav, .side-block {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
    box-shadow: var(--shadow);
}
.side-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px; color: #414a5e; font-weight: 600;
}
.side-item:hover { background: var(--primary-s); color: var(--primary); }
.side-item.active { background: var(--primary); color: #fff; }
.side-item.active .badge { background: #fff; color: var(--primary); }
.side-title { font-size: 12px; color: var(--muted); padding: 6px 12px; font-weight: 700; letter-spacing: 1px; }
.side-sub { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; color: #4a5265; font-size: 14px; }
.side-sub:hover { background: #f4f6fb; }
.side-sub.active { background: var(--primary-s); color: var(--primary); font-weight: 700; }
.badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-style: normal;
    border-radius: 20px; padding: 1px 7px; font-weight: 700; }

/* ---------- 底部导航（移动端） ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; align-items: stretch;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11px; color: var(--muted); position: relative;
}
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--primary); font-weight: 700; }
.tab.active .ic { transform: translateY(-1px); }
.tab-plus .tab-ic { background: var(--primary); color: #fff; border-radius: 50%; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 1px; }
.tab-plus.active .tab-ic { background: var(--primary-d); }
.tab-ic { position: relative; display: block; }
.dot {
    position: absolute; top: -3px; right: -8px; background: var(--danger); color: #fff;
    font-size: 10px; font-style: normal; border-radius: 10px; padding: 0 5px; min-width: 16px; text-align: center;
    line-height: 16px; font-weight: 700; border: 1.5px solid #fff;
}
@media (min-width: 861px) { .tabbar { display: none; } }

.fab {
    position: fixed; right: 16px; bottom: calc(var(--nav-h) + 18px); z-index: 45;
    width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(74, 108, 247, .38);
}
.fab .ic { width: 26px; height: 26px; }

/* ---------- 卡片 / 排版 ---------- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-title { margin: 18px 0 10px; font-size: 15px; font-weight: 800; }
.card-title:first-child { margin-top: 0; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.35; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.section-title h3 { margin: 0; font-size: 16px; }

.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .field:nth-child(odd) { grid-column: 1; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 按钮 / 表单 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--line); background: #fff; color: var(--text);
    padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600;
    transition: transform .05s ease, background .15s;
}
.btn:hover { background: #f6f7fb; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3b40; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 18px; font-size: 16px; }
.btn-block { width: 100%; }

.input, textarea.input, select.input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fbfcfe; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); background: #fff; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.6; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: #59617a; margin-bottom: 5px; font-weight: 600; }
.seg { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.seg label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.agree { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0; font-size: 13.5px; color: #59617a; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.check-list li span.muted { margin-left: auto; font-size: 12px; }

/* ---------- 头图 / 公告 ---------- */
.announce {
    background: linear-gradient(135deg, #eef2ff, #f5f0ff);
    border: 1px solid #dfe5ff; color: #374269;
    border-radius: 12px; padding: 9px 12px; margin-bottom: 12px;
    display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px;
}
.announce .ic { flex: 0 0 auto; margin-top: 2px; }

.hero {
    background: linear-gradient(135deg, #4a6cf7, #7b5cf7 60%, #a855f7);
    color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(74, 108, 247, .25);
}
.hero h2 { font-size: 18px; }
.hero p { margin: 4px 0 0; opacity: .9; font-size: 13.5px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -ms-overflow-style: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px;
    padding: 7px 14px; font-size: 13.5px; white-space: nowrap; color: #464f66;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ---------- 头像 ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e8ebf3; }
.avatar.sm { width: 30px; height: 30px; }
.avatar.lg { width: 76px; height: 76px; }
.avatar-wrap { display: inline-flex; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid #fff; }

/* ---------- 帖子列表 ---------- */
.topic {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.topic-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.topic-head .who { display: flex; flex-direction: column; line-height: 1.3; }
.topic-head .who b { font-size: 14.5px; }
.topic-head .who small { color: var(--muted); font-size: 12px; }
.topic-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; word-break: break-word; }
.topic-title a:hover { color: var(--primary); }
.topic-body { color: #39415a; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.topic-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.topic-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.topic-foot a, .topic-foot button { display: inline-flex; align-items: center; gap: 5px; color: var(--muted);
    background: none; border: 0; cursor: pointer; padding: 0; font-size: 13px; }
.topic-foot a:hover, .topic-foot button:hover { color: var(--primary); }
.topic-foot .liked { color: var(--danger); }
.tag {
    font-size: 11.5px; padding: 1px 8px; border-radius: 20px; background: var(--primary-s);
    color: var(--primary); font-weight: 700; margin-right: 6px;
}
.tag.pin { background: #fff1e6; color: #d1710b; }
.tag.board { background: #eef7ef; color: #2f855a; }
.tag.admin { background: #fdecec; color: var(--danger); }
.tag.super { background: #4a6cf7; color: #fff; }

.media { width: 100%; border-radius: 12px; margin-top: 8px; background: #000; max-height: 420px; object-fit: contain; }
.img-wrap { display: block; }
.media-thumb { max-height: 180px; width: auto; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.media-grid .media { height: 100px; object-fit: cover; margin: 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; font-size: 13.5px; }

/* ---------- 评论区 ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.comment-meta b { color: var(--text); font-size: 14px; }
.comment-text { margin: 4px 0 0; word-break: break-word; white-space: pre-wrap; }

/* ---------- 聊天 ---------- */
.chat-wrap { display: flex; height: calc(100vh - 54px - var(--nav-h) - 24px); flex-direction: column; }
@media (min-width: 861px) { .chat-wrap { height: calc(100vh - 54px - 24px); } }
.chat-head {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.chat-main {
    flex: 1; overflow-y: auto; padding: 12px; background: #f7f8fc;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 10px;
}
/* 仿微信横条气泡：头像顶部对齐，气泡宽度随内容伸缩，绝不一字一行 */
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg.mine { flex-direction: row-reverse; }
.msg .avatar { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 6px; }
.msg-body {
    display: flex; flex-direction: column; align-items: flex-start;
    min-width: 0; max-width: min(76%, 480px);
}
.msg.mine .msg-body { align-items: flex-end; }
.msg-body .who {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    font-size: 11.5px; color: var(--muted); margin: 0 2px 3px;
}
.bubble {
    position: relative;
    display: inline-block;
    min-width: 2.4em;
    max-width: 100%;
    padding: 8px 12px 6px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(26, 34, 66, .06);
    font-size: 15px; line-height: 1.62;
    text-align: left;
    /* 只在必要时断词，绝不逐字换行 */
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}
/* 气泡尖角 */
.bubble::before {
    content: ''; position: absolute; top: 12px; left: -5px;
    width: 0; height: 0; border: 5px solid transparent;
    border-right-color: #fff; border-left: 0;
}
.bubble::after {
    content: ''; position: absolute; top: 12px; left: -6px;
    width: 0; height: 0; border: 5px solid transparent;
    border-right-color: var(--line); border-left: 0; z-index: -1;
}
.bubble .btext { display: block; white-space: normal; }
.bubble .btext a { word-break: break-all; }
.msg.mine .bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg.mine .bubble::before { left: auto; right: -5px; border-right-color: transparent; border-left-color: var(--primary); border-right: 0; border-left-width: 5px; }
.msg.mine .bubble::after  { left: auto; right: -6px; border-right-color: transparent; border-left-color: var(--primary); border-right: 0; border-left-width: 5px; }
.msg.mine .bubble a { color: #fff; text-decoration: underline; }
.bubble .sys { font-style: normal; opacity: .8; }
.bubble .media { margin-top: 6px; max-width: 240px; border-radius: 10px; }
.bubble .file-chip { margin-top: 6px; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: inherit; }
.bubble .time {
    display: block; font-size: 10.5px; opacity: .6; margin-top: 2px; text-align: right; line-height: 1.4;
}
.msg-sys {
    align-self: center; text-align: center; font-size: 12px; color: var(--muted);
    margin: 4px 0; padding: 2px 10px; background: rgba(0, 0, 0, .04); border-radius: 20px;
}
.msg-report { align-self: flex-end; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-report { opacity: 1; }
@media (hover: none) { .msg-report { opacity: .4; } }
.msg-day { text-align: center; font-size: 11.5px; color: var(--muted); margin: 10px 0 4px; }

.composer {
    display: flex; align-items: flex-end; gap: 8px; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
.composer textarea {
    flex: 1; min-height: 42px; max-height: 140px; resize: none; border: 0; outline: none;
    background: transparent; padding: 10px 4px; line-height: 1.5;
}
.composer .tools { display: flex; gap: 2px; }
.composer .attach { position: relative; overflow: hidden; }
.composer .attach input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--primary-s);
    color: var(--primary); font-size: 13px; border-top: 1px solid var(--line);
}

.room {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 10px; box-shadow: var(--shadow);
}
.room .ri { flex: 1; min-width: 0; }
.room .ri b { display: block; font-size: 15px; }
.room .ri .last { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room .rmeta { text-align: right; font-size: 12px; color: var(--muted); }
.unread-dot {
    background: var(--danger); color: #fff; font-size: 11px; border-radius: 20px;
    min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 0; }

/* ---------- 表格后台 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.tbl th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
table.tbl tr:hover td { background: #fafbfe; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12.5px; color: var(--muted); }

.admin-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.admin-nav a { flex: 0 0 auto; padding: 6px 12px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; }
.admin-nav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 提示 ---------- */
.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 14px; border: 1px solid transparent; }
.alert-ok { background: #eafaf1; color: #12724a; border-color: #c6eddb; }
.alert-danger { background: var(--danger-s); color: #a3262a; border-color: #f8c9ca; }

.toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px); z-index: 90;
    background: rgba(24, 27, 41, .93); color: #fff; padding: 10px 16px; border-radius: 22px; font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22); max-width: 80vw; text-align: center;
}
@media (min-width: 861px) { .toast { bottom: 24px; } }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .emoji, .empty .ic-lg { font-size: 42px; display: block; margin: 0 auto 8px; }
.empty .ic-lg { width: 42px; height: 42px; opacity: .55; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(17, 20, 33, .45); }
.modal-card {
    position: relative; width: 100%; max-width: 520px; background: #fff;
    border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    animation: up .18s ease;
}
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.reason-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
@media (max-width: 420px) { .reason-list { grid-template-columns: 1fr; } }
.reason { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.reason:has(input:checked) { border-color: var(--primary); background: var(--primary-s); color: var(--primary); }

/* ---------- 安装页 ---------- */
.install-body { padding-bottom: 40px; }
.install-wrap { max-width: 620px; margin: 0 auto; padding: 20px 14px 40px; }
.install-head { text-align: center; margin-bottom: 18px; }
.install-head h1 { font-size: 22px; margin-bottom: 4px; }

/* ---------- 会员/用户卡 ---------- */
.user-card {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head .info { flex: 1; min-width: 0; }
.profile-stats { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.profile-stats div { font-size: 13px; color: var(--muted); }
.profile-stats b { color: var(--text); font-size: 16px; margin-right: 4px; }

/* ---------- 等级 / 经验 ---------- */
.lv {
    display: inline-block; padding: 1px 7px; border-radius: 6px;
    font-size: 11px; font-weight: 700; line-height: 1.6; vertical-align: middle; white-space: nowrap;
}
.lv-lv1 { background: #e8eefc; color: #2b5bd7; }
.lv-lv3 { background: #f2e8fd; color: #7b2fbe; }
.lv-lv5 { background: #fff0d6; color: #b26a00; }

.lv-card { display: flex; align-items: center; gap: 10px; }
.lv-card .lv-big { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }
.lv-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.lv-bar > i {
    display: block; height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #5b8def, #7b5bef);
}

/* ---------- 成长任务 ---------- */
.task-list { margin-top: 6px; }
.task-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}
.task-item:last-child { border-bottom: 0; }
.task-item .ti-main { flex: 1; min-width: 0; }
.task-item .ti-title { font-size: 14px; font-weight: 600; }
.task-item .ti-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-item .ti-reward { font-size: 12px; font-weight: 700; color: var(--warn); white-space: nowrap; }
.task-item.done .ti-title { color: var(--muted); text-decoration: line-through; }

/* ---------- 消息提醒开关 ---------- */
.switch-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}
.switch-row:last-of-type { border-bottom: 0; }
.sr-main { flex: 1; min-width: 0; }
.sr-title { font-size: 14px; font-weight: 600; }
.sr-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; background: #d3d8e4; border-radius: 99px; transition: background .2s; }
.switch i::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s;
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }
.bell.off { opacity: .4; }
[data-notify-perm].ok { color: var(--ok); }
[data-notify-perm].warn { color: var(--warn); }

/* ---------- v3：等级徽章（Lv1 ~ Lv30 分段配色） ---------- */
.lv-t1 { background: #e8eefc; color: #2b5bd7; }
.lv-t2 { background: #e9e6fd; color: #5b3fd0; }
.lv-t3 { background: #f2e8fd; color: #7b2fbe; }
.lv-t4 { background: #ffe9f0; color: #b3245b; }
.lv-t5 { background: #fff0d6; color: #b26a00; }
.lv-t6 { background: #e0f0ff; color: #0b6bcb; }
.lv-t7 { background: linear-gradient(135deg, #f3e8ff, #ffe8f0); color: #8a2be2; }

/* ---------- v3：佩戴的称号 ---------- */
.utitle {
    display: inline-block; vertical-align: middle; white-space: nowrap;
    padding: 0 7px; margin: 0 2px; border-radius: 5px;
    font-size: 11px; font-weight: 700; line-height: 1.7;
    border: 1px solid rgba(0, 0, 0, .06);
}

/* ---------- v3：顶栏通知铃铛 ---------- */
.notice-bell { position: relative; }
.notice-bell .dot {
    position: absolute; top: -2px; right: -4px;
    background: var(--danger); color: #fff; font-size: 10px; font-style: normal;
    border-radius: 10px; padding: 0 4px; min-width: 15px; text-align: center;
    line-height: 15px; font-weight: 700; border: 1.5px solid #fff;
}

/* ---------- v3：排行榜 ---------- */
.rank-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-no {
    flex: 0 0 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: #eef0f5; color: var(--muted); font-size: 13px; font-weight: 800;
}
.rank-no-1 { background: linear-gradient(135deg, #ffd76e, #f5a524); color: #7a4300; }
.rank-no-2 { background: linear-gradient(135deg, #e6ecf5, #b9c4d6); color: #3d4759; }
.rank-no-3 { background: linear-gradient(135deg, #f3c9a0, #d9915a); color: #6b3410; }
.rank-score { text-align: right; white-space: nowrap; }
.rank-score b { font-size: 17px; color: var(--primary); margin-right: 3px; }

/* ---------- v3：系统通知栏 ---------- */
.notice-item {
    display: block; padding: 10px 12px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe;
}
.notice-item.unread { background: #eef2ff; border-color: #cdd8ff; }
.notice-item.unread .ni-head b::after {
    content: 'NEW'; margin-left: 6px; font-size: 10px; background: var(--danger);
    color: #fff; border-radius: 4px; padding: 0 4px; vertical-align: middle;
}
.ni-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ni-body { margin-top: 4px; font-size: 14px; color: #39415a; word-break: break-word; }

/* ---------- v3：私聊待同意提示条 ---------- */
.pm-pending {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; background: #fff8e6; border: 1px solid #ffe1a6;
    border-left: 3px solid var(--warn); border-right: 0; border-radius: 0;
}
.pm-pending > div:first-child { flex: 1; min-width: 180px; }

/* ---------- v3：称号选择 ---------- */
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.title-pick {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
}
.title-pick input { margin-right: 6px; }
.title-pick.active { border-color: var(--primary); background: var(--primary-s); box-shadow: 0 0 0 2px rgba(74, 108, 247, .12); }

/* ---------- v3：后台通用条目 / 举报人卡片 ---------- */
.admin-item {
    padding: 12px; margin-bottom: 10px; border: 1px solid var(--line);
    border-radius: 12px; background: #fbfcfe;
}
.reporter-box {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 8px; padding: 10px; background: #f6f8fd;
    border: 1px solid var(--line); border-radius: 10px;
}

/* ---------- v3：等级曲线展示 ---------- */
.lv-table { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-cell {
    font-size: 12px; padding: 3px 8px; border-radius: 6px;
    background: var(--primary-s); color: var(--primary); font-weight: 700;
}
.ic-home { -webkit-mask-image:url(icons/ui/home.svg); mask-image:url(icons/ui/home.svg); }
.ic-chat { -webkit-mask-image:url(icons/ui/chat.svg); mask-image:url(icons/ui/chat.svg); }
.ic-plus { -webkit-mask-image:url(icons/ui/plus.svg); mask-image:url(icons/ui/plus.svg); }
.ic-user { -webkit-mask-image:url(icons/ui/user.svg); mask-image:url(icons/ui/user.svg); }
.ic-shield { -webkit-mask-image:url(icons/ui/shield.svg); mask-image:url(icons/ui/shield.svg); }
.ic-search { -webkit-mask-image:url(icons/ui/search.svg); mask-image:url(icons/ui/search.svg); }
.ic-send { -webkit-mask-image:url(icons/ui/send.svg); mask-image:url(icons/ui/send.svg); }
.ic-image { -webkit-mask-image:url(icons/ui/image.svg); mask-image:url(icons/ui/image.svg); }
.ic-video { -webkit-mask-image:url(icons/ui/video.svg); mask-image:url(icons/ui/video.svg); }
.ic-flag { -webkit-mask-image:url(icons/ui/flag.svg); mask-image:url(icons/ui/flag.svg); }
.ic-heart { -webkit-mask-image:url(icons/ui/heart.svg); mask-image:url(icons/ui/heart.svg); }
.ic-reply { -webkit-mask-image:url(icons/ui/reply.svg); mask-image:url(icons/ui/reply.svg); }
.ic-more { -webkit-mask-image:url(icons/ui/more.svg); mask-image:url(icons/ui/more.svg); }
.ic-back { -webkit-mask-image:url(icons/ui/back.svg); mask-image:url(icons/ui/back.svg); }
.ic-check { -webkit-mask-image:url(icons/ui/check.svg); mask-image:url(icons/ui/check.svg); }
.ic-ban { -webkit-mask-image:url(icons/ui/ban.svg); mask-image:url(icons/ui/ban.svg); }
.ic-trash { -webkit-mask-image:url(icons/ui/trash.svg); mask-image:url(icons/ui/trash.svg); }
.ic-users { -webkit-mask-image:url(icons/ui/users.svg); mask-image:url(icons/ui/users.svg); }
.ic-doc { -webkit-mask-image:url(icons/ui/doc.svg); mask-image:url(icons/ui/doc.svg); }
.ic-pin { -webkit-mask-image:url(icons/ui/pin.svg); mask-image:url(icons/ui/pin.svg); }
.ic-gear { -webkit-mask-image:url(icons/ui/gear.svg); mask-image:url(icons/ui/gear.svg); }
.ic-group { -webkit-mask-image:url(icons/ui/group.svg); mask-image:url(icons/ui/group.svg); }
.ic-logout { -webkit-mask-image:url(icons/ui/logout.svg); mask-image:url(icons/ui/logout.svg); }
.ic-close { -webkit-mask-image:url(icons/ui/close.svg); mask-image:url(icons/ui/close.svg); }
.ic-bell { -webkit-mask-image:url(icons/ui/bell.svg); mask-image:url(icons/ui/bell.svg); }
.ic-gradcap { -webkit-mask-image:url(icons/ui/gradcap.svg); mask-image:url(icons/ui/gradcap.svg); }
.ic-sparkle { -webkit-mask-image:url(icons/ui/sparkle.svg); mask-image:url(icons/ui/sparkle.svg); }
.ic-book { -webkit-mask-image:url(icons/ui/book.svg); mask-image:url(icons/ui/book.svg); }
.ic-shop { -webkit-mask-image:url(icons/ui/shop.svg); mask-image:url(icons/ui/shop.svg); }
.ic-magnifier { -webkit-mask-image:url(icons/ui/magnifier.svg); mask-image:url(icons/ui/magnifier.svg); }
.ic-mail { -webkit-mask-image:url(icons/ui/mail.svg); mask-image:url(icons/ui/mail.svg); }
.ic-maple { -webkit-mask-image:url(icons/ui/maple.svg); mask-image:url(icons/ui/maple.svg); }
.ic-sprout { -webkit-mask-image:url(icons/ui/sprout.svg); mask-image:url(icons/ui/sprout.svg); }
.ic-star { -webkit-mask-image:url(icons/ui/star.svg); mask-image:url(icons/ui/star.svg); }
.ic-crown { -webkit-mask-image:url(icons/ui/crown.svg); mask-image:url(icons/ui/crown.svg); }
.ic-shield-check { -webkit-mask-image:url(icons/ui/shield-check.svg); mask-image:url(icons/ui/shield-check.svg); }
.ic-fire { -webkit-mask-image:url(icons/ui/fire.svg); mask-image:url(icons/ui/fire.svg); }
.ic-trophy { -webkit-mask-image:url(icons/ui/trophy.svg); mask-image:url(icons/ui/trophy.svg); }
.ic-megaphone { -webkit-mask-image:url(icons/ui/megaphone.svg); mask-image:url(icons/ui/megaphone.svg); }
.ic-bell-off { -webkit-mask-image:url(icons/ui/bell-off.svg); mask-image:url(icons/ui/bell-off.svg); }
.ic-mail-empty { -webkit-mask-image:url(icons/ui/mail-empty.svg); mask-image:url(icons/ui/mail-empty.svg); }
.ic-wave { -webkit-mask-image:url(icons/ui/wave.svg); mask-image:url(icons/ui/wave.svg); }
.ic-note { -webkit-mask-image:url(icons/ui/note.svg); mask-image:url(icons/ui/note.svg); }
.ic-eye { -webkit-mask-image:url(icons/ui/eye.svg); mask-image:url(icons/ui/eye.svg); }
.ic-eye-off { -webkit-mask-image:url(icons/ui/eye-off.svg); mask-image:url(icons/ui/eye-off.svg); }
.ic-check-circle { -webkit-mask-image:url(icons/ui/check-circle.svg); mask-image:url(icons/ui/check-circle.svg); }
.ic-gift { -webkit-mask-image:url(icons/ui/gift.svg); mask-image:url(icons/ui/gift.svg); }
.ic-handshake { -webkit-mask-image:url(icons/ui/handshake.svg); mask-image:url(icons/ui/handshake.svg); }
.ic-medal { -webkit-mask-image:url(icons/ui/medal.svg); mask-image:url(icons/ui/medal.svg); }
.ic-lock { -webkit-mask-image:url(icons/ui/lock.svg); mask-image:url(icons/ui/lock.svg); }
.ic-upload { -webkit-mask-image:url(icons/ui/upload.svg); mask-image:url(icons/ui/upload.svg); }
.ic-desktop { -webkit-mask-image:url(icons/ui/desktop.svg); mask-image:url(icons/ui/desktop.svg); }
.ic-phone { -webkit-mask-image:url(icons/ui/phone.svg); mask-image:url(icons/ui/phone.svg); }
.ic-party { -webkit-mask-image:url(icons/ui/party.svg); mask-image:url(icons/ui/party.svg); }
.ic-paperclip { -webkit-mask-image:url(icons/ui/paperclip.svg); mask-image:url(icons/ui/paperclip.svg); }
.ic-devil { -webkit-mask-image:url(icons/ui/devil.svg); mask-image:url(icons/ui/devil.svg); }
.ic-construction { -webkit-mask-image:url(icons/ui/construction.svg); mask-image:url(icons/ui/construction.svg); }
.ic-wrench { -webkit-mask-image:url(icons/ui/wrench.svg); mask-image:url(icons/ui/wrench.svg); }
.ic-clock { -webkit-mask-image:url(icons/ui/clock.svg); mask-image:url(icons/ui/clock.svg); }
.ic-calendar { -webkit-mask-image:url(icons/ui/calendar.svg); mask-image:url(icons/ui/calendar.svg); }
.ic-spark { -webkit-mask-image:url(icons/ui/spark.svg); mask-image:url(icons/ui/spark.svg); }
.ic-crown-small { -webkit-mask-image:url(icons/ui/crown-small.svg); mask-image:url(icons/ui/crown-small.svg); }
.ic-shield-star { -webkit-mask-image:url(icons/ui/shield-star.svg); mask-image:url(icons/ui/shield-star.svg); }

/* ---------- 后台图标选择器 ---------- */
.icon-picker { display: flex; align-items: center; gap: 10px; }
.icon-picker-preview {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px;
    background: var(--primary-s); color: var(--primary);
}
.icon-picker-preview .ic { width: 24px; height: 24px; }
.icon-picker select.input { flex: 1; min-width: 0; }
