/* ============================================================================
   独立留言板平台 - 全局核心样式库 (统管前台与后台控制台)
============================================================================ */

/* 1. 全局变量与夜间模式 */
:root { 
    --primary: #3b82f6; --primary-hover: #2563eb; 
    --bg: #f8fafc; --surface: #ffffff; 
    --text-main: #0f172a; --text-muted: #64748b; 
    --border: #e2e8f0; --ring: rgba(59, 130, 246, 0.25); 
    --input-bg: #ffffff; --box-bg: #f8fafc; --reply-bg: #f8fafc;
    --link-pill-bg: #f1f5f9; --link-pill-text: #475569;
    --avatar-bg: #eff6ff; --avatar-border: #bfdbfe;
}

/* ================= 调色板 (Color Scheme) 完美修正版 ================= */
/* 🌸 樱花粉 */
body[data-theme-color="sakura"] { --primary: #ec4899; --primary-hover: #db2777; --bg: #fdf2f8; --ring: rgba(236, 72, 153, 0.25); --box-bg: #fdf2f8; --reply-bg: #fdf2f8; --link-pill-bg: #fce7f3; --link-pill-text: #9d174d; --avatar-bg: #fce7f3; --avatar-border: #fbcfe8; --btn-text: #ffffff; }
[data-theme="dark"] body[data-theme-color="sakura"] { --primary: #f472b6; --primary-hover: #ec4899; --bg: #25121b; --box-bg: #361a27; --reply-bg: #25121b; --text-main: #fce7f3; --text-muted: #fbcfe8; --border: #4a2135; --link-pill-bg: #4a2135; --link-pill-text: #fbcfe8; --avatar-bg: #4a2135; --avatar-border: #83395d; }

/* 🌲 森林绿 */
body[data-theme-color="forest"] { --primary: #10b981; --primary-hover: #059669; --bg: #f0fdf4; --ring: rgba(16, 185, 129, 0.25); --box-bg: #f0fdf4; --reply-bg: #f0fdf4; --link-pill-bg: #dcfce7; --link-pill-text: #166534; --avatar-bg: #dcfce7; --avatar-border: #bbf7d0; --btn-text: #ffffff; }
[data-theme="dark"] body[data-theme-color="forest"] { --primary: #34d399; --primary-hover: #10b981; --bg: #0f1c15; --box-bg: #162b21; --reply-bg: #0f1c15; --text-main: #f0fdf4; --text-muted: #bbf7d0; --border: #234535; --link-pill-bg: #234535; --link-pill-text: #a7f3d0; --avatar-bg: #234535; --avatar-border: #059669; }

/* 🌇 晚霞橘 */
body[data-theme-color="sunset"] { --primary: #f97316; --primary-hover: #ea580c; --bg: #fff7ed; --ring: rgba(249, 115, 22, 0.25); --box-bg: #fff7ed; --reply-bg: #fff7ed; --link-pill-bg: #ffedd5; --link-pill-text: #9a3412; --avatar-bg: #ffedd5; --avatar-border: #fed7aa; --btn-text: #ffffff; }
[data-theme="dark"] body[data-theme-color="sunset"] { --primary: #fb923c; --primary-hover: #f97316; --bg: #24150c; --box-bg: #361f12; --reply-bg: #24150c; --text-main: #fff7ed; --text-muted: #fed7aa; --border: #522f1c; --link-pill-bg: #522f1c; --link-pill-text: #fdba74; --avatar-bg: #522f1c; --avatar-border: #ea580c; }

/* 💜 薰衣草紫 */
body[data-theme-color="lavender"] { --primary: #8b5cf6; --primary-hover: #7c3aed; --bg: #f5f3ff; --ring: rgba(139, 92, 246, 0.25); --box-bg: #f5f3ff; --reply-bg: #f5f3ff; --link-pill-bg: #ede9fe; --link-pill-text: #5b21b6; --avatar-bg: #ede9fe; --avatar-border: #ddd6fe; --btn-text: #ffffff; }
[data-theme="dark"] body[data-theme-color="lavender"] { --primary: #a78bfa; --primary-hover: #8b5cf6; --bg: #161421; --box-bg: #221d33; --reply-bg: #161421; --text-main: #f5f3ff; --text-muted: #ddd6fe; --border: #352d4d; --link-pill-bg: #352d4d; --link-pill-text: #c4b5fd; --avatar-bg: #352d4d; --avatar-border: #7c3aed; }

/* 🍵 莫兰迪抹茶 */
body[data-theme-color="matcha"] { --primary: #5b7a61; --primary-hover: #455e4b; --bg: #f4f5f0; --ring: rgba(91, 122, 97, 0.25); --box-bg: #f9faf7; --reply-bg: #ecefe9; --link-pill-bg: #e6e9e3; --link-pill-text: #3c4f40; --avatar-bg: #e6e9e3; --avatar-border: #d1d6cc; --btn-text: #ffffff; }
[data-theme="dark"] body[data-theme-color="matcha"] { --primary: #7ea385; --primary-hover: #5b7a61; --bg: #1a1e1b; --box-bg:#242925; --reply-bg:#1a1e1b; --text-main: #f4f5f0; --text-muted: #d1d6cc; --border: #384039; --link-pill-bg: #384039; --link-pill-text: #a8bfae; --avatar-bg: #384039; --avatar-border: #455e4b; }

/* 💊 多巴胺元气 */
body[data-theme-color="dopamine"] { --primary: #facc15; --primary-hover: #eab308; --text-main: #422006; --bg: #fefce8; --ring: rgba(250, 204, 21, 0.3); --box-bg: #fff; --reply-bg: #fef08a; --link-pill-bg: #fef08a; --link-pill-text: #854d0e; --avatar-bg: #fef08a; --avatar-border: #fde047; --btn-text: #422006; }
[data-theme="dark"] body[data-theme-color="dopamine"] { --primary: #fde047; --primary-hover: #facc15; --bg: #241703; --box-bg:#382405; --reply-bg:#241703; --text-main: #fefce8; --text-muted: #fef08a; --border: #593908; --link-pill-bg: #593908; --link-pill-text: #fef08a; --avatar-bg: #593908; --avatar-border: #eab308; --btn-text: #422006; }

/* 🌃 赛博朋克黑 */
body[data-theme-color="cyberpunk"] { --primary: #06b6d4; --primary-hover: #0891b2; --bg: #0f172a; --text-main:#f1f5f9; --text-muted:#94a3b8; --ring: rgba(6, 182, 212, 0.4); --box-bg: #1e293b; --reply-bg: #0f172a; --link-pill-bg: #1e293b; --link-pill-text: #22d3ee; --avatar-bg: #0f172a; --avatar-border: #06b6d4; border-color:#334155; --btn-text: #ffffff; }
body[data-theme-color="cyberpunk"] .container { border: 1px solid #334155; }
body[data-theme-color="cyberpunk"] input, body[data-theme-color="cyberpunk"] textarea { background: #0f172a; border-color: #334155; color: #f1f5f9;}

/* ================= 布局二：微博动态卡片模式 ================= */
.layout-weibo { display: flex; flex-direction: column; gap: 1.5rem; }
.weibo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.weibo-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.wb-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.wb-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--avatar-bg); border: 1px solid var(--avatar-border); display: flex; align-items:center; justify-content:center; color:var(--primary); font-weight:bold;}
.wb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wb-info { flex: 1; }
.wb-name { font-size: 1rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.5rem;}
.wb-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }
.wb-link { font-size: 0.8rem; color: var(--primary); padding: 0.2rem 0.6rem; border: 1px solid var(--primary); border-radius: 20px; text-decoration: none; transition: 0.2s;}
.wb-link:hover { background: var(--primary); color: var(--btn-text, #fff); }
.wb-content { font-size: 0.95rem; color: var(--text-main); margin-bottom: 1rem; line-height: 1.7; word-break: break-all;}
.wb-reply { background: var(--reply-bg); padding: 0.8rem 1rem; border-radius: 8px; font-size: 0.9rem; color: var(--text-main); border-left: 3px solid var(--primary);}

/* ================= 布局三：微信朋友圈模式 ================= */
.layout-wechat { display: flex; flex-direction: column; gap: 0; }
.wechat-item { display: flex; gap: 0.8rem; padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.wechat-item:last-child { border-bottom: none; }
.wc-avatar { width: 42px; height: 42px; border-radius: 6px; overflow: hidden; background: var(--avatar-bg); flex-shrink: 0; display: flex; align-items:center; justify-content:center; color:var(--primary); font-weight:bold;}
.wc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wc-main { flex: 1; min-width: 0; }
.wc-name { font-size: 1rem; font-weight: 600; color: #576b95; margin-bottom: 0.3rem; }
[data-theme="dark"] .wc-name, [data-theme="dark"] .wc-reply-author { color: #8ea4cc; }
.wc-link { text-decoration: none; font-size: 0.9rem; }
.wc-content { font-size: 0.95rem; color: var(--text-main); line-height: 1.6; margin-bottom: 0.5rem; word-break: break-all;}
.wc-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.wc-reply-area { position: relative; background: var(--reply-bg); border-radius: 4px; padding: 0.5rem 0.8rem; }
.wc-arrow { position: absolute; top: -10px; left: 15px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 10px solid var(--reply-bg); }
.wc-reply-body { font-size: 0.9rem; color: var(--text-main); word-break: break-all;}
.wc-reply-author { color: #576b95; font-weight: 600; margin-right: 4px; }

/* ================= 布局四：气泡对话风格 (Chat) ================= */
.layout-chat { display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem 0; }
.chat-item { display: flex; gap: 1rem; max-width: 90%; }
.admin-reply { align-self: flex-end; flex-direction: row; justify-content: flex-end; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--avatar-bg); display: flex; align-items:center; justify-content:center; color:var(--primary); font-weight:bold; flex-shrink: 0; }
.admin-avatar { background: var(--primary); color: var(--btn-text, #fff); border:none; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-body { display: flex; flex-direction: column; min-width: 0; }
.admin-reply .chat-body { align-items: flex-end; }
.chat-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; margin-left: 0.2rem; }
.admin-reply .chat-meta { margin-right: 0.2rem; }
.chat-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; margin-left: 0.2rem; opacity: 0.8; }
.chat-bubble { padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.95rem; line-height: 1.6; word-break: break-all; width: fit-content; }
.visitor-bubble { background: var(--box-bg); color: var(--text-main); border: 1px solid var(--border); border-top-left-radius: 2px; }
.admin-bubble { background: var(--primary); color: var(--btn-text, #fff); border-top-right-radius: 2px; }

/* ================= 布局五：极简时光轴 (Timeline) ================= */
.layout-timeline { position: relative; padding-left: 1.5rem; margin-left: 0.5rem; border-left: 2px solid var(--border); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.tl-dot { position: absolute; left: -1.5rem; top: 0.2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); transform: translateX(-50%); box-shadow: 0 0 0 4px var(--bg); }
.tl-content { background: var(--box-bg); padding: 1.2rem; border-radius: 12px; border: 1px solid var(--border); transition: 0.3s; }
.tl-content:hover { border-color: var(--primary); box-shadow: 0 4px 12px var(--ring); }
.tl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; border-bottom: 1px dashed var(--border); padding-bottom: 0.5rem; }
.tl-name { font-weight: 700; color: var(--text-main); font-size: 1rem; }
.tl-time { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.tl-body { font-size: 0.95rem; color: var(--text-main); line-height: 1.6; margin-bottom: 0.8rem; word-break: break-all;}
.tl-reply { background: var(--reply-bg); padding: 0.8rem; border-radius: 6px; font-size: 0.85rem; color: var(--text-main); }

[data-theme="dark"] {
    --primary: #60a5fa; --primary-hover: #3b82f6; 
    --bg: #0f172a; --surface: #1e293b; 
    --text-main: #f8fafc; --text-muted: #94a3b8; 
    --border: #334155; --ring: rgba(96, 165, 250, 0.4); 
    --input-bg: #0f172a; --box-bg: #1e293b; --reply-bg: #0f172a;
    --link-pill-bg: #334155; --link-pill-text: #cbd5e1;
    --avatar-bg: #334155; --avatar-border: #475569;
}

/* 2. 基础重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg); color: var(--text-main); font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; line-height: 1.6; transition: background-color 0.3s, color 0.3s;}
a { color: var(--primary); text-decoration: none; }

/* 3. 布局容器 (前台+后台) */
.container { max-width: 960px; margin: 2rem auto; background: var(--surface); border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); border: 1px solid var(--border); overflow: hidden; transition: 0.3s; }
.dashboard { max-width: 960px; margin: 2rem auto; background: var(--surface); border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid var(--border); overflow: hidden; }
.layout-center { max-width: 400px; margin: 10vh auto; background: var(--surface); padding: 2.5rem; border-radius: 16px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border: 1px solid var(--border);}
.content-body, .d-body { padding: 2rem; }

/* 4. 表单与按钮组件 (全局通用) */
.form-area { background: var(--box-bg); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 2.5rem; transition: 0.3s;}
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-main); }
input[type="text"], input[type="password"], input[type="number"], select, textarea { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: var(--input-bg); color: var(--text-main); outline: none; transition: 0.2s; margin-bottom: 1rem;}
.form-group input, .form-group select, .form-group textarea { margin-bottom: 0; padding: 0.6rem 0.8rem; border-radius: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

button, .btn-submit, .btn-primary, .btn-danger { display: inline-block; text-align: center; padding: 0.8rem 1.5rem; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; }
button:hover, .btn-submit:hover, .btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-danger { background: #fff; color: #ef4444; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fef2f2; }

/* 5. 栅格与小工具 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.opt-grid input { margin-bottom: 0; }
.captcha-row, .captcha-box { display: flex; gap: 1rem; align-items: stretch; }
.captcha-row input, .captcha-box input { flex: 1; margin-bottom: 0; }
.captcha-row img, .captcha-box img { height: 42px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.captcha-box img { height: 38px; border-radius: 6px; }

/* 6. 警告框与提示组件 */
.alert, .alert-box { padding: 1rem 1.5rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; margin-bottom: 1.5rem; text-align: center; }
.alert-error, .alert-box { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; text-align: left; }
.alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; text-align: left; }

/* 7. 弹窗与分页 */
dialog { margin: auto; padding: 1.5rem; border: 1px solid var(--border); border-radius: 12px; max-width: 320px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); background: var(--surface); color: var(--text-main); }
dialog::backdrop { background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(2px); }
.btn-dialog { width: 100%; padding: 0.6rem; background: var(--link-pill-bg); color: var(--text-main); border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-dialog:hover { background: var(--border); }
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; align-items: center;}
.pagination a, .pagination span { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; border: 1px solid var(--border); color: var(--text-main); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--surface);}

/* 8. 前台专有样式 */
.header { text-align: center; padding: 2.5rem 2rem 1.5rem; border-bottom: 1px solid var(--border); }
.header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.header p { color: var(--text-muted); font-size: 0.9rem; }
.user-links { margin-top: 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.link-pill { display: inline-block; padding: 0.3rem 0.8rem; background: var(--link-pill-bg); color: var(--link-pill-text); border-radius: 20px; font-size: 0.85rem; font-weight: 500; transition: all 0.2s; border: 1px solid transparent; }
.link-pill:hover { background: var(--ring); color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.emoji-bar { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; margin-bottom: 1rem; display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; }
.emoji-bar::-webkit-scrollbar { display: none; }
.emoji-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; border-radius: 4px; transition: background 0.2s; padding: 0.2rem 0.4rem; width: auto;}
.emoji-btn:hover { background: var(--border); transform: scale(1.1); }
.msg-item { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;}
.msg-item:last-child { border-bottom: none; margin-bottom: 0;}
.msg-head { display: flex; justify-content: space-between; margin-bottom: 0.5rem; align-items: center;}
.user-info { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; font-size: 0.95rem;}
.avatar { width: 36px; height: 36px; background: var(--avatar-bg); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; border: 1px solid var(--avatar-border); overflow: hidden;}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.v-link { font-size: 0.85rem; color: var(--text-muted); font-weight: normal; margin-left: 0.5rem;}
.v-link:hover { color: var(--primary); text-decoration: underline;}
.msg-text { padding-left: 3rem; color: var(--text-main); white-space: pre-wrap; word-break: break-all; }
.reply-box { margin-top: 0.8rem; margin-left: 3rem; background: var(--reply-bg); border-radius: 0 8px 8px 8px; padding: 0.8rem; border-left: 3px solid #10b981; font-size: 0.9rem; color: var(--text-main); }
.list-books { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.book-card { border: 1px solid var(--border); padding: 1rem; border-radius: 8px; transition: 0.2s; display: block; color: var(--text-main); background: var(--surface);}
.book-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px var(--ring); transform: translateY(-2px); }
.book-card span { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem;}
.floating-tools { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.8rem; z-index: 999; }
.tool-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: all 0.3s; opacity: 1; visibility: visible; padding: 0; }
.tool-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); }
.tool-btn.hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); }

/* 9. 后台管理专有样式 */
.d-header { background: var(--surface); padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.d-header h2 { font-size: 1.25rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.d-header h2::before { content: ""; display: block; width: 12px; height: 12px; background: var(--primary); border-radius: 4px; }
.d-header.super { background: #1e293b; color: white; border-bottom:none;}
.d-header.super h2 { color: white;} .d-header.super span {color: #94a3b8;}
.d-header.super h2::before { background: #ef4444; }
.nav-bar { display: flex; gap: 0.5rem; padding: 1rem 2rem; background: var(--box-bg); border-bottom: 1px solid var(--border); overflow-x: auto; }
.nav-bar a { padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: 0.2s; white-space: nowrap; }
.nav-bar a:hover { background: var(--border); color: var(--text-main); }
.nav-bar a.active { background: #e0f2fe; color: #0369a1; }
.nav-bar a.super-btn { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca;}
.nav-bar a.super-btn:hover { background: #fecaca; }
.nav-bar a.danger { margin-left: auto; color: #ef4444; }
.nav-bar a.danger:hover { background: #fee2e2; }
.search-box { display: flex; gap: 0.5rem; align-items: center; background: var(--box-bg); padding: 0.8rem; border-radius: 8px; border: 1px solid var(--border); flex: 1;}
.search-box input { margin: 0; flex: 1; }
.search-box button { width: auto; margin: 0; padding: 0.6rem 1.2rem; }
.filter-tabs { display: flex; gap: 0.3rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem;}
.filter-tabs a { padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); transition: 0.2s;}
.filter-tabs a:hover { background: var(--border); color: var(--text-main); }
.filter-tabs a.active { background: var(--text-main); color: #fff; }
.filter-tabs a.badge-wait { position: relative; }
.filter-tabs a.badge-wait::after { content: attr(data-count); position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; line-height: 1; display: none;}
.filter-tabs a.badge-wait[data-count]:not([data-count="0"])::after { display: block; }
.data-card { border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; background: var(--surface); }
.c-head { display: flex; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.85rem; color: var(--text-muted); padding-bottom: 0.8rem; border-bottom: 1px dashed var(--border); align-items: center;}
.tag { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-right: 0.5rem; }
.tag.top, .tag-top { background: #fef3c7; color: #d97706; }
.tag.wait { background: #fee2e2; color: #ef4444; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.rest { background: var(--border); color: var(--text-muted); }
.c-body { font-size: 0.95rem; margin-bottom: 1rem; color: var(--text-main); white-space: pre-wrap; word-break: break-all;}
.c-reply { background: var(--box-bg); padding: 0.8rem; border-radius: 6px; border-left: 3px solid var(--primary); font-size: 0.85rem; color: var(--text-main); margin-bottom: 1rem; }
.c-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.action-btn { font-size: 0.8rem; padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-weight: 500; cursor: pointer; text-decoration:none; display:inline-block;}
.action-btn:hover { background: var(--border); }
.action-btn.del { color: #ef4444; border-color: #fecaca; }
.action-btn.del:hover { background: #fef2f2; }
.action-btn.warn { color: #d97706; border-color: #fde68a; }
.section-title { font-size: 1.05rem; font-weight: 600; color: var(--text-main); margin: 2.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); display:flex; align-items:center; gap:0.5rem;}
.section-title:first-child { margin-top: 0; }
.help-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; display: block; }
.sys-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sys-table th, .sys-table td { padding: 0.8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle;}
.sys-table th { background: var(--box-bg); color: var(--text-muted); font-weight: 600; }
.monitor-card { background:var(--surface); border-left: 4px solid #ef4444; padding:1rem; margin-bottom:1rem; border-radius:4px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);}
.highlight { color: #dc2626; font-weight: bold; background: #fee2e2; padding: 0 2px; border-radius: 2px;}

/* 11. 后台看板与批量操作栏 */
.batch-bar { background: var(--box-bg); padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.batch-bar button { width: auto; padding: 0.4rem 0.8rem; font-size: 0.85rem; margin:0;}
.chk-box { width: 18px; height: 18px; cursor: pointer; margin:0;}
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dash-card { background: var(--box-bg); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border); text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.dash-card h4 { margin: 0; font-size: 0.95rem; color: var(--text-muted); font-weight: 500;}
.dash-card .num { font-size: 2rem; font-weight: 700; color: var(--text-main); margin-top: 0.5rem; }

/* 12. 后台模块化配置卡片 */
.settings-panel { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 2rem; background: var(--surface); overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.panel-header { background: var(--box-bg); padding: 1rem 1.5rem; font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid var(--border); color: var(--text-main); display: flex; align-items: center; gap: 0.5rem; }
.panel-body { padding: 1.5rem; }
.panel-body .form-group:last-child { margin-bottom: 0; }
[data-theme="dark"] .settings-panel { box-shadow: none; }

/* 13. 前台自定义背景图触发的半透明磨砂效果 */
body.has-custom-bg .container { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.5); }
body.has-custom-bg .form-area, body.has-custom-bg .reply-box { background: rgba(248, 250, 252, 0.7); }
[data-theme="dark"] body.has-custom-bg .container { background: rgba(30, 41, 59, 0.92); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] body.has-custom-bg .form-area, [data-theme="dark"] body.has-custom-bg .reply-box { background: rgba(15, 23, 42, 0.7); }

/* 10. 移动端自适应 */
@media (max-width: 600px) {
    .container { margin: 0; border-radius: 0; border: none; box-shadow: none;}
    .content-body, .d-body { padding: 1.5rem 1.2rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0;} 
    .captcha-row, .captcha-box { flex-direction: column; align-items: stretch; gap: 0.8rem;}
    .captcha-row img, .captcha-box img { max-width: 200px; }
    .list-books { grid-template-columns: 1fr; }
    .msg-text, .reply-box { padding-left: 0; margin-left: 0; margin-top: 0.8rem; }
    .floating-tools { bottom: 1.5rem; right: 1.5rem; }
    .sys-table { display: block; overflow-x: auto; white-space: nowrap;} 
    .search-box { flex-direction: column; align-items: stretch; margin-bottom:1rem;} 
    .filter-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
}