* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #1890ff; --primary-hover: #40a9ff;
    --success: #52c41a; --warning: #faad14; --error: #ff4d4f;
    --text: #333; --text2: #666; --border: #d9d9d9; --bg: #f0f2f5; --white: #fff;
    --sidebar-w: 240px; --header-h: 60px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }

/* 登录 */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh;
    background: linear-gradient(135deg, #1d3b6e 0%, #2f6fb0 100%); }
.login-box { background: #fff; padding: 36px 40px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.2);
    width: 380px; }
.login-box h2 { text-align: center; margin-bottom: 6px; color: var(--primary); font-size: 22px; }
.login-box .sub { text-align: center; color: var(--text2); margin-bottom: 24px; font-size: 13px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px;
    font-size: 14px; transition: border-color .2s; box-sizing: border-box; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,144,255,.12); }
.btn { display: inline-block; padding: 8px 18px; border: none; border-radius: 5px; cursor: pointer;
    font-size: 14px; transition: all .2s; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-default { background: #f0f0f0; color: #333; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
#app { display: none; }
#app.active { display: block; }
/* 侧栏：以蓝色为基准的深色导航 */
.sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); height: 100vh;
    background: linear-gradient(180deg, #0a1e38 0%, #0b2545 55%, #0d2c53 100%);
    color: #fff; overflow-y: auto; overflow-x: hidden; z-index: 100;
    box-shadow: 2px 0 14px rgba(4,22,44,.35); }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(64,169,255,.3); border-radius: 3px; }
.logo { position: relative; display: flex; align-items: center; gap: 10px;
    padding: 16px 14px 16px 16px; border-bottom: 1px solid rgba(64,169,255,.22);
    background: linear-gradient(180deg, rgba(24,144,255,.2), rgba(24,144,255,0)); }
.logo::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 76px; height: 3px;
    background: linear-gradient(90deg, #1677ff, #40a9ff); border-radius: 0 3px 3px 0; }
.logo-img { width: 42px; height: 42px; flex: none; border-radius: 10px; background: #fff;
    object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; white-space: nowrap; }
.logo-sub { font-size: 12px; font-weight: 600; color: #6fc0ff; letter-spacing: 1.5px;
    line-height: 1.2; margin-top: 4px; white-space: nowrap; }

/* 分组标题：蓝系三色区分三大版块，胶囊底 + 圆点 + 左色条，显著提升辨识度 */
.menu-group-title { display: flex; align-items: center; gap: 7px;
    margin: 16px 10px 7px; padding: 7px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 700; letter-spacing: 1px;
    border-left: 3px solid currentColor; }
.menu-group-title::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex: none;
    background: currentColor; box-shadow: 0 0 8px currentColor; }
