/* 白墨渊QQ群管理机器人 - 白色蓝白风桌面主题（电脑版） */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-width: 1100px; }

/* ============ 主题变量 ============ */
:root {
    --c-bg1: #f6f8fc;
    --c-bg2: #eef2f9;
    --c-sidebar: rgba(255, 255, 255, 0.88);
    --c-border: rgba(30, 64, 175, 0.08);
    --c-accent: #2563eb;
    --c-accent2: #4f46e5;
    --c-text: #1f2937;
    --c-text-soft: #4b5563;
    --c-muted: #6b7280;
    --c-card: rgba(255, 255, 255, 0.94);
    --c-hover: rgba(37, 99, 235, 0.07);
    --c-nav-active-grad: linear-gradient(135deg, #2563eb, #4f46e5);
    --c-nav-active-shadow: rgba(37, 99, 235, 0.28);
    --c-btn-grad: linear-gradient(135deg, #2563eb, #4f46e5);
    --c-btn-shadow: rgba(37, 99, 235, 0.22);
    --c-row-border: #eef0f6;
}

/* 主题：越蓝 */
body[data-theme="blue"] {
    --c-bg1: #eaf2ff;
    --c-bg2: #e0eaff;
    --c-sidebar: rgba(255, 255, 255, 0.92);
    --c-accent: #3b82f6;
    --c-accent2: #7c3aed;
    --c-hover: rgba(59, 130, 246, 0.08);
    --c-nav-active-grad: linear-gradient(135deg, #3b82f6, #7c3aed);
    --c-nav-active-shadow: rgba(59, 130, 246, 0.30);
    --c-btn-grad: linear-gradient(135deg, #3b82f6, #7c3aed);
    --c-btn-shadow: rgba(59, 130, 246, 0.26);
}

/* 主题：霓虹 */
body[data-theme="neon"] {
    --c-bg1: #f5f7ff;
    --c-bg2: #ecefff;
    --c-sidebar: rgba(255, 255, 255, 0.92);
    --c-accent: #8b5cf6;
    --c-accent2: #ec4899;
    --c-hover: rgba(139, 92, 246, 0.08);
    --c-nav-active-grad: linear-gradient(135deg, #8b5cf6, #ec4899);
    --c-nav-active-shadow: rgba(139, 92, 246, 0.28);
    --c-btn-grad: linear-gradient(135deg, #8b5cf6, #ec4899);
    --c-btn-shadow: rgba(139, 92, 246, 0.24);
}

body {
    background: linear-gradient(180deg, var(--c-bg1) 0%, var(--c-bg2) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--c-text);
    min-height: 100vh;
    font-size: 14px;
}

/* ============ 侧边栏（白色半透明 + 可折叠） ============ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 264px;
    height: 100vh;
    background: var(--c-sidebar);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: visible;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 420px at 10% -10%, rgba(59, 130, 246, 0.10), transparent 60%),
        radial-gradient(700px 380px at 110% 110%, rgba(129, 140, 248, 0.08), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.sidebar-brand {
    padding: 22px 22px 14px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--c-btn-grad);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
    box-shadow: 0 6px 16px var(--c-btn-shadow);
    overflow: hidden;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.brand-text { min-width: 0; }

.brand-sub {
    font-size: 12px;
    color: var(--c-muted);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 折叠按钮 */
.collapse-btn {
    margin-left: auto;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    background: var(--c-hover);
    color: var(--c-text-soft);
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.collapse-btn:hover { background: var(--c-hover); color: var(--c-accent); }

.sidebar-nav {
    flex: 1;
    padding: 12px 12px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }

/* 分区标题（半透明小字） */
.nav-section {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--c-muted);
    opacity: 0.8;
    padding: 18px 10px 8px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--c-text-soft);
    text-decoration: none;
    border-radius: 13px;
    margin-bottom: 4px;
    transition: all 0.18s ease;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
}
.nav-item:hover { background: var(--c-hover); color: var(--c-accent); }
.nav-item.active {
    background: var(--c-nav-active-grad);
    color: #ffffff;
    box-shadow: 0 6px 14px var(--c-nav-active-shadow);
}

/* 导航项告警红点（插件安全中心亮起）：扫描命中并封锁插件后显示 */
.nav-alert {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
    animation: nav-alert-pulse 2s ease-in-out infinite;
}
@keyframes nav-alert-pulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35); }
    50% { box-shadow: 0 2px 10px rgba(220, 38, 38, 0.7); }
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer {
    padding: 14px 14px 20px;
    border-top: 1px solid var(--c-border);
}
.user-info { padding: 0 6px 10px; }
.username { font-size: 13px; font-weight: 600; color: var(--c-text); }

/* 主题设置小工具 */
.theme-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--c-hover);
    margin-bottom: 8px;
}
.theme-tools span { font-size: 12px; color: var(--c-muted); }
.theme-pills { display: flex; gap: 6px; }
.theme-pill {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.theme-pill.active { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.theme-pill.light { background: linear-gradient(135deg, #ffffff, #dde5ff); border-color: #e5e7eb; }
.theme-pill.blue { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.theme-pill.neon { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.logout-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    text-decoration: none;
    border-radius: 11px;
    font-size: 13px;
    text-align: center;
    transition: all 0.25s ease;
    font-weight: 500;
}
.logout-btn:hover { background: rgba(239, 68, 68, 0.12); }

/* 折叠状态：只剩图标 */
body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .theme-tools span,
body.sidebar-collapsed .theme-pills,
body.sidebar-collapsed .logout-btn { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; }
body.sidebar-collapsed .collapse-btn { margin-left: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 13px; }
body.sidebar-collapsed .nav-section { display: none; }
body.sidebar-collapsed .sidebar-footer { padding: 10px 8px 16px; }
body.sidebar-collapsed .sidebar-backdrop { left: 76px; }

/* 插件导航图标 */
.plugin-nav-img { width: 20px; height: 20px; border-radius: 6px; object-fit: contain; }
.plugin-nav-glyph {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; font-size: 12px; font-weight: 700;
    border-radius: 6px; background: var(--c-hover); color: var(--c-accent);
}
body.sidebar-collapsed .plugin-nav-img, body.sidebar-collapsed .plugin-nav-glyph { transform: scale(1.1); }

/* 插件市场列表图标 */
.plugin-list-ico { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; flex-shrink: 0; }
.plugin-list-ico-txt {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; font-size: 15px; font-weight: 700; border-radius: 9px;
    background: var(--c-hover); color: var(--c-accent); flex-shrink: 0;
}
.link-tag { text-decoration: none; cursor: pointer; }

/* 版本徽标 */
.version-badge {
    display: inline-block; padding: 4px 12px; border-radius: 8px;
    font-family: ui-monospace, monospace; font-weight: 700; font-size: 15px;
    background: var(--c-hover); color: var(--c-text-soft);
}
.version-badge.latest {
    background: radial-gradient(circle at top, rgba(41,117,255,.14), transparent 70%), var(--c-hover);
    color: var(--c-accent); box-shadow: inset 0 0 0 1px rgba(41,117,255,.28);
}

/* ============ 主内容区 ============ */
.main-content {
    margin-left: 264px;
    min-height: 100vh;
    padding: 34px 40px 60px;
    position: relative;
    z-index: 1;
    transition: margin-left 0.25s ease;
}
body.sidebar-collapsed .main-content { margin-left: 76px; }

/* ============ 全宽布局（无侧边栏页面：settings/设备与设置等） ============ */
body.fullwidth-layout { min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--c-border);
}
.topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--c-hover);
    transition: background 0.2s ease;
}
.topbar-back:hover { background: rgba(37, 99, 235, 0.14); }
.topbar-back svg { width: 16px; height: 16px; }
.topbar-title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.topbar-actions .theme-tools { display: flex; align-items: center; gap: 8px; }
.topbar-actions .theme-tools span { font-size: 12px; color: var(--c-muted); }
.topbar-user { font-size: 13px; color: var(--c-text-soft); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-logout {
    font-size: 13px;
    color: #dc2626;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.topbar-logout:hover { background: rgba(220, 38, 38, 0.08); }
.fullwidth-main {
    margin-left: 0;
    min-height: 100vh;
    padding: 34px 40px 60px;
    position: relative;
    z-index: 1;
}

.content-wrapper { max-width: 1280px; margin: 0 auto; }

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 24px;
}

/* 液态玻璃卡片（白色） */
.glass-card {
    background: var(--c-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    border: 1px solid var(--c-border);
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}
/* 卡片内的群选择器容器需脱离卡片背景滤镜层级，避免被后续卡片遮挡 */
.group-select {
    position: relative;
    z-index: 60;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 11px 22px;
    background: var(--c-btn-grad);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
    box-shadow: 0 5px 14px var(--c-btn-shadow);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px var(--c-btn-shadow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: var(--c-btn-grad); color: #fff; }
.btn-outline {
    background: #ffffff;
    color: var(--c-text);
    border: 1px solid #d7dce8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.btn-outline:hover { border-color: var(--c-accent); color: var(--c-accent); box-shadow: 0 3px 10px var(--c-btn-shadow); }
.btn-secondary { background: var(--c-hover); color: var(--c-accent); border: none; box-shadow: none; }
.btn-secondary:hover { background: var(--c-hover); box-shadow: none; opacity: 0.9; }
.btn-danger {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.35);
    box-shadow: none;
}
.btn-danger:hover { background: #fef2f2; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

/* 表格 */
.table-container { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th, table.data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--c-row-border);
}
table.data-table th {
    background: var(--c-hover);
    font-weight: 600;
    color: var(--c-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
table.data-table td { color: var(--c-text); vertical-align: middle; }
table.data-table tr:hover td { background: var(--c-hover); }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; color: var(--c-muted); margin-bottom: 8px; font-weight: 500; }
.form-input, .form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d9deeb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--c-text);
}
.form-input:focus, .form-select:focus { border-color: var(--c-accent); box-shadow: 0 0 0 4px var(--c-hover); }
.form-input::placeholder { color: #9ca3af; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ============ 可视化群选择器 ============ */
.group-select { position: relative; width: 100%; }
.group-select-trigger {
    width: 100%;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #d9deeb;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
}
.group-select-trigger:hover { border-color: var(--c-accent); box-shadow: 0 0 0 4px var(--c-hover); }
.group-select-box { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.group-select-caret { color: #9ca3af; font-size: 12px; padding-right: 4px; }
.group-avatar {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    object-fit: cover; background: #eef2f9;
}
.group-name { font-size: 14px; color: var(--c-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-name.muted { color: #9ca3af; font-weight: 400; }
.group-id { font-size: 11px; color: var(--c-muted); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-select-dropdown {
    /* 展开时由 JS 钉到 body 并填 top/left/width；fixed 脱离卡片 backdrop-filter 堆叠上下文 */
    position: fixed; top: auto; left: auto; right: auto; bottom: auto; z-index: 100000;
    background: #ffffff; border: 1px solid #d9deeb; border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 64, 175, 0.12);
    max-height: 340px; display: flex; flex-direction: column;
}
.group-select-search-row { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--c-row-border); }
.group-select-search-row .group-select-search { flex: 1; }
.group-select-search-row .btn-sm { white-space: nowrap; }
.group-select-list { overflow-y: auto; padding: 6px; }
.group-select-list:empty { padding: 0; }
.group-select-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px; cursor: pointer;
    transition: background 0.15s ease;
}
.group-select-opt:hover, .group-select-opt.sel { background: var(--c-hover); }
.group-select-opt .group-opt-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.group-select-note { padding: 4px 10px 6px; font-size: 11px; color: var(--c-muted); }
.group-rank {
    flex: none; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; color: var(--c-muted); background: #eef2f9;
}
.group-rank.top { color: #fff; background: var(--c-accent, #3b82f6); }
.group-activity { flex: none; font-size: 11px; color: var(--c-muted); white-space: nowrap; }
.group-activity.top { color: var(--c-accent, #3b82f6); font-weight: 600; }
.group-count { flex: none; font-size: 11px; color: var(--c-muted); }
.group-select-empty { padding: 20px; text-align: center; color: var(--c-muted); font-size: 13px; }

/* 复选框 */
.checkbox-group { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.checkbox-input { width: 18px; height: 18px; accent-color: var(--c-accent); cursor: pointer; }
.checkbox-label { font-size: 14px; color: var(--c-text); }

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status-tag.success { background: #ecfdf5; color: #059669; }
.status-tag.error { background: #fef2f2; color: #dc2626; }
.status-tag.warning { background: #fffbeb; color: #d97706; }
.status-tag.info { background: #eff6ff; color: #2563eb; }
.status-tag.dark { background: #f3f4f6; color: #374151; }

/* 状态圆点（替代 emoji 勾叉） */
.status-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: none;
}
.status-dot.ok { background: #059669; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.18); }
.status-dot.err { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18); }
.status-dot.warn { background: #d97706; box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18); }
.status-dot.green { background: #059669; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.18); }
.status-dot.orange { background: #d97706; box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18); }
.status-dot.gray { background: #9ca3af; box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.15); }

/* 提示 */
.tip {
    font-size: 13px;
    color: var(--c-muted);
    margin-top: 10px;
    padding: 13px 15px;
    background: #f8fafc;
    border: 1px solid var(--c-row-border);
    border-radius: 11px;
    line-height: 1.7;
}

/* 警告消息（白色圆润饱满黑字，适配舒适主题） */
.alert { padding: 16px 20px; border-radius: 16px; margin-bottom: 22px; font-size: 14px; font-weight: 500; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06); }
.alert-ok { background: #ffffff; border: 1px solid rgba(5, 150, 105, 0.28); color: var(--c-text); }
.alert-err { background: #ffffff; border: 1px solid rgba(220, 38, 38, 0.28); color: var(--c-text); }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--c-card);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    border: 1px solid var(--c-border);
    padding: 20px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--c-btn-shadow); }
.stat-number { font-size: 30px; font-weight: 800; color: var(--c-text); margin-bottom: 6px; }
.stat-label { font-size: 13px; color: var(--c-muted); font-weight: 500; }

/* 登录 */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { max-width: 480px; margin: 0 auto; padding: 42px; }
.login-card h2 { text-align: center; margin-bottom: 30px; font-size: 24px; font-weight: 700; color: var(--c-text); }

/* ============ 横向滚动功能入口（总览页） ============ */
.hscroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe #eef0f6;
}
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-track { background: #eef0f6; border-radius: 3px; }
.hscroll::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }

.func-card {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--c-text);
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.func-card:hover { transform: translateY(-3px); border-color: rgba(37, 99, 235, 0.35); box-shadow: 0 10px 26px var(--c-btn-shadow); color: var(--c-accent); }
.func-card .func-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-hover);
    color: var(--c-accent);
}
.func-card .func-label { font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ============ 长文本包裹（全站） ============ */
.glass-card, .panel, .table-container, .tip, .alert, .stat-card {
    overflow-wrap: break-word;
    word-break: break-word;
}
table.data-table td, table td {
    max-width: 320px;
    overflow-wrap: anywhere;
    word-break: break-all;
}
.auto-fit-text, .status-tag, .badge, .chip, .label-pill, .card-title {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}
.sidebar .nav-label, .sidebar .nav-section, .sidebar .brand-sub { max-width: 100%; }

/* ============ 弹窗（全局基准，覆盖侧边栏 z-index=100） ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 300;
    overflow-y: auto;
    padding: 30px 20px;
}
.modal-box {
    background: #fff;
}

/* ============ 插件卡片（统一网格尺寸） ============ */
.pl-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pl-card:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent);
    box-shadow: 0 10px 28px var(--c-btn-shadow);
}
.pl-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-card-ico, .pl-card-ico-txt {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--c-hover);
    color: var(--c-accent);
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.pl-card-ico { object-fit: cover; }
.pl-card-name { min-width: 0; flex: 1; }
.pl-card-name b { font-size: 15px; color: var(--c-text); display: block; overflow-wrap: anywhere; }
.pl-card-sub { font-size: 11.5px; color: var(--c-muted); margin-top: 2px; overflow-wrap: anywhere; }
.pl-card-desc {
    font-size: 12.5px;
    color: var(--c-text-soft);
    line-height: 1.55;
    min-height: 38px;
    max-height: 58px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}
.pl-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pl-card-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.pl-card-actions .btn { flex: 1; }
.pl-card-actions .status-tag { flex: 1; text-align: center; }

/* ============ Toast 提示 ============ */
.toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 13.5px;
    color: var(--c-text);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    min-width: 240px;
    max-width: 360px;
    animation: toastIn 0.25s ease;
}
.toast.success { border-color: rgba(5, 150, 105, 0.35); }
.toast.error { border-color: rgba(220, 38, 38, 0.35); }
.toast.warning { border-color: rgba(217, 119, 6, 0.35); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ 确认弹窗 ============ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-box {
    background: #fff;
    border-radius: 18px;
    padding: 26px 26px 22px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    animation: toastIn 0.22s ease;
}
.confirm-box h3 { font-size: 17px; color: var(--c-text); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.confirm-box h3 .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--c-hover); color: var(--c-accent); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.confirm-box p { font-size: 13px; color: var(--c-text-soft); line-height: 1.7; margin-bottom: 20px; overflow-wrap: anywhere; }
.confirm-box .cf-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-box .btn { flex: 0 0 auto; min-width: 92px; }

/* ============ 大点击式上传区（Dropzone） ============ */
.dropzone {
    border: 2px dashed var(--c-border-strong, #c7d2fe);
    border-radius: 14px;
    background: var(--c-hover, rgba(37, 99, 235, 0.04));
    padding: 34px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    user-select: none;
}
.dropzone:hover {
    border-color: var(--c-accent);
    background: rgba(37, 99, 235, 0.06);
}
.dropzone.drag {
    border-color: var(--c-accent);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.01);
}
.dropzone.uploading { pointer-events: none; opacity: 0.75; }
.dropzone .dz-icon { color: var(--c-accent); margin-bottom: 12px; }
.dropzone .dz-hint { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.dropzone .dz-sub { font-size: 12px; color: var(--c-muted); }

/* ============ 开关 ============ */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d8e6;
    border-radius: 26px;
    transition: 0.25s;
}
.slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--c-accent); }
.switch input:checked + .slider:before { transform: translateX(22px); }
/* ============ 插件参数与调试页 ============ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-desc {
    font-size: 13px;
    color: var(--c-muted);
    margin: 4px 0 0;
    line-height: 1.7;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--c-text);
}
.card-desc {
    font-size: 13px;
    color: var(--c-muted);
    margin: 0;
    line-height: 1.7;
}
.form-help {
    font-size: 12px;
    color: var(--c-muted);
    margin-top: 6px;
    line-height: 1.6;
}
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--c-hover);
    color: var(--c-muted);
}
.badge-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

/* ============ 账号专区 ============ */
.acct-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 20px;
    align-items: stretch;
}
.acct-grid > .glass-card { margin-bottom: 22px; }
.acct-card { padding: 24px; }
.acct-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acct-head-ico {
    width: 42px; height: 42px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-hover); color: var(--c-accent);
}
.acct-head-ico svg { width: 21px; height: 21px; }
.acct-title { font-size: 15.5px; font-weight: 700; color: var(--c-text); }
.acct-sub { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.acct-pill {
    margin-left: auto; padding: 4px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.acct-pill.ok { background: rgba(34, 197, 94, .12); color: #15803d; }
.acct-pill.warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.acct-pill.bad { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.acct-rows { margin-top: 18px; display: flex; flex-direction: column; }
.acct-row {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 11px 0; border-bottom: 1px dashed var(--c-row-border);
    font-size: 13px;
}
.acct-row:last-child { border-bottom: none; }
.acct-row span { color: var(--c-muted); flex: none; }
.acct-row b { color: var(--c-text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.acct-ok { color: #15803d; }
.acct-warn { color: #b45309; }
.acct-bad { color: #b91c1c; }

.acct-side {
    background: linear-gradient(160deg, #ffffff 0%, #f2f7ff 62%, #eef4ff 100%);
    border-color: rgba(37, 99, 235, .16);
}
.acct-side-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.acct-side-ico {
    width: 42px; height: 42px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-btn-grad); color: #fff;
    box-shadow: 0 8px 20px var(--c-btn-shadow);
}
.acct-side-ico svg { width: 20px; height: 20px; }
.acct-label { display: block; font-size: 11.5px; color: var(--c-muted); margin: 14px 0 6px; }
.acct-lock { position: relative; }
.acct-lock .form-input {
    padding-right: 40px; background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .3px;
}
.acct-lock-ico {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--c-muted); display: flex;
}
.acct-lock-ico svg { width: 16px; height: 16px; }
.acct-side-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.acct-side-actions .btn { flex: 1; min-width: 120px; }
.acct-hint { font-size: 11.5px; color: var(--c-muted); line-height: 1.7; margin-top: 12px; }
.acct-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.acct-empty { text-align: center; padding: 34px 12px 20px; }
.acct-empty-ico {
    width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-hover); color: var(--c-accent);
}
.acct-empty-ico svg { width: 26px; height: 26px; }
.acct-empty b { font-size: 15px; color: var(--c-text); display: block; }
.acct-empty p { font-size: 12.5px; color: var(--c-muted); margin: 8px 0 18px; line-height: 1.7; }

.acct-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 55%, #eaf2ff 100%);
    border-color: rgba(37, 99, 235, .18);
}
.acct-hero-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.acct-hero-logo {
    width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex: none;
    background: #fff; border: 1px solid var(--c-border);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
.acct-hero-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-hero-brand { font-size: 20px; font-weight: 800; letter-spacing: .3px; color: var(--c-text); }
.acct-hero-sub { font-size: 12px; color: var(--c-muted); margin-top: 3px; }
.acct-hero-right { text-align: right; }
.acct-balance-label { font-size: 11.5px; color: var(--c-muted); letter-spacing: .6px; }
.acct-balance {
    font-size: 30px; font-weight: 800; line-height: 1.15;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--c-btn-grad); -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.acct-table-wrap { overflow-x: auto; margin-top: 16px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.acct-table th {
    text-align: left; font-size: 11.5px; font-weight: 600; color: var(--c-muted);
    padding: 10px 12px; border-bottom: 1px solid var(--c-row-border); white-space: nowrap;
}
.acct-table td { padding: 12px; border-bottom: 1px solid var(--c-row-border); color: var(--c-text-soft); }
.acct-table tr:last-child td { border-bottom: none; }
.acct-table td b { color: var(--c-text); }
@media (max-width: 900px) {
    .acct-grid { grid-template-columns: minmax(0, 1fr); }
    .acct-hero-right { text-align: left; }
}

/* ============ 系统更新：版本块 + 箭头 + 进度 + 日志 ============ */
.upd-flow {
    display: flex; align-items: center; justify-content: center;
    gap: 0; flex-wrap: wrap; row-gap: 16px; margin: 26px 0 6px;
}
.upd-node {
    flex: 1 1 190px; max-width: 300px; min-width: 0;
    background: #fff; border: 1px solid var(--c-border); border-radius: 18px;
    padding: 20px 22px; text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.upd-node.latest {
    background: linear-gradient(160deg, #eef5ff 0%, #ffffff 62%);
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 12px 30px rgba(37, 99, 235, .12);
}
.upd-node-label {
    font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--c-muted); margin-bottom: 8px;
}
.upd-node-ver {
    font-size: 29px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--c-text); overflow-wrap: anywhere;
}
.upd-node.latest .upd-node-ver { color: var(--c-accent); }
.upd-node-sub { font-size: 11px; color: var(--c-muted); margin-top: 7px; overflow-wrap: anywhere; }
.upd-arrow {
    flex: 0 0 118px; display: flex; align-items: center; justify-content: center;
    padding: 0 10px; color: var(--c-accent);
}
.upd-arrow svg { width: 100%; height: 42px; overflow: visible; }
.upd-arrow .flow-dash { animation: updFlow 2.4s linear infinite; }
@keyframes updFlow { to { stroke-dashoffset: -28; } }

.upd-status {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin-top: 20px; font-size: 12.5px; color: var(--c-text-soft);
}
.upd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-muted); flex: none; }
.upd-dot.upd { background: var(--c-accent); box-shadow: 0 0 9px rgba(37, 99, 235, .55); }
.upd-dot.ok { background: #16a34a; box-shadow: 0 0 9px rgba(22, 163, 74, .5); }
.upd-dot.err { background: #dc2626; box-shadow: 0 0 9px rgba(220, 38, 38, .5); }

.upd-progress { margin: 18px auto 0; max-width: 620px; display: none; }
.upd-progress-bar {
    height: 10px; border-radius: 999px; background: var(--c-hover);
    border: 1px solid var(--c-border); overflow: hidden;
}
.upd-progress-fill {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #6366f1, #22c1a4);
    background-size: 200% 100%;
    transition: width .45s ease;
    animation: updSheen 2.2s linear infinite;
}
@keyframes updSheen { to { background-position: 200% 0; } }
.upd-progress-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px; color: var(--c-muted); margin-top: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.upd-log {
    display: none; margin-top: 16px; max-height: 260px; overflow-y: auto;
    background: #f8fafc; border: 1px solid var(--c-border); border-radius: 12px;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px; line-height: 1.75;
}
.upd-log-line { display: flex; gap: 8px; align-items: flex-start; }
.upd-log-time { color: #94a3b8; flex: none; }
.upd-log-msg { overflow-wrap: anywhere; color: var(--c-text); }
.upd-log-line.ok .upd-log-msg { color: #15803d; }
.upd-log-line.err .upd-log-msg { color: #b91c1c; }
.upd-log-line.warn .upd-log-msg { color: #b45309; }
.upd-log-line.info .upd-log-msg { color: var(--c-text-soft); }

.upd-actions { text-align: center; margin-top: 20px; }
.upd-actions .btn-update {
    display: none; padding: 14px 46px; border-radius: 14px; border: none; cursor: pointer;
    font-size: 16px; font-weight: 700; color: #fff; background: var(--c-btn-grad);
    box-shadow: 0 12px 30px var(--c-btn-shadow); font-family: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}
.upd-actions .btn-update:hover { transform: translateY(-1px); box-shadow: 0 16px 38px var(--c-btn-shadow); }
.upd-actions .btn-update:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 系统维护 */
.maint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.maint-item {
    background: var(--c-hover); border: 1px solid var(--c-border); border-radius: 14px;
    padding: 16px 18px;
}
.maint-item b { display: block; font-size: 13.5px; color: var(--c-text); margin-bottom: 4px; }
.maint-item p { font-size: 12px; color: var(--c-muted); line-height: 1.65; margin-bottom: 12px; }
.maint-result { margin-top: 14px; font-size: 12.5px; line-height: 1.9; color: var(--c-text-soft); display: none; }
.maint-result .mk-ok { color: #15803d; }
.maint-result .mk-bad { color: #b91c1c; }
@media (max-width: 640px) {
    .upd-arrow { flex-basis: 70px; transform: rotate(90deg); }
    .upd-node { flex-basis: 100%; max-width: 100%; }
}

/* ============ 侧边栏与内容等高对齐、底部紧致（整体紧凑） ============ */

/* 侧边栏布局改为 flex：侧边栏与主内容等高，底部对齐到最长的内容边缘，
   移除强制整屏高度，页面随内容收紧，仅在最底部留少量间距 */
body.sidebar-layout {
    display: flex;
    align-items: stretch;
    min-height: 0;
}
body.sidebar-layout .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    min-height: 0;
    flex: 0 0 240px;
    align-self: stretch;
}
body.sidebar-layout .main-content {
    margin-left: 0;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    padding: 26px 30px 20px;
}
body.sidebar-layout .sidebar-nav { flex: 1 1 auto; }
body.sidebar-layout.sidebar-collapsed .sidebar { flex: 0 0 76px; }
body.sidebar-collapsed .main-content { padding: 26px 22px 20px; }
body.sidebar-collapsed .nav-item { padding: 11px; }

/* 卡片间距与标题留白收紧，减少下方大面积空白 */
.glass-card { margin-bottom: 16px; }
.page-title { margin-bottom: 18px; }
.sidebar-nav { padding: 6px 10px 12px; }
.nav-section { padding: 12px 10px 6px; }
.nav-item { padding: 9px 12px; gap: 10px; border-radius: 10px; }
.sidebar-brand { padding: 16px 18px 12px; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.sidebar-footer { padding: 12px 14px 16px; }

/* ================= 全局圆润饱满卡片化（统一覆盖） ================= */
.glass-card {
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
    border: 1px solid var(--c-border);
}
.panel, .table-container {
    border-radius: 18px;
    overflow: hidden;
}
.stat-card {
    border-radius: 20px;
}
.func-card {
    border-radius: 20px;
}
.tip {
    border-radius: 16px;
    padding: 14px 18px;
}
.alert {
    border-radius: 16px;
}
.btn {
    border-radius: 999px;
    padding: 12px 24px;
}
.btn-sm {
    border-radius: 999px;
    padding: 7px 16px;
}
.form-input, .form-select {
    border-radius: 14px;
    padding: 12px 16px;
}
textarea.form-input {
    border-radius: 16px;
}
input[type="file"].form-input {
    border-radius: 16px;
    padding: 10px 12px;
}
.status-tag {
    border-radius: 999px;
    padding: 5px 12px;
}
.nav-item {
    border-radius: 14px;
}
.sidebar-brand {
    border-radius: 18px;
}
.logout-btn {
    border-radius: 14px;
}
.data-table {
    border-radius: 16px;
    overflow: hidden;
}
.data-table th:first-child { border-top-left-radius: 16px; }
.data-table th:last-child { border-top-right-radius: 16px; }
.checkbox-label {
    border-radius: 12px;
}

