/* ============================================================
   文件：assets/css/app.css
   说明：说吧前台样式。原生 CSS3，无框架、无 CDN。
   设计基调：暖灰底 + 白卡片 + 橙红主色，信息密度高但留白清楚。
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
    --primary: #E85A2A;
    --primary-hover: #D04A1E;
    --primary-soft: #FFF0E8;
    --primary-line: #FFD9C6;
    --blue: #2A6FE8;
    --blue-soft: #EDF3FE;
    --gold: #F6A64B;
    --bg: #F5F3F0;
    --card: #FFFFFF;
    --text: #1A1A1A;
    --text-2: #444444;
    --text-3: #8A8A8A;
    --text-4: #C0C0C0;
    --border: #EBE8E3;
    --border-strong: #DDD8D0;
    --ok: #3BB273;
    --danger: #E5484D;
    --warn: #F5A623;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .05);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, .08);
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-2);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
small { font-size: 12px; }

:focus-visible {
    outline: 2px solid rgba(232, 90, 42, .45);
    outline-offset: 2px;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.text-muted { color: var(--text-3); }
.dot { color: var(--text-4); }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 36px; padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--radius);
    background: #fff; color: var(--text-2);
    font-size: 14px; line-height: 1; cursor: pointer;
    white-space: nowrap; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-hover); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #FFE4D6; color: var(--primary-hover); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--radius);
    color: var(--text-2); border: none; background: none; cursor: pointer;
}
.icon-btn:hover { background: #F3F0EC; color: var(--primary); }
.badge-dot {
    position: absolute; top: -2px; right: -3px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------- 表单 ---------- */