.menu-group-title.g1 { color: #6fc0ff; background: rgba(64,169,255,.15); }   /* 基础数据 —— 天蓝 */
.menu-group-title.g2 { color: #4fd8cf; background: rgba(54,207,201,.14); }   /* 学生业务 —— 青蓝 */
.menu-group-title.g3 { color: #93b0ff; background: rgba(122,156,255,.16); }  /* 统计与系统 —— 靛蓝 */

/* 菜单项 */
.menu-item { margin: 3px 10px; padding: 11px 13px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; gap: 10px; font-size: 14px; color: #b6c9de;
    transition: background .18s, color .18s, box-shadow .18s; }
.menu-item:hover { background: rgba(64,169,255,.14); color: #fff; }
.menu-item.active { color: #fff; font-weight: 600;
    background: linear-gradient(90deg, #1677ff 0%, #2a86ff 55%, #40a9ff 100%);
    box-shadow: 0 4px 14px rgba(24,144,255,.38); }
.menu-icon { width: 18px; text-align: center; font-size: 15px; flex: none; }

.header { position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--header-h);
    background: #fff; display: flex; align-items: center;
    justify-content: space-between; padding: 0 24px; z-index: 99;
    box-shadow: 0 1px 4px rgba(0,0,0,.08), inset 0 -2px 0 rgba(24,144,255,.18); }
.header .title { font-size: 18px; font-weight: 500; color: #0d2b4e; }
.header-right { display: flex; align-items: center; gap: 16px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, #1677ff, #40a9ff);
    display: flex; align-items: center; justify-content: center; font-weight: bold; }
.main { margin-left: var(--sidebar-w); margin-top: var(--header-h); padding: 22px; min-height: calc(100vh - var(--header-h)); }

.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.page-title { font-size: 22px; margin-bottom: 18px; font-weight: 500; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border-left: 4px solid var(--primary); }
.stat-title { color: var(--text2); font-size: 13px; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card.green { border-left-color: var(--success); } .stat-card.green .stat-value { color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); } .stat-card.orange .stat-value { color: var(--warning); }
.stat-card.purple { border-left-color: #722ed1; } .stat-card.purple .stat-value { color: #722ed1; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.data-table th { background: #fafafa; font-weight: 600; color: var(--text2); }
.data-table tbody tr:hover { background: #fafafa; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-success { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.tag-error { background: #fff2f0; color: var(--error); border: 1px solid #ffccc7; }
.tag-default { background: #f0f0f0; color: #666; border: 1px solid #d9d9d9; }
.tag-blue { background: #e6f7ff; color: var(--primary); border: 1px solid #91d5ff; }

.search-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-form .form-control { width: auto; min-width: 160px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.pagination { display: flex; gap: 6px; margin-top: 14px; align-items: center; }
.page-btn { padding: 5px 11px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; font-size: 13px; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: none;
    justify-content: center; align-items: flex-start; padding-top: 60px; overflow-y: auto; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 640px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal-header { padding: 16px 22px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; }
.modal-header .close { cursor: pointer; color: #999; font-size: 20px; line-height: 1; }
.modal-body { padding: 22px; max-height: 65vh; overflow-y: auto; }
.modal-footer { padding: 14px 22px; border-top: 1px solid #f0f0f0; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-group .hint { font-size: 11px; color: #999; margin-top: 3px; }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #333; color: #fff;
    padding: 10px 20px; border-radius: 6px; z-index: 300; opacity: 0; transition: opacity .3s; font-size: 14px; }
.toast.show { opacity: .95; }
.toast.error { background: var(--error); } .toast.success { background: var(--success); }

.empty { text-align: center; color: #999; padding: 40px; }
.section { display: none; }
.section.active { display: block; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bar-track { flex: 1; height: 16px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); }
.muted { color: #999; font-size: 12px; }
.dict-select { margin-bottom: 14px; max-width: 280px; }

/* 登录页错误提示 */
.login-err { display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 5px;
    background: #fff2f0; border: 1px solid #ffccc7; color: var(--error); font-size: 13px; line-height: 1.6; }
.login-err.show { display: block; }

/* 工作台公告栏：固定位置 + 限定高度 + 自动向上滚动 + 超长内容截断 */
.notice-viewport { max-height: 300px; overflow: hidden; }
.notice-track.scrolling { animation: noticeScrollUp linear infinite; }
.notice-viewport:hover .notice-track.scrolling { animation-play-state: paused; }
@keyframes noticeScrollUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .notice-track.scrolling { animation: none; } }
.notice-item { padding: 12px 0; cursor: pointer; }
.notice-item + .notice-item { border-top: 1px dashed var(--border); }
.notice-item:hover .notice-title { color: var(--primary); }
.notice-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-title { font-size: 15px; font-weight: 600; color: #303133; transition: color .2s; }
.notice-meta { font-size: 12px; color: #999; margin: 6px 0 8px; }
.notice-body { font-size: 13px; color: #555; line-height: 1.8; white-space: pre-wrap;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.notice-more { font-size: 12px; color: var(--primary); margin-top: 4px; }
/* 公告全文（弹窗内） */
.notice-detail-body { font-size: 13.5px; color: #444; line-height: 1.9; white-space: pre-wrap;
  max-height: 56vh; overflow-y: auto; }

/* （2026-09-23「配用户」功能下线，原 .user-pick 样式已删） */

/* ============ 在线客服 ============ */
.chat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.chat-title { font-size: 15px; font-weight: 700; color: #0d2b4e; }
.chat-sub { font-size: 12px; font-weight: 400; color: #999; margin-left: 4px; }
.chat-body { height: 440px; overflow-y: auto; padding: 6px 2px; background: #f7f9fc;
  border-radius: 8px; border: 1px solid #eef2f7; }
.chat-empty { text-align: center; color: #9aa7b5; font-size: 13px; padding: 60px 10px; }
.chat-row { display: flex; margin: 10px 12px; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: 72%; padding: 9px 12px; border-radius: 10px; background: #fff;
  border: 1px solid #e8eef5; box-shadow: 0 1px 3px rgba(16,42,74,.05); }
.chat-row.mine .chat-bubble { background: linear-gradient(135deg, #e6f2ff, #d6e9ff);
  border-color: #c3ddff; }
.chat-meta { font-size: 11px; color: #9aa7b5; margin-bottom: 4px; }
.chat-text { font-size: 13.5px; color: #24405f; line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.chat-input textarea { resize: vertical; min-height: 56px; font-family: inherit; }
.chat-input .btn { flex: 0 0 auto; }

/* 客服端：左侧会话列表 + 右侧对话 */
.chat-admin { display: grid; grid-template-columns: 288px 1fr; gap: 14px; align-items: start; }
.chat-main { display: flex; flex-direction: column; }
.chat-side-head { font-size: 13px; font-weight: 700; color: #0d2b4e; padding: 0 6px 10px; }
.chat-pending { color: var(--error); font-weight: 600; }
.chat-session-list { max-height: 470px; overflow-y: auto; }
.chat-session { padding: 9px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent; transition: background .15s, border-color .15s; }
.chat-session:hover { background: #f5f8fc; }
.chat-session.active { background: #eaf4ff; border-color: #c3ddff; }
.cs-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cs-name { font-size: 13.5px; font-weight: 600; color: #24405f; }
.cs-badge { background: var(--error); color: #fff; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 9px; }
.cs-ksh { font-size: 11.5px; color: #8a97a6; margin-top: 2px; }
.cs-last { font-size: 12.5px; color: #66788a; margin-top: 3px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cs-time { font-size: 11px; color: #a8b3bf; margin-top: 2px; }
@media (max-width: 900px) { .chat-admin { grid-template-columns: 1fr; } }

/* 侧栏菜单未读角标 */
.menu-item { position: relative; }
.menu-badge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: var(--error); color: #fff; font-size: 11px; line-height: 1; padding: 3px 6px;
  border-radius: 9px; font-weight: 600; }

/* 字典维护：按分组展示字典按钮 */
.dict-group { margin-bottom: 12px; }
.dict-group:last-child { margin-bottom: 0; }
.dict-group-title { font-size: 12px; font-weight: 700; color: #5a6b82;
  letter-spacing: .5px; margin-bottom: 6px; padding-left: 8px; border-left: 3px solid #bcd6f5; }
.dict-group-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* 登录页 LOGO（与侧栏同一个地址，由「基础信息管理」配置） */
.login-logo-wrap { text-align: center; margin-bottom: 14px; }
.login-logo-wrap img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px;
    background: #fff; padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* ============ 预设主题：基础信息管理 → 颜色风格（blue / green / purple / orange） ============
   原有样式以蓝色为基准；下方通过 html[data-theme] 覆盖变量 + 少数硬编码蓝色块，
   选择器带 html[data-theme] 前缀，优先级高于原规则，故无需改动基线样式。 */
/* 注意：这里用 html:not([data-theme]) 而不是 :root。
   若写成「:root, html[data-theme=blue]」，当 data-theme=green 时 :root 仍会参与
   变量竞争，虽然优先级较低，但个别浏览器/扩展下容易让蓝色变量残留 —— 主题看着「没生效」。*/
html:not([data-theme]), html[data-theme="blue"] {
    --primary: #1890ff; --primary-hover: #40a9ff;
    --side-bg: linear-gradient(180deg, #0a1e38 0%, #0b2545 55%, #0d2c53 100%);
    --side-border: rgba(64,169,255,.22); --scroll-thumb: rgba(64,169,255,.3);
    --logo-bg: linear-gradient(180deg, rgba(24,144,255,.2), rgba(24,144,255,0));
    --logo-bar: linear-gradient(90deg, #1677ff, #40a9ff); --accent: #6fc0ff;
    --menu-hover: rgba(64,169,255,.14);
    --menu-active: linear-gradient(90deg, #1677ff 0%, #2a86ff 55%, #40a9ff 100%);
    --menu-shadow: rgba(24,144,255,.38); --avatar-bg: linear-gradient(135deg, #1677ff, #40a9ff);
    --login-bg: linear-gradient(135deg, #1d3b6e 0%, #2f6fb0 100%);
    --header-line: rgba(24,144,255,.18); --focus-ring: rgba(24,144,255,.12);
    --tag-bg: #e6f7ff; --tag-border: #91d5ff;
    --chat-mine: linear-gradient(135deg, #e6f2ff, #d6e9ff); --chat-mine-border: #c3ddff;
    --dict-bar: #bcd6f5;
}
html[data-theme="green"] {
    --primary: #13a463; --primary-hover: #45c98b;
    --side-bg: linear-gradient(180deg, #07271c 0%, #0a3527 55%, #0d4231 100%);
    --side-border: rgba(69,201,139,.22); --scroll-thumb: rgba(69,201,139,.3);
    --logo-bg: linear-gradient(180deg, rgba(19,164,99,.22), rgba(19,164,99,0));
    --logo-bar: linear-gradient(90deg, #0e8a55, #3cc384); --accent: #6fe0b0;
    --menu-hover: rgba(69,201,139,.15);
    --menu-active: linear-gradient(90deg, #0e8a55 0%, #17a86b 55%, #3cc384 100%);
    --menu-shadow: rgba(19,164,99,.38); --avatar-bg: linear-gradient(135deg, #0e8a55, #3cc384);
    --login-bg: linear-gradient(135deg, #0d4a35 0%, #1a8a5f 100%);
    --header-line: rgba(19,164,99,.18); --focus-ring: rgba(19,164,99,.12);
    --tag-bg: #e9fbf1; --tag-border: #a3e6c4;
    --chat-mine: linear-gradient(135deg, #e6f8ef, #d2f1e0); --chat-mine-border: #b9e7cf;
    --dict-bar: #a8ddc0;
}
html[data-theme="purple"] {
    --primary: #7c55d6; --primary-hover: #a17ff0;
    --side-bg: linear-gradient(180deg, #1d1235 0%, #2a1a4a 55%, #36205c 100%);
    --side-border: rgba(161,127,240,.22); --scroll-thumb: rgba(161,127,240,.3);
    --logo-bg: linear-gradient(180deg, rgba(124,85,214,.24), rgba(124,85,214,0));
    --logo-bar: linear-gradient(90deg, #6b3fd4, #a17ff0); --accent: #c0a6ff;
    --menu-hover: rgba(161,127,240,.16);
    --menu-active: linear-gradient(90deg, #6b3fd4 0%, #8963df 55%, #a17ff0 100%);
    --menu-shadow: rgba(124,85,214,.38); --avatar-bg: linear-gradient(135deg, #6b3fd4, #a17ff0);
    --login-bg: linear-gradient(135deg, #3b2568 0%, #7c55d6 100%);
    --header-line: rgba(124,85,214,.18); --focus-ring: rgba(124,85,214,.12);
    --tag-bg: #f3edff; --tag-border: #d3bcff;
    --chat-mine: linear-gradient(135deg, #f2ebff, #e4d7ff); --chat-mine-border: #d3bcff;
    --dict-bar: #cdb8f2;
}
html[data-theme="orange"] {
    --primary: #e8792b; --primary-hover: #f5a45c;
    --side-bg: linear-gradient(180deg, #33190a 0%, #4a240e 55%, #5c2d12 100%);
    --side-border: rgba(245,164,92,.24); --scroll-thumb: rgba(245,164,92,.32);
    --logo-bg: linear-gradient(180deg, rgba(232,121,43,.24), rgba(232,121,43,0));
    --logo-bar: linear-gradient(90deg, #d9631a, #f5a45c); --accent: #ffc48f;
    --menu-hover: rgba(245,164,92,.16);
    --menu-active: linear-gradient(90deg, #d9631a 0%, #e8792b 55%, #f5a45c 100%);
    --menu-shadow: rgba(232,121,43,.38); --avatar-bg: linear-gradient(135deg, #d9631a, #f5a45c);
    --login-bg: linear-gradient(135deg, #7a3510 0%, #e8792b 100%);
    --header-line: rgba(232,121,43,.18); --focus-ring: rgba(232,121,43,.12);
    --tag-bg: #fff3e8; --tag-border: #ffd2a8;
    --chat-mine: linear-gradient(135deg, #fff1e4, #ffe3c9); --chat-mine-border: #ffd2a8;
    --dict-bar: #f2c9a4;
}
/* 基线里写死蓝色的块，改读变量；仅当设置了 data-theme 时生效（applyBasicInfo 总会设置） */
html[data-theme] .login-wrap { background: var(--login-bg); }
html[data-theme] .form-control:focus { box-shadow: 0 0 0 3px var(--focus-ring); }
html[data-theme] .sidebar { background: var(--side-bg); }
html[data-theme] .sidebar::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
html[data-theme] .logo { background: var(--logo-bg); border-bottom-color: var(--side-border); }
html[data-theme] .logo::after { background: var(--logo-bar); }
html[data-theme] .logo-sub { color: var(--accent); }
html[data-theme] .menu-group-title.g1 { color: var(--accent); }
html[data-theme] .menu-item:hover { background: var(--menu-hover); }
html[data-theme] .menu-item.active { background: var(--menu-active); box-shadow: 0 4px 14px var(--menu-shadow); }
html[data-theme] .avatar { background: var(--avatar-bg); }
html[data-theme] .header { box-shadow: 0 1px 4px rgba(0,0,0,.08), inset 0 -2px 0 var(--header-line); }
html[data-theme] .tag-blue { background: var(--tag-bg); border-color: var(--tag-border); }
html[data-theme] .chat-row.mine .chat-bubble { background: var(--chat-mine); border-color: var(--chat-mine-border); }
html[data-theme] .chat-session.active { background: var(--tag-bg); border-color: var(--chat-mine-border); }
html[data-theme] .dict-group-title { border-left-color: var(--dict-bar); }

/* 分组标题、侧栏文字、页头标题也随主题换色，切换时整页变化一目了然 */
html[data-theme="blue"] {
    --g1:#6fc0ff; --g1-bg:rgba(64,169,255,.15);
    --g2:#4fd8cf; --g2-bg:rgba(54,207,201,.14);
    --g3:#93b0ff; --g3-bg:rgba(122,156,255,.16);
    --side-text:#b6c9de; --title-color:#0d2b4e;
}
html[data-theme="green"] {
    --g1:#6fe0b0; --g1-bg:rgba(69,201,139,.16);
    --g2:#7fe3d0; --g2-bg:rgba(61,204,180,.14);
    --g3:#a9e8c0; --g3-bg:rgba(120,214,165,.15);
    --side-text:#b3d8c6; --title-color:#0b3a28;
}
html[data-theme="purple"] {
    --g1:#c0a6ff; --g1-bg:rgba(161,127,240,.17);
    --g2:#d5b8ff; --g2-bg:rgba(180,140,250,.14);
    --g3:#b3a0ff; --g3-bg:rgba(150,120,240,.16);
    --side-text:#c8b9e8; --title-color:#2d1b52;
}
html[data-theme="orange"] {
    --g1:#ffc48f; --g1-bg:rgba(245,164,92,.18);
    --g2:#ffd9a8; --g2-bg:rgba(250,190,120,.15);
    --g3:#ffb9a0; --g3-bg:rgba(240,140,110,.15);
    --side-text:#e8c9ae; --title-color:#4a240e;
}
html[data-theme] .menu-group-title.g1 { color: var(--g1); background: var(--g1-bg); }
html[data-theme] .menu-group-title.g2 { color: var(--g2); background: var(--g2-bg); }
html[data-theme] .menu-group-title.g3 { color: var(--g3); background: var(--g3-bg); }
html[data-theme] .menu-item { color: var(--side-text); }
html[data-theme] .header .title { color: var(--title-color); }
html[data-theme] .chat-title, html[data-theme] .chat-side-head,
html[data-theme] .cs-name, html[data-theme] .chat-text { color: var(--title-color); }

/* 基础信息管理：LOGO 上传 + 主题色块 */
.basic-logo-row { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px;
    padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.basic-logo-preview { flex: none; width: 96px; height: 96px; border: 1px dashed var(--border);
    border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; }
.basic-logo-preview img { max-width: 88px; max-height: 88px; object-fit: contain; border-radius: 6px; }
.basic-logo-ops { flex: 1; min-width: 0; }
.basic-logo-ops > label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 13px; }
.basic-logo-ops .muted { margin-top: 7px; font-size: 12px; line-height: 1.6; word-break: break-all; }
.basic-logo-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.basic-logo-btns input[type="file"] { font-size: 13px; max-width: 260px; }
.theme-swatches { margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.theme-swatches .muted { margin-left: 8px; }
.theme-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: transform .15s, box-shadow .15s; }
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.picked { border-color: #fff; box-shadow: 0 0 0 2px var(--primary), 0 1px 3px rgba(0,0,0,.2); }

/* LOGO 裁切弹窗 */
.crop-wrap { text-align: center; }
.crop-wrap canvas { display: block; width: 460px; max-width: 100%; height: auto; margin: 0 auto;
    border-radius: 6px; background: #1e2430; cursor: move; touch-action: none; }
.crop-ops { display: flex; gap: 18px; align-items: flex-end; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.crop-field label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; text-align: left; }
.crop-field select { width: 150px; }
.crop-field input[type="range"] { width: 220px; accent-color: var(--primary); }
.crop-wrap .muted { margin-top: 10px; font-size: 12px; text-align: left; line-height: 1.7; }

/* 操作日志：内容超长截断（悬浮看全文）+ 分页条 */
.log-detail { max-width: 320px; word-break: break-all; color: #475569; }
.log-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.log-pager .muted { margin-right: auto; }
.log-pager button[disabled] { opacity: .45; cursor: not-allowed; }
#logTable .data-table td { vertical-align: top; }
