/* ============================================================
   小澜茶话会 · 多主题样式系统
   通过 html 元素的 data-skin / data-accent / data-wallpaper
   / data-layout / data-fontsize 组合出无限种外观
   ============================================================ */

/* ---------- 基础变量 ---------- */
:root {
    --accent: #b7a1f2;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --radius: 14px;
    --gap: 14px;
    --maxw: 1080px;
    --font-scale: 1;
}

/* ---------- 颜色主题（accent） ---------- */
html[data-accent="blue"]   { --accent: #4f6ef7; }
html[data-accent="purple"] { --accent: #8b5cf6; }
html[data-accent="lavender"] { --accent: #b7a1f2; }
html[data-accent="green"]  { --accent: #10b981; }
html[data-accent="pink"]   { --accent: #ec4899; }
html[data-accent="orange"] { --accent: #f97316; }
html[data-accent="cyan"]   { --accent: #06b6d4; }
html[data-accent="red"]    { --accent: #ef4444; }

/* ---------- 背景壁纸（wallpaper） ---------- */
html[data-wallpaper="aurora"] {
    --bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0c4a6e 100%);
    --bg-bright: 1;
}
/* 星澜：小澜茶话会默认壁纸，紫夜星河（与主页 233 INDEX 同色系） */
html[data-wallpaper="starry"] {
    --bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460'%3E%3Cg fill='%23cfe4ff' fill-opacity='0.05'%3E%3Cpath d='M120 74l4 12 12 4-12 4-4 12-4-12-12-4 12-4z'/%3E%3Cpath d='M382 208l2.6 7.8 7.8 2.6-7.8 2.6-2.6 7.8-2.6-7.8-7.8-2.6 7.8-2.6z'/%3E%3Cpath d='M236 380l2 6 6 2-6 2-2 6-2-6-6-2 6-2z'/%3E%3Ccircle cx='320' cy='120' r='1.8'/%3E%3Ccircle cx='80' cy='300' r='1.5'/%3E%3C/g%3E%3C/svg%3E"), radial-gradient(1100px 520px at 82% 8%, rgba(140,196,242,.16), transparent 62%), radial-gradient(900px 460px at 10% 88%, rgba(217,189,231,.14), transparent 60%), linear-gradient(165deg, #171221 0%, #120e18 52%, #1a1326 100%);
    --bg-bright: 1;
}
html[data-wallpaper="sunset"] {
    --bg: linear-gradient(135deg, #2d1b4e 0%, #7c2d12 55%, #831843 100%);
    --bg-bright: 1;
}
html[data-wallpaper="ocean"] {
    --bg: linear-gradient(160deg, #082f49 0%, #0c4a6e 50%, #155e75 100%);
    --bg-bright: 1;
}
html[data-wallpaper="forest"] {
    --bg: linear-gradient(160deg, #052e16 0%, #14532d 55%, #134e4a 100%);
    --bg-bright: 1;
}
html[data-wallpaper="neon"] {
    --bg: linear-gradient(135deg, #17153b 0%, #2e1065 50%, #4a044e 100%);
    --bg-bright: 1;
}
html[data-wallpaper="plain"] {
    --bg: #f1f5f9;
    --bg-bright: 0;
}
html[data-wallpaper="custom"] {
    /* 自定义壁纸叠加可调暗色遮罩：无论壁纸明暗都保证内容可读 */
    --bg: linear-gradient(rgba(13, 20, 38, var(--mask-o, 0.55)), rgba(13, 20, 38, var(--mask-o, 0.55))), var(--bg-image, linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0c4a6e 100%));
    --bg-bright: 1;
}

/* ---------- 质感样式（skin） ---------- */
/* 表面统一走 --surface-rgb + --surface-a，便于用户在设置里调整组件透明度 */
html[data-skin="glass"] {
    --surface-rgb: 255, 255, 255;
    --surface-a: 0.62;
    --surface: rgba(var(--surface-rgb), var(--surface-a));
    --surface-strong: rgba(var(--surface-rgb), min(calc(var(--surface-a) + 0.18), 1));
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.55);
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
    --backdrop: blur(14px);
    --radius: 16px;
    --input-bg: rgba(255, 255, 255, 0.92);
}
html[data-skin="flat"] {
    --surface-rgb: 255, 255, 255;
    --surface-a: 1;
    --surface: rgba(var(--surface-rgb), var(--surface-a));
    --surface-strong: rgba(var(--surface-rgb), var(--surface-a));
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --backdrop: none;
    --radius: 10px;
    --input-bg: #ffffff;
}
html[data-skin="gradient"] {
    --surface: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(240, 245, 255, 0.9));
    --surface-strong: linear-gradient(180deg, #ffffff, #eef2ff);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e0e7ff;
    --shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
    --backdrop: none;
    --radius: 16px;
    --input-bg: #ffffff;
}
html[data-skin="paper"] {
    --surface-rgb: 255, 253, 245;
    --surface-a: 1;
    --surface: rgba(var(--surface-rgb), var(--surface-a));
    --surface-strong: rgba(var(--surface-rgb), var(--surface-a));
    --text: #3f3a2e;
    --text-muted: #8a8168;
    --border: #e8dfc4;
    --shadow: 0 4px 16px rgba(120, 100, 60, 0.12);
    --backdrop: none;
    --radius: 6px;
    --input-bg: #fffdf5;
}
html[data-skin="dark"] {
    --surface-rgb: 33, 28, 42;
    --surface-a: 0.85;
    --surface: rgba(var(--surface-rgb), var(--surface-a));
    --surface-strong: rgba(var(--surface-rgb), min(calc(var(--surface-a) + 0.12), 1));
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --backdrop: blur(14px);
    --radius: 16px;
    --input-bg: #16121e;
}

/* 暗黑样式在浅色壁纸下也保持深色文字协调 */
html[data-skin="dark"][data-wallpaper="plain"] {
    --bg: #16121e;
}

/* ---------- 排版（layout） ---------- */
html[data-layout="compact"] { --gap: 8px; --radius: 10px; --maxw: 960px; }
html[data-layout="wide"]    { --gap: 18px; --maxw: 1320px; }
html[data-fontsize="small"] { --font-scale: 0.92; }
html[data-fontsize="large"] { --font-scale: 1.08; }

/* ---------- 全局 ---------- */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: calc(15px * var(--font-scale));
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
/* 背景固定层：用 position:fixed 替代 background-attachment:fixed（修复 iOS 上壁纸不显示/白屏问题），并支持亮度调节 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
    background-size: cover;
    filter: brightness(var(--bg-b, 1));
    pointer-events: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }
img { max-width: 100%; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.topbar-inner {
    max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gap);
    display: flex; align-items: center; gap: var(--gap);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent); color: #fff;
    display: grid; place-items: center; font-size: 17px;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.search {
    flex: 1; max-width: 420px; margin: 0 auto;
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-strong); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 8px 6px 16px;
}
.search input { flex: 1; border: 0; background: transparent; color: var(--text); outline: none; font-size: 14px; }
.search button { border: 0; background: var(--accent); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.nav { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-user { display: flex; align-items: center; gap: 6px; color: var(--text); }
.nav .inline, .inline { display: inline-flex; }
.inline form { margin: 0; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 14px; padding: 0; }
.danger-text { color: #ef4444; }
.theme-btn {
    width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface-strong); cursor: pointer; font-size: 17px;
    box-shadow: var(--shadow);
}
/* ---------- 移动端顶栏：折叠菜单 ---------- */
.nav-toggle {
    display: none; width: 38px; height: 38px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text); cursor: pointer; font-size: 17px; line-height: 1;
    box-shadow: var(--shadow);
}
@media (max-width: 860px) {
    .topbar-inner { flex-wrap: wrap; position: relative; gap: 8px; padding: 8px var(--gap); }
    .brand { flex: 1; min-width: 0; }
    .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .search { order: 10; flex: 1 1 100%; max-width: none; margin: 0; padding: 5px 6px 5px 12px; }
    .theme-btn { order: 11; width: 34px; height: 34px; font-size: 15px; flex-shrink: 0; }
    .nav-toggle { display: inline-grid; place-items: center; order: 12; flex-shrink: 0; }
    .nav {
        display: none; order: 20;
        position: absolute; top: calc(100% + 6px); left: var(--gap); right: var(--gap);
        flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--surface-strong); border: 1px solid var(--border);
        border-radius: 14px; padding: 8px; box-shadow: var(--shadow); z-index: 60;
    }
    .nav.open { display: flex; }
    .nav a, .nav .linklike {
        padding: 10px 12px; border-radius: 10px; width: 100%;
        text-align: left; font-size: 15px;
    }
    .nav a:hover, .nav a:active { background: var(--surface); }
    .nav form.inline { width: 100%; }
    /* 首页统计三张卡片在窄屏下收窄，避免溢出屏幕 */
    .stats { gap: 10px; }
    .stat { min-width: 0; flex: 1 1 0; padding: 12px 8px; }
    .stat b { font-size: 19px; }
    /* 长表格/代码块允许横向滚动，不撑破页面 */
    body { overflow-x: hidden; }
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: #fff !important; border: 0;
    padding: 9px 20px; border-radius: 999px; cursor: pointer;
    font-size: 14px; font-weight: 600; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
    transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn.danger { background: #ef4444; box-shadow: 0 4px 14px rgba(239,68,68,.35); }
.btn.like { background: transparent; color: var(--text) !important; border: 1px solid var(--border); box-shadow: none; }
.btn.like.liked { background: color-mix(in srgb, #ef4444 12%, transparent); border-color: #fecaca; color: #dc2626 !important; }

/* ---------- 首页 ---------- */
.hero {
    text-align: center; padding: 56px 0 26px;
    color: #fff; position: relative;
}
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 8px; text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.hero p { margin: 0 0 22px; opacity: .9; text-shadow: 0 1px 8px rgba(0,0,0,.2); }
/* 首页大字样式：渐变光晕（默认）/ 简约 / 强调色发光 */
.hero-gradient h1 {
    background: linear-gradient(120deg, #fff 20%, var(--accent) 60%, #fff 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
}
.hero-glow h1 { text-shadow: 0 0 26px var(--accent), 0 2px 16px rgba(0,0,0,.3); color: #fff; }
.hero-plain h1 { text-shadow: 0 2px 8px rgba(0,0,0,.35); color: #fff; }
html[data-wallpaper="plain"] .hero-plain h1 { color: var(--text); }

.stats { display: flex; justify-content: center; gap: var(--gap); margin: 0 0 26px; }
.stat {
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 26px;
    text-align: center; box-shadow: var(--shadow); min-width: 100px;
}
.stat b { display: block; font-size: 22px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--text-muted); }

.board-wrap { display: grid; gap: var(--gap); }
.board {
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px;
}
.board-title {
    margin: 0 0 12px; font-size: 15px; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
}
.board-title::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--accent); }
.board-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 10px;
    border-radius: 12px; color: var(--text); transition: background .15s ease;
}
.board-item + .board-item { border-top: 1px dashed var(--border); }
.board-item:hover { background: var(--accent-soft); }
.board-icon {
    width: 46px; height: 46px; flex: none; border-radius: 13px;
    background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center;
}
.board-main { flex: 1; display: flex; flex-direction: column; }
.board-main b { font-size: 15px; }
.board-main small { color: var(--text-muted); font-size: 12.5px; }
.board-meta { text-align: right; color: var(--text-muted); font-size: 12.5px; display: flex; flex-direction: column; }
.board-meta b { color: var(--accent); font-size: 15px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

.panel {
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px; margin: var(--gap) 0;
}
.panel-title { margin: 0 0 12px; font-size: 16px; }
.feed-item {
    display: flex; flex-direction: column; gap: 2px; padding: 9px 6px;
    color: var(--text); border-radius: 10px;
}
.feed-item:hover { background: var(--accent-soft); }
.feed-title { font-size: 14.5px; }
.feed-meta { font-size: 12px; color: var(--text-muted); }
.empty { color: var(--text-muted); text-align: center; padding: 26px 0; margin: 0; }

/* ---------- 版块 / 帖子列表 ---------- */
.crumb { padding: 14px 0 4px; font-size: 13px; color: var(--text-muted); }
.thread-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.thread-list-head h2 { margin: 0; font-size: 18px; }
.thread-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 8px;
    color: var(--text); border-radius: 12px;
}
.thread-item + .thread-item { border-top: 1px dashed var(--border); }
.thread-item:hover { background: var(--accent-soft); }
.thread-item .avatar { width: 40px; height: 40px; flex: none; }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-main small { color: var(--text-muted); font-size: 12px; }
.thread-meta { text-align: right; color: var(--text-muted); font-size: 12.5px; display: flex; flex-direction: column; }
.thread-meta b { color: var(--accent); }

.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; }
.avatar.xl { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }

/* ---------- 帖子详情 ---------- */
.post {
    display: grid; grid-template-columns: 160px 1fr; gap: 0;
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    margin: var(--gap) 0; overflow: hidden;
}
@media (max-width: 720px) { .post { grid-template-columns: 1fr; } }
.post-user {
    background: var(--accent-soft); border-right: 1px solid var(--border);
    padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.post-body { padding: 20px 22px; min-width: 0; }
.post-head h1 { margin: 0 0 4px; font-size: 20px; line-height: 1.4; }
.post-time { color: var(--text-muted); font-size: 12.5px; }
.post-content { margin: 14px 0; word-break: break-word; }
.post-content pre, .reply-content pre {
    background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto;
    font-size: 13px; line-height: 1.5;
}
.post-content code, .reply-content code {
    background: color-mix(in srgb, var(--text) 10%, transparent); padding: 2px 6px; border-radius: 6px; font-size: 13px;
}
.post-content img, .reply-content img { border-radius: 10px; margin: 6px 0; }
.post-content blockquote, .reply-content blockquote {
    border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 14px;
    color: var(--text-muted); background: var(--accent-soft); border-radius: 0 8px 8px 0;
}
.post-actions { display: flex; gap: 10px; margin-top: 16px; }

.reply { display: flex; gap: 12px; padding: 13px 4px; }
.reply + .reply { border-top: 1px dashed var(--border); }
.reply-main { flex: 1; min-width: 0; }
.reply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reply-head small { color: var(--text-muted); font-size: 12px; }
.reply-content { margin-top: 6px; word-break: break-word; }
.signature { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--text-muted); font-size: 12px; }

.role { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }
.role.admin { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }

/* ---------- 表单 ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }
input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="color"],
textarea, select {
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
    border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: inherit; outline: none;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
/* 颜色选择器：固定尺寸圆角色块（修复渲染成一条线的问题） */
input[type="color"] {
    width: 64px; height: 40px; padding: 4px; cursor: pointer;
    border-radius: 10px;
    -webkit-appearance: none; appearance: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border); border-radius: 7px; }
input[type="color"]::-moz-color-swatch { border: 1px solid var(--border); border-radius: 7px; }
input:disabled, select:disabled, textarea:disabled {
    opacity: .75; cursor: not-allowed; background: var(--input-bg);
}
textarea { resize: vertical; min-height: 90px; }

/* ---------- 文件选择控件美化（修复原生 file 控件在深色主题下的渲染突兀） ---------- */
.file-hidden {
    position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.file-name { font-size: 13px; color: var(--text-muted); }
.upload-form {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 10px 0;
}
.upload-form .btn { flex: none; }
/* 发帖/回复插图工具条 */
.composer-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: -6px 0 14px;
}
.composer-toolbar .btn { min-height: 34px; }
.markdown-preview {
    margin: 0 0 14px; padding: 14px; min-height: 44px; overflow-wrap: anywhere;
    border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg);
}
.markdown-preview img, .markdown-preview video { max-width: 100%; height: auto; }
.reply-edit { margin-top: 8px; }
.reply-edit-form { margin-top: 8px; }
.reply-edit-form textarea { width: 100%; }
.post-time { display: block; }

.auth-card {
    max-width: 400px; margin: 44px auto; padding: 30px;
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card p { margin: 0 0 18px; color: var(--text-muted); }
.auth-alt { font-size: 13.5px; text-align: center; }
/* 登录页“自动登录”：勾选框与文字同一行 */
.remember-login {
    flex-direction: row; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text); cursor: pointer; margin-bottom: 16px;
}
.remember-login input[type="checkbox"] {
    width: 17px; height: 17px; margin: 0; flex-shrink: 0;
    accent-color: var(--accent); cursor: pointer;
}

/* ---------- 用户链接（可点击进主页） ---------- */
.user-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.user-link:hover { color: var(--accent); opacity: 1; }
.user-link b { font-weight: 600; }
.post-user .user-link { flex-direction: column; }
.post-user .user-link b { font-size: 15px; }

/* ---------- 版块主题列表（可点标题/头像/作者） ---------- */
.thread-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 10px;
    border-radius: 12px; color: var(--text);
    transition: background .18s ease, transform .15s ease;
}
.thread-item + .thread-item { border-top: 1px dashed var(--border); }
.thread-item:hover { background: var(--accent-soft); }
.thread-avatar { border-radius: 14px; transition: transform .18s ease; }
.thread-avatar:hover { transform: scale(1.08); }
.thread-title { color: var(--text); min-width: 0; }
.thread-title:hover { color: var(--accent); }
.thread-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.thread-main small .user-link { font-size: 12px; color: var(--accent); }
.thread-main small .user-link:hover { text-decoration: underline; }

/* ---------- 密码框（显示/隐藏） ---------- */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 44px; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; cursor: pointer; font-size: 16px;
    width: 34px; height: 34px; border-radius: 9px; color: var(--text-muted);
}
.pw-toggle:hover { background: var(--accent-soft); }
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important; }
.pw-hint { color: #ef4444; font-size: 12.5px; margin: -6px 0 10px; }

/* ---------- 自定义壁纸 ---------- */
.wallpaper-preview {
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
    max-width: 420px; margin: 0 0 12px; box-shadow: var(--shadow);
}
.wallpaper-preview img { display: block; width: 100%; height: 140px; object-fit: cover; }
.muted { color: var(--text-muted); font-size: 13.5px; }

/* ---------- 入场动画 ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero, .stats, .board, .panel, .post, .auth-card, .profile-head, .flash {
    animation: fadeUp .45s ease both;
}
.board:nth-child(2), .panel:nth-child(2) { animation-delay: .06s; }
.board:nth-child(3), .panel:nth-child(3) { animation-delay: .12s; }
.board:nth-child(4), .panel:nth-child(4) { animation-delay: .18s; }

/* ---------- 悬浮反馈 ---------- */
.board, .panel, .post, .auth-card {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.board:hover, .panel:hover, .post:hover, .auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 18%, rgba(0,0,0,.2));
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.btn { transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px) scale(.97); }
.board-item, .feed-item, .admin-row { transition: background .18s ease, transform .15s ease; }
.board-item:hover, .feed-item:hover { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 头像管理 ---------- */
.avatar-manage { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.avatar-manage-info { flex: 1; min-width: 240px; }
.avatar-manage-info p { margin: 4px 0 10px; }
.avatar-manage .avatar.xl { box-shadow: var(--shadow); }

/* ---------- 个人主页操作区 ---------- */
.profile-actions { display: flex; gap: 10px; margin: 4px 0 var(--gap); flex-wrap: wrap; align-items: flex-start; }

/* ---------- 留言板 ---------- */
.msg-form textarea { margin-bottom: 10px; }
.msg { display: flex; gap: 10px; padding: 12px 4px; }
.msg + .msg { border-top: 1px dashed var(--border); }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.msg-head small { color: var(--text-muted); }
.msg-content { margin-top: 4px; word-break: break-word; white-space: pre-wrap; }

/* ---------- 举报 ---------- */
.report-box { position: relative; display: inline-block; }
.report-box summary { list-style: none; cursor: pointer; }
.report-box summary::-webkit-details-marker { display: none; }
.report-form {
    position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
    width: 300px; max-width: 78vw; padding: 12px;
    background: var(--surface-strong); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
    display: flex; gap: 8px; flex-direction: column;
}
.report-form input { margin: 0; }
.reply .report-form { left: auto; right: 0; }

/* ---------- QQ 预览（注册页） ---------- */
.qq-preview {
    display: flex; align-items: center; gap: 10px;
    background: var(--accent-soft); border: 1px solid var(--border);
    border-radius: 12px; padding: 8px 12px; margin: -6px 0 14px; font-size: 13.5px;
}
.qq-preview img { border-radius: 10px; object-fit: cover; }

/* ---------- 主题面板（右上角 🎨） ---------- */
.theme-panel {
    position: fixed; right: 16px; top: 64px; z-index: 100; width: 300px; max-height: 82vh; overflow-y: auto;
    background: var(--surface-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
    padding: 16px;
    animation: fadeUp .25s ease both;
}
.theme-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.theme-panel section { margin: 12px 0; }
.theme-panel h5 { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button {
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
    border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer;
}
.swatches button[data-accent] {
    width: 30px; height: 30px; border-radius: 50%; padding: 0;
    background: var(--sw); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.swatches button.on { background: var(--accent); color: #fff; border-color: transparent; }
.theme-tip { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; }
.theme-mask { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.25); }

/* ---------- 举报行（后台） ---------- */
.report-row span b.role { margin-right: 6px; }

/* ---------- 首页统计（可点击） ---------- */
a.stat { color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.stat:hover { transform: translateY(-2px); border-color: var(--accent); }
a.stat b { color: var(--accent); }

/* ---------- 成员列表 ---------- */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); }
.member-card {
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    transition: transform .18s ease, box-shadow .18s ease;
}
.member-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 20%, rgba(0,0,0,.2)); }
.member-card .name { font-weight: 600; color: var(--text); }
.member-card .muted { font-size: 12px; }
.member-card .mini-stats { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); }
.member-card .mini-stats b { color: var(--accent); }

/* ---------- 动态时间线 ---------- */
.timeline-item { display: flex; gap: 12px; padding: 12px 4px; }
.timeline-item + .timeline-item { border-top: 1px dashed var(--border); }
.timeline-badge {
    flex: none; width: 44px; height: 24px; border-radius: 999px; font-size: 12px;
    display: grid; place-items: center; margin-top: 8px;
    background: var(--accent-soft); color: var(--accent);
}
.timeline-badge.reply { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #b45309; }
.timeline-main { flex: 1; min-width: 0; }
.timeline-main .t-title { font-weight: 600; color: var(--text); display: block; }
.timeline-main .t-title:hover { color: var(--accent); }
.timeline-main .t-snippet { color: var(--text-muted); font-size: 13px; margin-top: 2px; word-break: break-word; }
.timeline-main .t-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- 聊天室（Telegram 风格） ---------- */
.chat-wrap {
    display: grid; grid-template-columns: 250px 1fr; gap: var(--gap);
    height: calc(100vh - 120px); min-height: 480px; margin: var(--gap) 0;
}
@media (max-width: 760px) { .chat-wrap { grid-template-columns: 1fr; height: auto; } .chat-side { display: none; } }
.chat-side {
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.chat-side h4 { margin: 2px 4px 8px; font-size: 13px; color: var(--text-muted); }
/* 侧栏搜索框 */
.chat-search {
    margin: 0 0 10px; padding: 8px 12px; font-size: 13px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text); width: 100%;
}
.chat-search:focus { border-color: var(--accent); outline: none; }
#roomList { display: flex; flex-direction: column; gap: 2px; }
.chat-room-btn {
    border: 1px solid transparent; background: transparent; color: var(--text);
    text-align: left; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}
.chat-room-btn:hover { background: var(--accent-soft); }
.chat-room-btn.on { background: var(--accent); color: #fff; }
.room-unread, .chat-total-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700;
}
.room-unread.none, .chat-total-badge.none { display: none; }
.nav-chat { position: relative; }
.chat-total-badge { margin-left: 3px; vertical-align: middle; }
.chat-room-form { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.chat-room-form input { padding: 7px 10px; font-size: 13px; }
.chat-room-form .btn { flex: none; padding: 6px 12px; font-size: 13px; }
.file-name:empty { display: none; }
.chat-main {
    display: flex; flex-direction: column; min-width: 0;
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden;
}
.chat-head {
    padding: 12px 18px; border-bottom: 1px solid var(--border);
    font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.chat-head small { color: var(--text-muted); font-weight: 400; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
/* 群公告置顶条 */
.chat-pinned {
    padding: 8px 18px; font-size: 13px; color: var(--text-muted);
    background: var(--accent-soft); border-bottom: 1px dashed var(--border);
    word-break: break-word;
}
/* 群管理面板：限高内部滚动，打开时不挤压聊天区 */
.room-manage {
    padding: 12px 18px; border-bottom: 1px dashed var(--border);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    max-height: 52%;
    overflow-y: auto;
    flex-shrink: 0;
}
.room-manage::-webkit-scrollbar { width: 8px; }
.room-manage::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 4px; }
.room-manage label { margin-bottom: 10px; }
.room-manage .check-line { flex-direction: row; align-items: center; gap: 8px; display: flex; }
.room-manage .check-line input { width: auto; }
.manage-grid { display: flex; flex-direction: column; }
.room-members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
/* 管理面板：小节标题 / 成员操作行 / 邀请链接 */
.manage-sec { margin: 12px 0 6px; font-size: 12.5px; color: var(--text-muted); }
.manage-row {
    display: flex; align-items: center; gap: 10px; padding: 6px 0;
    border-top: 1px dashed var(--border); flex-wrap: wrap;
}
.manage-row .user-link { flex: 1; min-width: 110px; }
.manage-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mute-select { width: auto; padding: 4px 6px; font-size: 12px; border-radius: 8px; }
.invite-link {
    width: 100%; font-size: 12px; padding: 6px 10px; margin-top: 4px;
    border-radius: 8px; border: 1px dashed var(--border); background: var(--input-bg); color: var(--text-muted);
}
/* 隐藏群邀请卡 */
.invite-card {
    max-width: 420px; margin: 48px auto; padding: 34px; text-align: center;
    background: var(--surface); backdrop-filter: var(--backdrop); -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    animation: fadeUp .4s ease both;
}
.invite-card h1 { margin: 12px 0 6px; font-size: 22px; }
.invite-card .avatar.xl { box-shadow: var(--shadow); }
.empty-block { padding: 40px 0; }

/* ---------- 自定义右键菜单 ---------- */
.ctx-menu {
    position: fixed; z-index: 300; min-width: 170px; padding: 6px;
    background: var(--surface-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,.3);
}
.ctx-item {
    padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.ctx-item:hover { background: var(--accent); color: #fff; }
.ctx-sep { height: 1px; margin: 5px 8px; background: var(--border); }
/* 轻提示（右键操作反馈） */
.toast-msg {
    position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%) translateY(8px);
    z-index: 500; padding: 9px 20px; border-radius: 999px;
    background: var(--surface-strong); color: var(--text); font-size: 13.5px;
    border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.25);
    opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 鼠标拖尾（canvas 光带） ---------- */
#trailCanvas {
    position: fixed; inset: 0; z-index: 400; pointer-events: none;
}
.trail-dot {
    position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    transform: translate(-50px, -50px);
    will-change: transform, opacity;
}
/* ---------- 通知中心 ---------- */
.nav-bell { position: relative; display: inline-flex; align-items: center; text-decoration: none; }
.bell-badge {
    position: absolute; top: -7px; right: -10px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: #ef4444; color: #fff; border-radius: 999px;
    font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, .4);
}
.bell-badge.none { display: none; }
.notif-list { display: flex; flex-direction: column; }
.notif-item {
    display: flex; align-items: center; gap: 10px; padding: 11px 8px;
    border-radius: 12px; color: var(--text);
    transition: background .15s ease;
}
.notif-item + .notif-item { border-top: 1px dashed var(--border); }
.notif-item:hover { background: var(--accent-soft); }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-type { font-size: 13.5px; color: var(--text); }
.notif-preview { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.notif-new {
    font-style: normal; background: var(--accent); color: #fff;
    font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
}

/* ---------- 图片灯箱 ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(6, 10, 24, .82);
    display: none; align-items: center; justify-content: center;
    padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 94vw; max-height: 92vh;
    border-radius: 12px; box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

/* ---------- 草稿恢复提示 ---------- */
.draft-tip {
    font-size: 12.5px; color: var(--accent);
    background: var(--accent-soft); border: 1px dashed var(--accent);
    border-radius: 10px; padding: 6px 10px; margin-bottom: 8px;
}

/* ---------- 成员在线状态 ---------- */
.member-card .avatar-lg-wrap, .member-card > a:first-child { position: relative; display: inline-block; }
.online-dot {
    position: absolute; right: 2px; bottom: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #10b981; border: 2px solid var(--surface);
}
.online-tag { color: #10b981; font-weight: 600; }

/* ---------- 管理端活跃图表 ---------- */
.activity-chart { width: 100%; height: auto; display: block; }
.chart-label { fill: var(--text-muted); font-size: 9px; font-family: inherit; }
.chart-legend .legend-swatch {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    vertical-align: -1px; margin-right: 4px;
}
.chart-legend .legend-swatch.solid { background: var(--accent); }
.chart-legend .legend-swatch.soft { background: var(--accent-soft); }

/* ---------- 成员在线状态结束，编辑器拖拽悬停提示 ---------- */
textarea.drag-over {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
    background: var(--accent-soft) !important;
}

/* ---------- 文字对比度模式 ---------- */
/* 自动：自定义壁纸下自动加强白字清晰度（解决玻璃低透明度看不清字） */
html[data-wallpaper="custom"] { --text: #f0f4ff; --text-muted: #c7d4e8; }
html[data-wallpaper="custom"] input, html[data-wallpaper="custom"] textarea,
html[data-wallpaper="custom"] select { color: #f0f4ff; }
/* 显式白字加强 */
html[style*="--contrast:light"] { --text: #f8fafc; --text-muted: #cbd5e1; }
html[style*="--contrast:light"] input, html[style*="--contrast:light"] textarea,
html[style*="--contrast:light"] select { color: #f8fafc; }
/* 显式深字加强（浅色皮肤/浅壁纸） */
html[style*="--contrast:dark"] { --text: #1e293b; --text-muted: #475569; }

/* 修复玻璃半透明下白线（backdrop-filter 毛边） */
.panel, .board, .post, .auth-card, .topbar, .card, .member-card, .chat-wrap {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* ---------- 外观微调滑杆（百分比跟随，实时预览） ---------- */
.range-val { color: var(--accent); font-size: 13px; margin-left: 6px; }
input[type="range"] { accent-color: var(--accent); cursor: pointer; }
.chat-row { display: flex; gap: 10px; align-items: flex-start; max-width: 86%; }
.chat-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble {
    background: var(--surface-strong); border: 1px solid var(--border);
    border-radius: 14px; padding: 8px 13px; min-width: 0;
}
.chat-row.mine .chat-bubble { background: var(--accent); color: #fff; border-color: transparent; }
.chat-bubble .c-name { font-size: 12px; color: var(--accent); margin-bottom: 2px; }
.chat-row.mine .c-name { color: rgba(255,255,255,.85); }
.chat-bubble .c-text { font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.chat-bubble .c-time { font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.chat-bubble .c-time .role { font-size: 10px; margin-left: 4px; }
.chat-bubble.deleted { opacity: .6; }
.deleted-text { font-style: italic; }
.chat-bubble .c-text img.chat-img {
    max-width: 280px; max-height: 320px; border-radius: 10px; display: block; margin: 4px 0;
    background: var(--input-bg);
}
.chat-bubble .c-text audio, .chat-bubble .c-text video { display: block; max-width: 280px; max-height: 280px; margin: 4px 0; border-radius: 10px; }
.chat-file { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--input-bg); margin: 4px 0; }
.chat-file:hover { border-color: var(--accent); }
.chat-row.mine .chat-file { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.15); color: #fff; }
.cf-emoji { font-size: 26px; }
.cf-meta { display: flex; flex-direction: column; font-size: 13px; min-width: 100px; }
.cf-meta small { color: var(--text-muted); font-size: 12px; }
.chat-row.mine .cf-meta small { color: rgba(255,255,255,.8); }
.chat-join-hint { color: var(--text-muted); font-size: 12px; align-self: center; }
.chat-attach { display: flex; align-items: center; }
.chat-input {
    display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border);
    background: var(--surface-strong);
}
.chat-input textarea { min-height: 44px; max-height: 110px; flex: 1; }
.chat-input .btn { flex: none; align-self: flex-end; }
.chat-empty { color: var(--text-muted); text-align: center; margin: auto; font-size: 13.5px; }

/* ---------- 存储管理（后台） ---------- */
.storage-summary { display: flex; gap: var(--gap); flex-wrap: wrap; margin-bottom: var(--gap); }
.storage-file { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px dashed var(--border); }
.storage-file:first-of-type { border-top: 0; }
.storage-file img.thumb { width: 56px; height: 34px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.storage-file .sf-name { flex: 1; min-width: 0; font-size: 13.5px; }
.storage-file .sf-name small { color: var(--text-muted); display: block; }
.storage-file .orphan { color: #b45309; font-size: 12px; background: color-mix(in srgb, #f59e0b 14%, transparent); border-radius: 999px; padding: 1px 9px; }

/* ---------- 图片裁切弹窗 ---------- */
.crop-mask { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.crop-modal {
    background: var(--surface-strong); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.4); padding: 18px; width: min(400px, 92vw);
}
.crop-modal h4 { margin: 0 0 10px; font-size: 16px; }
.crop-stage {
    width: 280px; height: 280px; margin: 0 auto; border-radius: 12px; overflow: hidden;
    background: #0f172a; cursor: grab; touch-action: none; position: relative;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { display: block; width: 280px; height: 280px; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.crop-zoom input[type="range"] { flex: 1; }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; }
.crop-tip { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; text-align: center; }
/* ---------- 用户主页 ---------- */
.profile-head {
    display: flex; align-items: center; gap: 18px; padding: 26px 4px;
}
.profile-head h1 { margin: 0; font-size: 22px; }
.profile-head .muted { color: var(--text-muted); font-size: 13px; }
.profile-head .quote { margin: 6px 0 0; color: var(--text-muted); border-left: 3px solid var(--accent); padding-left: 10px; }
.profile-stats { margin-left: auto; display: flex; gap: var(--gap); }

/* ---------- 后台 ---------- */
.admin-tabs { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.admin-tabs a {
    padding: 7px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 13.5px;
}
.admin-tabs a.on { background: var(--accent); color: #fff; border-color: transparent; }
.admin-row {
    display: flex; align-items: center; gap: 12px; padding: 9px 4px;
    border-top: 1px dashed var(--border);
}
.admin-row span { flex: 1; }

/* ---------- 提示条 ---------- */
.flash {
    padding: 11px 16px; border-radius: 12px; margin: 14px 0;
    font-size: 14px; border: 1px solid;
}
.flash-success { background: color-mix(in srgb, #10b981 12%, transparent); border-color: #a7f3d0; color: #047857; }
.flash-error { background: color-mix(in srgb, #ef4444 12%, transparent); border-color: #fecaca; color: #b91c1c; }

/* ---------- 主题面板 ---------- */
.theme-panel {
    position: fixed; right: 16px; top: 64px; z-index: 100; width: 300px; max-height: 82vh; overflow-y: auto;
    background: var(--surface-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
    padding: 16px;
}
.theme-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.theme-panel section { margin: 12px 0; }
.theme-panel h5 { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button {
    border: 1px solid var(--border); background: var(--surface-strong); color: var(--text);
    border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer;
}
.swatches button[data-accent] {
    width: 30px; height: 30px; border-radius: 50%; padding: 0;
    background: var(--sw); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.swatches button.on { background: var(--accent); color: #fff; border-color: transparent; }
.theme-tip { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; }
.theme-mask { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.25); }

/* ---------- 管理后台存储趋势 ---------- */
.storage-trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.storage-trend-head h3 { margin: 0; font-size: 15px; }
.storage-chart-scroll { overflow-x: auto; padding: 4px 0 0; }
.storage-chart { display: block; min-width: 640px; width: 100%; height: 220px; }
.storage-chart rect { opacity: .88; }
.storage-axis { stroke: var(--border); stroke-width: 1; }
.storage-axis-label { fill: var(--text-muted); font-size: 10px; }
.storage-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.storage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.storage-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--storage-color); display: inline-block; }

/* ---------- 分页 / 页脚 ---------- */
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px 0 4px; flex-wrap: wrap; }
.pager a {
    min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
    border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; padding: 0 8px;
}
.pager a.on { background: var(--accent); color: #fff; border-color: transparent; }

.footer {
    text-align: center; padding: 30px 0 40px; color: var(--text-muted);
    font-size: 13px; opacity: .9;
}