.input {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: #fff; color: var(--text); font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 90, 42, .12);
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.7; resize: vertical; }
select.input { padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field-label { font-size: 13px; color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.field-label small { color: var(--text-3); font-weight: 400; }
.field-counter { align-self: flex-end; font-size: 11px; color: var(--text-4); margin-top: -2px; }
.field-error { color: var(--danger); font-size: 13px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-tip { font-size: 12px; color: var(--text-3); }
.form-head { margin-bottom: 20px; }
.form-head h1 { font-size: 20px; margin-bottom: 4px; }
.form-head p { color: var(--text-3); font-size: 13px; }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-item { position: relative; cursor: pointer; }
.color-item input { position: absolute; opacity: 0; pointer-events: none; }
.color-dot {
    display: block; width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border);
    transition: transform .15s, box-shadow .15s;
}
.color-item input:checked + .color-dot { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.05); }
.color-item:hover .color-dot { transform: scale(1.05); }

/* ---------- 提示 / 标签 ---------- */
.flash {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding: 11px 14px;
    border-radius: var(--radius); font-size: 13.5px;
    border: 1px solid transparent;
    animation: flash-in .2s ease-out;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flash-success { background: #F1FBF5; border-color: #CFEEDD; color: #227A4E; }
.flash-error { background: #FEF5F5; border-color: #F8D7D8; color: #A3272B; }
.flash-info { background: #F7F5FF; border-color: #E4DEFA; color: #55439E; }
.flash-text { flex: 1; }
.flash-icon { display: inline-flex; }
.flash-close { background: none; border: none; color: inherit; opacity: .6; cursor: pointer; padding: 2px; }
.flash-close:hover { opacity: 1; }

.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #FEF5F5; border: 1px solid #F8D7D8; color: #A3272B; }

.badge {
    display: inline-flex; align-items: center; gap: 3px;
    height: 18px; padding: 0 6px; border-radius: 3px;
    font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge-pin { background: var(--primary); color: #fff; }
.badge-feature { background: linear-gradient(135deg, #FFD98A, #F6A64B); color: #7A4A00; }
.badge-lock { background: #F2F0EC; color: var(--text-3); }
.expired-tag {
    font-size: 11px; color: var(--text-3); background: #F2F0EC;
    border-radius: 3px; padding: 0 5px; white-space: nowrap;
}

/* ---------- 头像 / 等级 / 会员 ---------- */
.avatar {
    position: relative; display: inline-flex; flex: none;
    width: var(--av-size, 40px); height: var(--av-size, 40px);
}
.avatar-body {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    background: var(--av-color, #E85A2A); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: calc(var(--av-size, 40px) * .42);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.avatar-body img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-frame { position: absolute; inset: 0; pointer-events: none; }
.avatar-frame svg { width: 100%; height: 100%; display: block; }
.avatar-link { display: inline-flex; flex: none; }

.lvl {
    display: inline-flex; align-items: center;
    height: 18px; padding: 0 6px; border-radius: 4px;
    font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.lvl-none { background: #F2F0EC; color: var(--text-3); }
.lvl-vip { background: #E8F1FD; color: #2A6FE8; }
.lvl-svip { background: #FFF6DA; color: #9A7400; }
.lvl-svip_plus { background: linear-gradient(135deg, #EFEBFF, #FFF6DA); color: #6B4FCF; }

.mchip {
    display: inline-flex; align-items: center;
    height: 18px; padding: 0 7px; border-radius: 4px;
    font-size: 10.5px; font-weight: 700; color: #fff; letter-spacing: .3px;
    line-height: 1; white-space: nowrap;
}
.mchip-vip { background: linear-gradient(135deg, #4A90E2, #357ABD); }
.mchip-svip { background: linear-gradient(135deg, #F5C518, #E0A800); color: #4A3600; }
.mchip-svip_plus { background: linear-gradient(135deg, #7C6EF6, #F5C518); }

.user-title { font-size: 12px; font-weight: 500; }
.member-plate { display: inline-flex; align-items: center; flex: none; }
.member-plate svg { height: 18px; width: auto; display: block; }

.identity { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.identity-name { font-weight: 600; color: var(--text); }
.identity-compact { gap: 4px; }

.progress {
    height: 6px; border-radius: 999px; background: #F2EFEA; overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FF8A57, var(--primary)); }

/* ---------- 头部 ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; gap: 18px; height: 60px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #FF7A45, #E85A2A);
    color: #fff; font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 8px rgba(232, 90, 42, .25);
}
.brand-logo-sm { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
.brand-words { display: flex; flex-direction: column; line-height: 1.25; }
.brand-words strong { font-size: 16px; color: var(--text); letter-spacing: .5px; }
.brand-words small { font-size: 11px; color: var(--text-3); }

.header-search {
    position: relative; flex: 0 1 300px; margin-left: 8px;
}
.header-search input {
    width: 100%; height: 34px; padding: 0 12px 0 34px;
    border: 1px solid var(--border); border-radius: 999px;
    background: #F8F6F3; color: var(--text); font-size: 13px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.header-search input:focus {
    outline: none; background: #fff; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 90, 42, .1);
}
.header-search .search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); display: inline-flex; pointer-events: none;
}

.header-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
    padding: 6px 10px; border-radius: var(--radius);
    color: var(--text-2); font-size: 13.5px; white-space: nowrap;
}
.nav-link:hover { background: #F3F0EC; color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

.header-user { display: flex; align-items: center; gap: 4px; }

.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 6px;
    height: 36px; padding: 2px 8px 2px 2px;
    border: none; border-radius: 999px; background: none; cursor: pointer;
    color: var(--text-2);
}
.user-menu-btn:hover { background: #F3F0EC; }
.user-menu-name { font-size: 13px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
    width: 220px; padding: 6px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
}
.dropdown[hidden] { display: none; }
.dropdown-user { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-name { font-weight: 600; color: var(--text); font-size: 13.5px; }
.dropdown-sub { display: flex; gap: 5px; align-items: center; font-size: 11px; color: var(--text-3); }
.dropdown a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 5px; color: var(--text-2); font-size: 13px;
}
.dropdown a:hover { background: #F7F4F0; color: var(--text); text-decoration: none; }
.dropdown a.dropdown-danger { color: var(--danger); }
.dropdown a.dropdown-danger:hover { background: #FEF5F5; }

.mobile-toggle { display: none; background: none; border: none; color: var(--text-2); cursor: pointer; padding: 6px; }
.mobile-nav { display: none; border-top: 1px solid var(--border); padding: 12px 20px 16px; background: #fff; }
.mobile-nav[hidden] { display: none; }
.mobile-search { display: flex; gap: 8px; margin-bottom: 10px; }
.mobile-search input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #F8F6F3; }
.mobile-search button { width: 38px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-2); }
.mobile-links { display: flex; flex-wrap: wrap; gap: 6px; }
.mobile-links a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-2); }

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page { padding: 16px 20px 44px; }

.layout-3col {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 280px;
    gap: 10px;
    align-items: start;
}
.col-left { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; }
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.col-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

/* ---------- 侧栏 ---------- */
.side-card { padding: 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.side-head h2 { font-size: 14px; }
.side-sub { font-size: 11px; color: var(--text-3); }
.side-link { font-size: 12px; color: var(--text-3); }
.side-link:hover { color: var(--primary); }

.board-nav { padding: 14px; }
.board-list { display: flex; flex-direction: column; gap: 2px; }
.board-link {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px; border-radius: 5px;
    color: var(--text-2); font-size: 13.5px;
}
.board-link:hover { background: #F7F4F0; color: var(--text); text-decoration: none; }
.board-link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.board-ico {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--board-color, var(--primary));
    background: color-mix(in srgb, var(--board-color, var(--primary)) 12%, #fff);
}
.board-ico-all { color: var(--text-3); background: #F2F0EC; }
.board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-count { font-size: 11px; color: var(--text-4); }
.board-post-btn { margin-top: 12px; }

.side-note { background: linear-gradient(160deg, #FFF8F3, #FFFFFF); }
.side-note p { font-size: 12.5px; color: var(--text-3); }
.side-note-slogan { margin: 6px 0; font-size: 14px; color: var(--primary); font-weight: 600; }
.side-note-text { line-height: 1.7; }

/* ---------- 首页 ---------- */
.feed-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 22px 26px;
    background: linear-gradient(120deg, #FFF6F0 0%, #FFFFFF 62%);
    border-color: #F5E6DB;
}
.feed-hero h1 { font-size: 22px; letter-spacing: .5px; margin-bottom: 5px; }
.feed-hero p { font-size: 13px; color: var(--text-3); }
.feed-hero-stats { display: flex; gap: 26px; flex: none; }
.feed-hero-stats div { text-align: center; }
.feed-hero-stats strong { display: block; font-size: 20px; color: var(--primary); line-height: 1.2; }
.feed-hero-stats span { font-size: 11.5px; color: var(--text-3); }

.feed-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sort-tabs { display: inline-flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; box-shadow: var(--shadow); flex-wrap: wrap; }
.sort-tab {
    padding: 5px 12px; border-radius: 4px; border: none; background: none;
    font-size: 13px; color: var(--text-3); cursor: pointer; white-space: nowrap;
}
.sort-tab:hover { color: var(--text); text-decoration: none; background: #F7F4F0; }
.sort-tab.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

.thread-feed { padding: 6px 0 0; overflow: hidden; }
.thread-list { display: flex; flex-direction: column; }
.thread-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: #FAF9F7; }
.thread-item.is-pinned { background: #FFFCFA; box-shadow: inset 3px 0 0 var(--primary); }
.thread-avatar { padding-top: 2px; }
.thread-main { flex: 1; min-width: 0; }
.thread-title {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    font-size: 15px; font-weight: 600; line-height: 1.5; margin-bottom: 4px;
}
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--primary); }
.thread-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.thread-meta .meta-link { color: var(--text-3); }
.thread-meta .meta-link:hover { color: var(--primary); }
.thread-meta .meta-board { color: var(--board-color, var(--text-3)); font-weight: 500; }
.thread-meta .meta-board:hover { text-decoration: underline; }
.thread-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; padding-top: 2px; }
.thread-time { font-size: 11.5px; color: var(--text-4); }

/* ---------- 板块页 ---------- */
.board-head {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(120deg, color-mix(in srgb, var(--board-color, #E85A2A) 7%, #fff), #fff 70%);
}
.board-head-icon {
    width: 48px; height: 48px; border-radius: 12px; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--board-color, var(--primary));
    background: color-mix(in srgb, var(--board-color, #E85A2A) 13%, #fff);
}
.board-head-text { flex: 1; min-width: 0; }
.board-head h1 { font-size: 20px; margin-bottom: 2px; }
.board-head p { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.board-head-meta { display: flex; gap: 6px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }

/* ---------- 帖子详情 ---------- */
.thread-page { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); padding: 0 2px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }
.crumb-sep { color: var(--text-4); }
.crumb-current { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

.thread-head { padding: 20px 24px; }
.thread-head-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 21px; line-height: 1.45; margin-bottom: 10px;
}
.thread-head-title > span:last-child { color: var(--text); }
.thread-head-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.thread-head-author { color: var(--text-2); font-weight: 500; }
.thread-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.floor-list { display: flex; flex-direction: column; gap: 10px; }
.floor { padding: 18px 22px; }
.floor-op { border-left: 3px solid var(--primary); }
.floor-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.floor-author { flex: 1; min-width: 0; }
.floor-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.floor-author-link { color: var(--text); font-weight: 600; }
.floor-author-link:hover { color: var(--primary); }
.floor-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.floor-right { display: flex; align-items: center; gap: 8px; flex: none; }
.floor-no { font-size: 12px; color: var(--text-4); font-family: var(--mono); }
.op-badge { font-size: 10.5px; color: #fff; background: var(--primary); border-radius: 3px; padding: 1px 5px; }

.post-body {
    font-size: 15px; line-height: 1.78; color: var(--text-2);
    word-break: break-word; overflow-wrap: anywhere;
}
.post-body[style] { padding: 12px 15px; }

.quote {
    margin: 0 0 12px; padding: 9px 12px;
    background: #FAF9F7; border-left: 3px solid var(--border-strong); border-radius: 4px;
    font-size: 13px;
}
.quote-ref { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 12px; margin-bottom: 3px; }
.quote-text { color: var(--text-3); line-height: 1.65; }

.post-signature {
    margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border);
    font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px;
}
.sig-label {
    flex: none; height: 17px; padding: 0 5px; border-radius: 3px;
    background: #F2F0EC; color: var(--text-3); font-size: 10.5px; line-height: 17px;
}
.sig-text { white-space: pre-wrap; }

.post-comments {
    margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
    display: flex; flex-direction: column; gap: 5px;
}
.comment-item { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.comment-user { color: var(--blue); font-weight: 600; }
.comment-text { flex: 1; min-width: 200px; }
.comment-time { font-size: 11px; color: var(--text-4); }
.comment-toggle {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 2px 0; color: var(--text-3);
    font-size: 12px; cursor: pointer;
}
.comment-toggle:hover { color: var(--primary); }
.comment-form { display: flex; gap: 8px; margin-top: 4px; }
.comment-form input {
    flex: 1; height: 32px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 5px; background: #FAF9F7;
}
.comment-form input:focus { outline: none; border-color: var(--primary); background: #fff; }

.floor-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 3px 0;
    font-size: 12.5px; color: var(--text-3); cursor: pointer; text-decoration: none;
    transition: color .15s;
}
.action-btn:hover { color: var(--primary); text-decoration: none; }
.action-btn.is-active { color: var(--primary); }
.action-hint { margin-left: auto; font-size: 11.5px; color: var(--text-4); }

.reply-section { padding: 20px 22px; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.reply-head h2 { font-size: 16px; }
.lock-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.reply-tip { font-size: 13px; color: var(--text-3); }
.reply-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.reply-login p { margin-right: 6px; }
.reply-form { display: flex; flex-direction: column; gap: 10px; }
.reply-form textarea {
    width: 100%; min-height: 110px; padding: 12px 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: #FCFBF9; color: var(--text); line-height: 1.7; resize: vertical;
}
.reply-form textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(232, 90, 42, .1); }
.reply-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reply-hint { font-size: 12px; color: var(--text-3); }

.quote-preview { margin-bottom: 10px; padding: 10px 12px; background: #FAF9F7; border: 1px solid var(--border); border-radius: 5px; }
.quote-preview-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--primary); font-weight: 500; }
.quote-remove { background: none; border: none; color: var(--text-3); cursor: pointer; display: inline-flex; padding: 2px; }
.quote-remove:hover { color: var(--danger); }
.quote-preview p { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }

.related-section { padding: 18px 22px; }
.related-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.related-list li:last-child { border-bottom: none; }
.related-list a { color: var(--text-2); }
.related-list a:hover { color: var(--primary); }
.related-list span { font-size: 11.5px; color: var(--text-4); flex: none; }

/* ---------- 右栏组件 ---------- */
.user-card { padding: 18px; }
.uc-top { display: flex; gap: 11px; align-items: center; }
.uc-id { min-width: 0; }
.uc-name { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.uc-name a { color: var(--text); }
.uc-name a:hover { color: var(--primary); }
.uc-badges { display: flex; gap: 5px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.uc-bio { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.uc-growth { margin-top: 12px; padding: 10px 12px; background: #FAF9F7; border-radius: 5px; }
.uc-growth-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.uc-growth-row strong { font-size: 16px; color: var(--primary); }
.uc-growth-next { margin-top: 5px; font-size: 11px; color: var(--text-4); }
.uc-stats { display: flex; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.uc-stats a { flex: 1; text-align: center; color: var(--text-3); }
.uc-stats a:hover { color: var(--primary); text-decoration: none; }
.uc-stats strong { display: block; font-size: 15px; color: var(--text); line-height: 1.3; }
.uc-stats span { font-size: 11px; }
.uc-actions { display: flex; gap: 8px; margin-top: 12px; }
.uc-actions .btn { flex: 1; }
.uc-guest { text-align: center; padding: 8px 4px; }
.uc-guest-icon {
    width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft); color: var(--primary);
}
.uc-guest h2 { font-size: 15px; margin-bottom: 4px; }
.uc-guest p { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.uc-guest .uc-actions { margin-top: 0; }

.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-item { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--border); }
.task-item:last-child { border-bottom: none; }
.task-check {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: #F2F0EC; color: #fff; font-size: 10px;
}
.task-item.is-done .task-check { background: var(--ok); }
.task-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.task-name { font-size: 12.5px; color: var(--text-2); }
.task-item.is-done .task-name { color: var(--text-3); text-decoration: line-through; }
.task-desc { font-size: 11px; color: var(--text-4); }
.task-btn {
    flex: none; height: 24px; padding: 0 9px; border-radius: 999px;
    border: 1px solid var(--primary); background: #fff; color: var(--primary);
    font-size: 11.5px; cursor: pointer; transition: all .15s;
}
.task-btn:hover { background: var(--primary); color: #fff; }
.task-btn:disabled { opacity: .5; cursor: default; }
.task-status { flex: none; font-size: 11.5px; color: var(--ok); font-weight: 600; }
.task-status-pending { color: var(--text-4); font-weight: 400; }

.hot-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; font-size: 13px; }
.hot-rank {
    width: 17px; height: 17px; border-radius: 4px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: #F2F0EC; color: var(--text-3); font-size: 11px; font-weight: 600;
}
.hot-rank.is-top { background: var(--primary-soft); color: var(--primary); }
.hot-title { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-title:hover { color: var(--primary); }
.hot-meta { font-size: 11px; color: var(--text-4); flex: none; }

.new-user-list li { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.new-user-info { min-width: 0; }
.new-user-name { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); }
.new-user-name a { color: var(--text-2); }
.new-user-name a:hover { color: var(--primary); }
.new-user-meta { font-size: 11px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-stats ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.site-stats li {
    background: #FAF9F7; border-radius: 5px; padding: 8px; text-align: center;
}
.site-stats strong { display: block; font-size: 16px; color: var(--text); line-height: 1.3; }
.site-stats span { font-size: 11px; color: var(--text-3); }
.stats-note { margin-top: 8px; font-size: 11px; color: var(--text-4); text-align: center; }

/* ---------- 登录 / 注册 ---------- */
.auth-page { display: flex; justify-content: center; padding: 24px 0 40px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-logo {
    display: inline-flex; width: 46px; height: 46px; border-radius: 12px; margin-bottom: 10px;
    background: linear-gradient(135deg, #FF7A45, #E85A2A);
    color: #fff; font-size: 23px; font-weight: 700;
    align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(232, 90, 42, .25);
}
.auth-head h1 { font-size: 20px; margin-bottom: 4px; }
.auth-head p { font-size: 13px; color: var(--text-3); }
.auth-alt { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 14px; }
.auth-hint { text-align: center; font-size: 11.5px; color: var(--text-4); margin-top: 8px; }
.auth-card .stack-form { margin-top: 4px; }

/* ---------- 用户主页 ---------- */
.profile-page { display: flex; flex-direction: column; gap: 10px; }
.profile-head { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; }
.profile-main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.profile-id { min-width: 0; }
.profile-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.profile-name h1 { font-size: 21px; }
.profile-bio { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.profile-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-actions { display: flex; gap: 8px; flex: none; align-items: center; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 10px; align-items: start; }
.profile-body { padding: 16px 0 0; }
.profile-body > .sort-tabs { margin: 0 20px 8px; box-shadow: none; }
.user-tab-panel { padding: 4px 0 0; }
.panel-loading { padding: 28px; text-align: center; color: var(--text-4); font-size: 13px; }

.user-thread-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.user-thread-list li:last-child { border-bottom: none; }
.user-thread-main { flex: 1; min-width: 0; }
.user-thread-title { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14.5px; font-weight: 600; }
.user-thread-title a { color: var(--text); }
.user-thread-title a:hover { color: var(--primary); }
.user-thread-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.user-thread-time { font-size: 11.5px; color: var(--text-4); flex: none; }

.user-post-list li { padding: 13px 20px; border-bottom: 1px solid var(--border); }
.user-post-list li:last-child { border-bottom: none; }
.user-post-thread { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.user-post-thread a { color: var(--text-2); font-weight: 500; }
.user-post-thread a:hover { color: var(--primary); }
.user-post-content { margin: 5px 0; font-size: 14px; color: var(--text-2); line-height: 1.7; }
.user-post-meta { display: flex; gap: 5px; font-size: 11.5px; color: var(--text-4); }

.about-block { padding: 4px 20px 20px; }
.about-block h3 { font-size: 13px; color: var(--text-3); font-weight: 500; margin: 14px 0 4px; }
.about-block h3:first-child { margin-top: 4px; }
.about-block p { font-size: 14px; color: var(--text-2); }
.about-signature { color: var(--text-3) !important; font-size: 13px !important; }
.growth-list { margin-top: 6px; }
.growth-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.growth-delta { font-weight: 600; min-width: 46px; }
.growth-delta.is-plus { color: var(--ok); }
.growth-delta.is-minus { color: var(--danger); }
.growth-note { flex: 1; color: var(--text-2); }
.growth-time { color: var(--text-4); font-size: 11.5px; }

.profile-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-stat-grid li { background: #FAF9F7; border-radius: 5px; padding: 10px; text-align: center; }
.profile-stat-grid strong { display: block; font-size: 17px; color: var(--text); line-height: 1.3; }
.profile-stat-grid span { font-size: 11px; color: var(--text-3); }
.member-box { display: flex; flex-direction: column; gap: 8px; }
.member-line { font-size: 12px; color: var(--text-3); }
.member-progress { font-size: 11.5px; color: var(--text-4); }

/* ---------- 搜索 ---------- */
.search-page { display: flex; flex-direction: column; gap: 10px; }
.search-head h1 { font-size: 20px; margin-bottom: 12px; }
.search-form { position: relative; display: flex; align-items: center; gap: 8px; }
.search-form .search-icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; display: inline-flex; }
.search-form input {
    flex: 1; height: 40px; padding: 0 12px 0 36px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: #FAF9F7;
}
.search-form input:focus { outline: none; background: #fff; border-color: var(--primary); }
.search-form .btn { height: 40px; }
.search-tabs { display: flex; gap: 4px; margin-top: 14px; }
.user-result-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-result-list li:last-child { border-bottom: none; }
.user-result-info { flex: 1; min-width: 0; }
.user-result-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.user-result-info p { font-size: 12.5px; color: var(--text-3); }
.user-result-growth { font-size: 11.5px; color: var(--text-4); flex: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.section-head h2 { font-size: 15px; }
.section-sub { font-size: 12px; color: var(--text-3); }

/* ---------- 通知 ---------- */
.notify-page { display: flex; flex-direction: column; gap: 10px; }
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify-head h1 { font-size: 20px; margin-bottom: 3px; }
.notify-head p { font-size: 13px; color: var(--text-3); }
.notify-head-actions { display: flex; align-items: center; gap: 10px; }
.notify-unread { font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 999px; }
.notify-list li { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.notify-list li:last-child { border-bottom: none; }
.notify-item.is-unread { background: #FFFCFA; }
.notify-icon {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #F5F2EE; color: var(--text-3);
}
.notify-icon-reply, .notify-icon-comment { background: #EDF3FE; color: var(--blue); }
.notify-icon-vote { background: #FFF0E8; color: var(--primary); }
.notify-icon-follow { background: #F1FBF5; color: var(--ok); }
.notify-icon-activity { background: #FFF6DA; color: #9A7400; }
.notify-icon-decoration { background: #F7F5FF; color: #55439E; }
.notify-icon-chat { background: #EDF3FE; color: var(--blue); }
.notify-body { flex: 1; min-width: 0; }
.notify-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.notify-actor { font-weight: 600; color: var(--text); }
.notify-text { color: var(--text-2); }
.notify-type { font-size: 11px; color: var(--text-3); background: #F5F2EE; padding: 1px 5px; border-radius: 3px; }
.notify-time { font-size: 11.5px; color: var(--text-4); margin-top: 2px; }
.notify-go { flex: none; font-size: 12.5px; color: var(--blue); }
.notify-item.is-unread .notify-line::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none;
}

/* ---------- 设置 ---------- */
.settings-page { display: flex; flex-direction: column; gap: 10px; }
.settings-profile { padding: 16px 20px; }
.settings-user { display: flex; align-items: center; gap: 13px; }
.settings-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: var(--text); }
.settings-sub { font-size: 12px; color: var(--text-3); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 14px 20px; }
.pager-btn {
    min-width: 32px; height: 32px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 5px;
    background: #fff; color: var(--text-2); font-size: 13px;
}
a.pager-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pager-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager-btn.is-disabled { color: var(--text-4); background: #FAF9F7; }
.pager-gap { color: var(--text-4); padding: 0 3px; }
.pager-info { margin-left: auto; font-size: 11.5px; color: var(--text-4); }

/* ---------- 空状态 / 错误页 ---------- */
.empty { text-align: center; padding: 46px 20px; }
.empty-icon {
    width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: #F7F4F0; color: var(--text-4);
}
.empty-title { font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 3px; }
.empty-desc { font-size: 12.5px; color: var(--text-3); }
.empty-action { margin-top: 14px; }

.error-page { text-align: center; padding: 70px 20px 90px; }
.error-code { font-size: 68px; font-weight: 700; line-height: 1; color: var(--primary-soft); letter-spacing: 4px; }
.error-page h1 { font-size: 20px; margin: 6px 0 8px; }
.error-page p { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 10px; }
.footer-inner { padding: 24px 20px 30px; display: grid; grid-template-columns: 1fr auto; gap: 16px 30px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand strong { font-size: 14px; color: var(--text); }
.footer-brand p { font-size: 12px; color: var(--text-3); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.footer-links a { color: var(--text-3); }
.footer-links a:hover { color: var(--primary); }
.footer-copy { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-4); padding-top: 12px; border-top: 1px dashed var(--border); }

.narrow-page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.form-card { padding: 24px; }
.form-card .form-head h1 { font-size: 20px; }
.tips-card { padding: 16px 22px; }
.tips-card h2 { font-size: 14px; margin-bottom: 8px; }
.tips-card li { font-size: 12.5px; color: var(--text-3); padding: 3px 0 3px 14px; position: relative; }
.tips-card li::before { content: "·"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 1050px) {
    .layout-3col { grid-template-columns: 200px minmax(0, 1fr); }
    .col-right { display: none; }
    .header-search { flex: 0 1 220px; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-grid .col-right { display: flex; flex-direction: row; flex-wrap: wrap; }
    .profile-grid .col-right > * { flex: 1 1 240px; }
}

@media (max-width: 860px) {
    .header-nav { display: none; }
    .header-search { flex: 1; margin-left: 0; }
    .mobile-toggle { display: inline-flex; }
    .mobile-nav:not([hidden]) { display: block; }
    .user-menu-name { display: none; }
    .feed-hero { flex-direction: column; align-items: flex-start; }
    .feed-hero-stats { gap: 22px; }
    .profile-head { flex-direction: column; }
    .profile-actions { width: 100%; }
}

@media (max-width: 767px) {
    .container { padding: 0 12px; }
    .page { padding: 10px 12px 32px; }
    .layout-3col { display: flex; flex-direction: column; }
    .col-left { position: static; width: 100%; }
    .board-nav { padding: 10px; }
    .board-nav .side-head { margin-bottom: 8px; }
    .board-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
    .board-list::-webkit-scrollbar { display: none; }
    .board-list li { flex: none; }
    .board-link { border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; gap: 6px; }
    .board-link.is-active { border-color: var(--primary); }
    .board-ico { width: 20px; height: 20px; border-radius: 5px; }
    .board-count { display: none; }
    .side-note { display: none; }
    .board-post-btn { margin-top: 8px; }
    .col-right { display: none; }
    .header-inner { gap: 10px; }
    .brand-words small { display: none; }
    .header-search { flex: 1; }
    .header-search input { height: 32px; font-size: 12.5px; }
    .feed-hero { padding: 18px; }
    .feed-hero h1 { font-size: 19px; }
    .thread-item { padding: 12px 14px; gap: 10px; }
    .thread-side { display: none; }
    .thread-title { font-size: 14.5px; }
    .thread-meta { font-size: 11.5px; }
    .thread-feed { padding-top: 2px; }
    .pager { padding: 12px 14px; }
    .pager-info { width: 100%; margin-left: 0; text-align: center; }
    .card { padding: 16px; }
    .thread-feed { padding: 2px 0 0; }
    .thread-head { padding: 16px; }
    .thread-head-title { font-size: 18px; }
    .thread-head-actions { margin-left: 0; width: 100%; margin-top: 4px; }
    .floor { padding: 15px 16px; }
    .floor-op { border-left-width: 2px; }
    .post-body { font-size: 14.5px; }
    .floor-actions { gap: 12px; }
    .auth-card { padding: 22px 18px; }
    .profile-head { padding: 18px 16px; }
    .profile-main { flex-direction: column; align-items: flex-start; text-align: left; }
    .profile-name h1 { font-size: 19px; }
    .notify-head { flex-direction: column; align-items: flex-start; }
    .notify-head-actions { width: 100%; }
    .footer-inner { grid-template-columns: 1fr; padding: 20px 14px 26px; }
    .user-thread-list li, .user-post-list li { padding: 11px 16px; }
    .about-block { padding: 4px 16px 16px; }
    .comment-text { min-width: 0; }
    .thread-page { gap: 8px; }
    .floor-list { gap: 8px; }
}

/* ---------- 轻提示 ---------- */
.toast-host {
    position: fixed; left: 50%; bottom: 28px; z-index: 300;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    max-width: 88vw; padding: 9px 16px; border-radius: 999px;
    background: rgba(26, 26, 26, .9); color: #fff;
    font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    opacity: 0; transform: translateY(8px);
    transition: opacity .2s, transform .2s;
}
.toast.is-show { opacity: 1; transform: none; }
.toast-success { background: rgba(34, 122, 78, .94); }
.toast-error { background: rgba(163, 39, 43, .94); }
.toast-info { background: rgba(40, 40, 40, .9); }

html { scroll-behavior: smooth; overflow-x: clip; }
.page { flex: 1 0 auto; }
.site-header, .site-footer { flex: none; }

@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
    .brand { order: 1; min-width: 0; }
    .header-user { order: 2; margin-left: auto; }
    .mobile-toggle { order: 3; }
    .header-search { order: 4; flex: 1 1 100%; margin: 0; }
    .header-search input { height: 34px; }
    .feed-bar { flex-wrap: wrap; }
    .sort-tabs { max-width: 100%; }
    .thread-meta { row-gap: 2px; }
    .profile-actions .btn { flex: 1 1 auto; }
}

/* ---------- 会员中心 ---------- */
.membership-page { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.member-hero { padding: 22px 24px; position: relative; overflow: hidden; border-color: #F0E6DA; }
.member-hero::after {
    content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px;
    border-radius: 50%; background: radial-gradient(circle, rgba(232, 90, 42, .09), transparent 70%);
    pointer-events: none;
}
.member-hero-vip { background: linear-gradient(120deg, #F3F8FF, #FFFFFF 60%); border-color: #DCE9FB; }
.member-hero-svip { background: linear-gradient(120deg, #FFFBF0, #FFFFFF 60%); border-color: #F6E8C4; }
.member-hero-svip_plus { background: linear-gradient(120deg, #F7F4FF, #FFFDF4 60%); border-color: #E6E0FA; }
.member-hero-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.member-hero-id { display: flex; align-items: center; gap: 13px; }
.member-hero-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 17px; font-weight: 600; color: var(--text); }
.member-hero-line { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.member-hero-stats { display: flex; gap: 30px; }
.member-hero-stats div { text-align: center; }
.member-hero-stats strong { display: block; font-size: 20px; color: var(--primary); line-height: 1.25; }
.member-hero-stats span { font-size: 11.5px; color: var(--text-3); }
.member-hero-progress { margin-top: 16px; position: relative; z-index: 1; }
.member-progress-line { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.member-upsell { color: var(--primary); }

.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tier-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; transition: box-shadow .15s, transform .15s; }
.tier-card:hover { box-shadow: var(--shadow-hover); }
.tier-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.tier-head { display: flex; align-items: center; justify-content: space-between; }
.tier-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 700; }
.tier-current-tag { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 1px 7px; border-radius: 999px; }
.tier-price strong { font-size: 26px; color: var(--text); line-height: 1.2; }
.tier-price span { font-size: 12px; color: var(--text-3); margin-left: 3px; }
.tier-multiplier { font-size: 12.5px; color: var(--primary); }
.tier-benefits { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.tier-benefits li { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.tier-benefits svg { color: var(--ok); flex: none; margin-top: 4px; }
.tier-thresholds { border-top: 1px dashed var(--border); padding-top: 8px; }
.tier-thresholds span { font-size: 11px; color: var(--text-3); }
.tier-thresholds p { font-size: 11px; color: var(--text-4); word-spacing: 1px; line-height: 1.6; }
.tier-form { margin-top: 2px; }

.package-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.package-card {
    border: 1px solid var(--border); border-radius: 6px; padding: 14px;
    display: flex; flex-direction: column; gap: 6px; background: #FAF9F7;
    transition: border-color .15s, background .15s;
}
.package-card:hover { border-color: var(--primary-line); background: #FFFBF8; }
.package-name { font-size: 14px; font-weight: 600; color: var(--text); }
.package-desc { font-size: 11.5px; color: var(--text-3); min-height: 32px; }
.package-growth strong { font-size: 19px; color: var(--primary); }
.package-growth span { font-size: 11px; color: var(--text-3); margin-left: 2px; }
.package-price { font-size: 15px; font-weight: 600; color: var(--text); margin-top: auto; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.task-list-full .task-item { padding: 9px 0; }
.task-list-full .task-name small { color: var(--text-4); font-weight: 400; margin-left: 4px; }
.task-progress { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.task-progress .progress { flex: 1; max-width: 120px; }
.growth-list-full { margin-top: 2px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px dashed var(--border); color: var(--text-2); }
.data-table tr:last-child td { border-bottom: none; }
.status { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.status-paid { background: #F1FBF5; color: #227A4E; }
.status-pending { background: #FFFBF2; color: #8A5A00; }
.status-refunded { background: #F5F2EE; color: var(--text-3); }
.member-rules h2 { font-size: 14px; margin-bottom: 8px; }
.member-rules li { font-size: 12.5px; color: var(--text-3); padding: 3px 0 3px 14px; position: relative; }
.member-rules li::before { content: "·"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }

@media (max-width: 860px) {
    .tier-grid { grid-template-columns: 1fr; }
    .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-col { grid-template-columns: 1fr; }
    .member-hero-main { flex-direction: column; align-items: flex-start; }
    .member-hero-stats { gap: 22px; }
}

/* ---------- 装扮商店 ---------- */
.deco-page { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.deco-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; background: linear-gradient(120deg, #FFF7F1, #FFFFFF 60%); }
.deco-hero h1 { font-size: 20px; margin-bottom: 3px; }
.deco-hero p { font-size: 12.5px; color: var(--text-3); }
.deco-hero-balance { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.deco-hero-balance span { font-size: 11.5px; color: var(--text-3); }
.deco-hero-balance strong { font-size: 22px; color: var(--primary); line-height: 1.2; }

.deco-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.deco-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: #fff; color: var(--text-2);
    font-size: 13px; box-shadow: var(--shadow);
}
.deco-tab em { font-style: normal; font-size: 10.5px; color: var(--text-4); }
.deco-tab:hover { border-color: var(--primary-line); color: var(--primary); text-decoration: none; }
.deco-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.deco-tab.is-active em { color: rgba(255, 255, 255, .8); }

.deco-panel { padding: 20px 24px 24px; }
.deco-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.deco-card {
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    display: flex; flex-direction: column; background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.deco-card:hover { border-color: var(--primary-line); box-shadow: var(--shadow-hover); }
.deco-card.is-equipped { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.deco-card.is-locked { opacity: .72; }
.deco-preview {
    height: 118px; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #FFF6EF, #F7F5F2 70%);
    border-bottom: 1px dashed var(--border);
}
.deco-preview .avatar { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .08)); }
.deco-sample-bubble {
    max-width: 190px; padding: 9px 13px; font-size: 12.5px;
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    color: var(--text-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.deco-info { padding: 12px 14px 6px; flex: 1; }
.deco-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.deco-flag { font-size: 10px; color: #9A7400; background: #FFF6DA; border-radius: 3px; padding: 1px 5px; font-weight: 500; }
.deco-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; min-height: 34px; line-height: 1.6; }
.deco-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.deco-price { font-size: 12.5px; font-weight: 600; color: var(--primary); }
.deco-req { font-size: 10.5px; color: #6B4FCF; background: #F3F0FF; border-radius: 3px; padding: 1px 5px; }
.deco-actions { padding: 6px 14px 14px; }
.deco-actions .btn { width: 100%; }
.deco-note h2 { font-size: 14px; margin-bottom: 10px; }
.deco-note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.deco-note-grid strong { font-size: 12.5px; color: var(--text-2); }
.deco-note-grid p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 860px) {
    .deco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .deco-note-grid { grid-template-columns: 1fr; }
    .deco-hero { flex-direction: column; align-items: flex-start; }
    .deco-hero-balance { align-items: flex-start; text-align: left; }
}
@media (max-width: 520px) {
    .deco-grid { grid-template-columns: 1fr; }
}

/* ---------- 活动 ---------- */
.activity-page { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.activity-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; }
.activity-hero h1 { font-size: 20px; margin-bottom: 3px; }
.activity-hero p { font-size: 12.5px; color: var(--text-3); }
.activity-hero-tabs { display: flex; gap: 4px; background: #FAF9F7; border: 1px solid var(--border); border-radius: 999px; padding: 3px; flex: none; }
.activity-hero-tabs .sort-tab { border-radius: 999px; }
.activity-hero-tabs em { font-style: normal; font-size: 10.5px; color: var(--text-4); margin-left: 2px; }
.activity-hero-tabs .sort-tab.is-active em { color: var(--primary); }

.activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.activity-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.activity-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.activity-banner {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    height: 110px; position: relative; overflow: hidden;
    background: linear-gradient(120deg, #FFF0E8, #FFE0D0);
}
.activity-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.activity-banner-member { background: linear-gradient(120deg, #F5F1FF, #FFF7E0); }
.activity-banner-normal { background: linear-gradient(120deg, #FFF3EA, #EEF7FF); }
.activity-banner-icon { color: rgba(232, 90, 42, .55); display: inline-flex; }
.activity-banner-member .activity-banner-icon { color: rgba(124, 110, 246, .6); }
.activity-banner-text { font-size: 13px; color: var(--text-3); letter-spacing: 2px; }
.activity-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.activity-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.act-chip { font-size: 10.5px; padding: 1px 7px; border-radius: 3px; white-space: nowrap; }
.act-chip-member { background: #F3F0FF; color: #5B4BC4; }
.act-chip-normal { background: #FFF0E8; color: var(--primary); }
.act-chip-req { background: #FFF6DA; color: #8A6400; }
.act-chip.is-running { background: #F1FBF5; color: #227A4E; }
.act-chip.is-upcoming { background: #EDF3FE; color: #2A5FB8; }
.act-chip.is-ended { background: #F2F0EC; color: var(--text-3); }
.activity-name { font-size: 16px; line-height: 1.4; }
.activity-name a { color: var(--text); }
.activity-name a:hover { color: var(--primary); }
.activity-subtitle { font-size: 12.5px; color: var(--text-3); }
.activity-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.activity-meta span { display: inline-flex; align-items: center; gap: 3px; }
.activity-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.activity-remain { font-size: 11.5px; color: var(--text-4); }

.activity-detail { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.activity-detail-banner { padding: 0; overflow: hidden; min-height: 170px; display: flex; align-items: center; }
.activity-detail-banner img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.activity-detail-banner-inner { display: flex; align-items: center; gap: 18px; padding: 26px 30px; }
.activity-banner-kicker { font-size: 11.5px; letter-spacing: 2px; color: var(--text-3); margin-bottom: 4px; }
.activity-detail-banner-inner h1 { font-size: 24px; line-height: 1.35; }
.activity-banner-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.activity-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
.activity-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.activity-side { display: flex; flex-direction: column; gap: 10px; }
.activity-detail-head { padding-bottom: 14px; border-bottom: 1px dashed var(--border); margin-bottom: 16px; }
.activity-detail-title { font-size: 20px; margin-top: 8px; }
.activity-detail-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.activity-detail-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.activity-detail-meta span { display: inline-flex; align-items: center; gap: 4px; }

.rich-text { font-size: 14.5px; line-height: 1.8; color: var(--text-2); }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 { margin: 16px 0 6px; color: var(--text); }
.rich-text h1 { font-size: 19px; }
.rich-text h2 { font-size: 17px; }
.rich-text h3 { font-size: 15.5px; }
.rich-text p { margin: 0 0 10px; }
.rich-text ul, .rich-text ol { margin: 0 0 12px; padding-left: 22px; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin: 3px 0; }
.rich-text blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--primary-line); background: #FFF9F5; color: var(--text-3); border-radius: 0 4px 4px 0; }
.rich-text img { max-width: 100%; border-radius: 6px; }
.rich-text a { color: var(--blue); }
.rich-text code { background: #F5F2EE; padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 12.5px; }
.rich-text hr { border: none; border-top: 1px dashed var(--border); margin: 16px 0; }
.rich-text table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.rich-text th, .rich-text td { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }

.activity-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.activity-text { font-size: 13px; color: var(--text-2); line-height: 1.8; }
.reward-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.reward-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #FAF9F7; border-radius: 5px; }
.reward-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.reward-item strong { display: block; font-size: 13px; color: var(--text); }
.reward-item span { font-size: 11px; color: var(--text-3); }

.activity-action-card h2 { font-size: 15px; margin-bottom: 4px; }
.activity-action-hint { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.activity-record { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-3); }
.activity-record strong { color: var(--primary); }
.activity-countdown { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 11.5px; color: var(--text-4); }
.participant-list { display: flex; flex-direction: column; gap: 8px; }
.participant-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.participant-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-tips h2 { font-size: 14px; margin-bottom: 8px; }
.activity-tips li { font-size: 12px; color: var(--text-3); padding: 3px 0 3px 14px; position: relative; }
.activity-tips li::before { content: "·"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }

@media (max-width: 860px) {
    .activity-grid { grid-template-columns: 1fr; }
    .activity-detail-grid { grid-template-columns: 1fr; }
    .activity-two { grid-template-columns: 1fr; }
    .activity-hero { flex-direction: column; align-items: flex-start; }
    .activity-detail-banner-inner { padding: 20px; }
    .activity-detail-banner-inner h1 { font-size: 20px; }
}

/* ---------- 消息与聊天 ---------- */
.chat-layout {
    display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 10px;
    align-items: stretch; height: calc(100vh - 132px); min-height: 560px;
}
.chat-side { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.chat-side-head h2 { font-size: 14px; }
.chat-side-list { flex: 1; overflow-y: auto; padding: 8px; }
.conv-group { margin-bottom: 10px; }
.conv-label { font-size: 11px; color: var(--text-4); padding: 4px 8px; letter-spacing: 1px; }
.conv-empty { font-size: 11.5px; color: var(--text-4); padding: 4px 8px 8px; }
.conv-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px; border-radius: 6px; color: var(--text-2);
    transition: background .15s;
}
.conv-item:hover { background: #F7F4F0; text-decoration: none; }
.conv-item.is-active { background: var(--primary-soft); }
.conv-avatar {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c, #2A6FE8); color: #fff; font-size: 15px;
}
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.conv-name { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.conv-time { font-size: 10px; color: var(--text-4); }
.conv-badge {
    min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
    background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 700;
    line-height: 15px; text-align: center;
}

.chat-panel { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.chat-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-head-avatar {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c, #2A6FE8); color: #fff;
}
.chat-head-text { min-width: 0; }
.chat-head-text h1 { font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-head-text p { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-state { font-size: 10px; color: #8A5A00; background: #FFF6DA; border-radius: 3px; padding: 1px 5px; font-weight: 400; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.chat-danger { color: var(--danger); border-color: #F5C9CA; }
.chat-danger:hover { background: #FEF5F5; color: var(--danger); }

.chat-members {
    border-bottom: 1px solid var(--border); padding: 10px 14px;
    display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 170px; overflow-y: auto;
    background: #FCFBF9;
}
.chat-members[hidden] { display: none; }
.chat-member { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.chat-member-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role { font-size: 10px; color: #5B4BC4; background: #F3F0FF; border-radius: 3px; padding: 0 4px; }
.member-role-owner { color: #8A5A00; background: #FFF6DA; }
.chat-member-action { background: none; border: none; color: var(--blue); font-size: 11px; cursor: pointer; padding: 0; }
.chat-member-action:hover { text-decoration: underline; }

.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px 18px 8px;
    background: #FAF9F7; display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.chat-load-more {
    align-self: center; background: #fff; border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 12px; font-size: 11.5px; color: var(--text-3); cursor: pointer;
}
.chat-load-more:hover { border-color: var(--primary-line); color: var(--primary); }
.chat-load-more[hidden] { display: none; }
.chat-msg { display: flex; align-items: flex-start; gap: 8px; max-width: 82%; }
.chat-msg.is-other { align-self: flex-start; }
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-msg.is-mine .chat-msg-body { align-items: flex-end; }
.chat-msg-identity { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.chat-msg-identity .identity { gap: 5px; }
.chat-msg-identity .lvl { height: 16px; font-size: 10px; }
.chat-msg-identity .identity-name { font-size: 12px; color: var(--text-2); }
.chat-msg-identity .user-title { font-size: 11px; }
.chat-msg-identity .member-plate svg { height: 15px; }
.chat-bubble {
    padding: 9px 13px; border-radius: 13px;
    background: #fff; border: 1px solid var(--border);
    color: var(--text-2); font-size: 13.5px; line-height: 1.65;
    word-break: break-word; overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    max-width: 100%;
}
.chat-msg.is-mine .chat-bubble {
    background: linear-gradient(135deg, #FF7A45, #E85A2A);
    border-color: transparent; color: #fff;
}
.chat-msg.is-mine .chat-bubble a { color: #fff; text-decoration: underline; }
.chat-bubble img.chat-image { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; }
.chat-msg-meta { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--text-4); padding: 0 3px; }
.chat-msg.is-mine .chat-msg-meta { flex-direction: row-reverse; }
.chat-delete { background: none; border: none; color: var(--text-4); font-size: 10px; cursor: pointer; padding: 0; opacity: 0; transition: opacity .15s; }
.chat-msg:hover .chat-delete { opacity: 1; }
.chat-delete:hover { color: var(--danger); }
.chat-msg-system { align-self: center; max-width: 100%; }
.chat-msg-system span {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    background: #F0EDE8; color: var(--text-3); font-size: 11px;
}
.chat-empty { margin: auto; text-align: center; color: var(--text-4); font-size: 12.5px; padding: 24px; }
.chat-empty[hidden] { display: none; }
.chat-empty svg { color: #DDD8D0; margin-bottom: 6px; }

.chat-composer {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 12px 4px; border-top: 1px solid var(--border); background: #fff;
}
.chat-composer textarea {
    flex: 1; min-height: 36px; max-height: 120px; padding: 8px 11px;
    border: 1px solid var(--border-strong); border-radius: 9px;
    background: #FAF9F7; color: var(--text); font-size: 13.5px; line-height: 1.5;
    resize: none; overflow-y: auto;
}
.chat-composer textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.composer-icon {
    width: 36px; height: 36px; flex: none; border: 1px solid var(--border);
    border-radius: 9px; background: #fff; color: var(--text-3); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.composer-icon:hover { color: var(--primary); border-color: var(--primary-line); }
.composer-send { height: 36px; flex: none; }
.chat-composer-hint { font-size: 10.5px; color: var(--text-4); padding: 0 14px 8px; background: #fff; }
.chat-lock { padding: 20px; text-align: center; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chat-blocked { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; gap: 6px; }
.chat-blocked-icon {
    width: 64px; height: 64px; border-radius: 18px; background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.chat-blocked h1, .chat-blocked h2 { font-size: 17px; }
.chat-blocked p { font-size: 13px; color: var(--text-3); max-width: 380px; margin-bottom: 8px; }
.chat-create-lock { text-align: center; padding: 44px 24px; }
.chat-create-lock h1 { font-size: 18px; margin: 10px 0 6px; }
.chat-create-lock p { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.chat-lock-actions { display: flex; gap: 10px; justify-content: center; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }

.chat-index { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.chat-index-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; }
.chat-index-head h1 { font-size: 20px; margin-bottom: 3px; }
.chat-index-head p { font-size: 12.5px; color: var(--text-3); }
.chat-index-actions { flex: none; }
.chat-index-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.chat-index-list { display: flex; flex-direction: column; gap: 2px; }
.chat-index-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 6px; color: var(--text-2); }
.chat-index-item:hover { background: #F7F4F0; text-decoration: none; }
.chat-index-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.chat-index-name { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--text); font-weight: 500; }
.chat-index-preview { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.discover-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: #FAF9F7; }
.discover-avatar { width: 40px; height: 40px; border-radius: 11px; }
.discover-info { flex: 1; min-width: 0; }
.discover-info strong { display: block; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-info p { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-info span { font-size: 10.5px; color: var(--text-4); }

@media (max-width: 860px) {
    .chat-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
    .chat-side { display: none; }
    .chat-panel { height: calc(100vh - 120px); min-height: 480px; }
    .chat-index-grid { grid-template-columns: 1fr; }
    .discover-grid { grid-template-columns: 1fr; }
    .chat-head { padding: 10px 12px; }
    .chat-msg { max-width: 92%; }
    .chat-index-head { flex-direction: column; align-items: flex-start; }
}
.chat-back { display: none; }
@media (max-width: 860px) { .chat-back { display: inline-flex; } }

/* 自定义聊天气泡：未指定文字颜色时使用深色文字，避免白底白字 */
.chat-msg.is-mine .chat-bubble.has-custom { color: var(--text-2); }
.chat-msg.is-other .chat-bubble.has-custom { color: var(--text-2); }

/* ---------- 主页背景板 ---------- */
.profile-head { position: relative; }
.profile-head.has-bg {
    background-size: cover;
    background-position: center;
    border-color: #E6DFD6;
}
.profile-head.has-bg::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(95deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .82) 55%, rgba(255, 255, 255, .62) 100%);
    backdrop-filter: blur(1px);
    border-radius: var(--radius);
}
.profile-head.has-bg > * { position: relative; z-index: 1; }

/* ---------- 上传控件 ---------- */
.upload-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.upload-block { display: flex; flex-direction: column; gap: 8px; }
.upload-block .field-label { display: block; }
.upload-preview {
    border: 1px dashed var(--border-strong); border-radius: 8px;
    background: #FAF9F7; display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.upload-preview-avatar { width: 96px; height: 96px; border-radius: 50%; padding: 0; }
.upload-preview-avatar .avatar { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .06)); }
.upload-preview-bg { width: 100%; height: 132px; }
.upload-preview-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--text-4); }
.upload-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.upload-actions .btn { cursor: pointer; }
.upload-hint { font-size: 11px; color: var(--text-4); }
.upload-block.is-uploading .upload-preview { opacity: .55; }

/* ---------- 用户名片弹层 ---------- */
.ucard-modal { position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ucard-modal[hidden] { display: none; }
.ucard-backdrop { position: absolute; inset: 0; background: rgba(26, 22, 18, .42); backdrop-filter: blur(2px); }
.ucard-panel {
    position: relative; width: 100%; max-width: 360px;
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    animation: ucard-in .18s ease-out;
}
@keyframes ucard-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.ucard-cover {
    height: 96px; position: relative;
    background: linear-gradient(120deg, #FFE3D2, #FFD0E2 55%, #E6E0FF);
    background-size: cover; background-position: center;
}
.ucard-cover.has-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .18));
}
.ucard-close {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, .85); color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ucard-close:hover { background: #fff; color: var(--primary); }
.ucard-body { padding: 0 18px 18px; position: relative; }
.ucard-avatar { margin-top: -34px; margin-bottom: 6px; display: inline-flex; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .12)); }
.ucard-avatar .avatar { background: #fff; border-radius: 50%; }
.ucard-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ucard-name { font-size: 17px; font-weight: 600; color: var(--text); }
.ucard-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.ucard-joined { color: var(--text-4); }
.ucard-bio { margin-top: 9px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.ucard-sign { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.ucard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ucard-stats li { text-align: center; }
.ucard-stats strong { display: block; font-size: 15px; color: var(--text); line-height: 1.3; }
.ucard-stats span { font-size: 10.5px; color: var(--text-3); }
.ucard-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ucard-actions .btn { flex: 1; min-width: 96px; }
.ucard-actions .btn.is-following { background: #F2F0EC; border-color: var(--border); color: var(--text-3); }

@media (max-width: 640px) {
    .upload-row { grid-template-columns: 1fr; }
    .upload-preview-bg { height: 110px; }
    .ucard-modal { align-items: flex-end; padding: 0; }
    .ucard-panel { max-width: 100%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0); animation: ucard-up .2s ease-out; }
    @keyframes ucard-up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
}
