/* ============================================================
   蜂群计划·总控制台 — Spotify 暗色主题
   设计规范（源自「数据看板重构设计」Ardot 设计稿）
   - 近黑面：#121212（页面）/ #181818（卡片）/ #1f1f1f（浮层）
   - 功能绿：#1ed760（主色）
   - 银灰文字：#b3b3b3（次级）/ #7a7a7a（弱化）
   - 胶囊按钮、重投影、紧凑字号、Noto Sans SC
   ============================================================ */
:root {
    --sp-bg: #121212;
    --sp-surface: #181818;
    --sp-surface-2: #1f1f1f;
    --sp-surface-3: #282828;
    --sp-border: rgba(255, 255, 255, .08);
    --sp-border-strong: rgba(255, 255, 255, .14);
    --sp-green: #1ed760;
    --sp-green-dark: #169c46;
    --sp-green-soft: rgba(30, 215, 96, .14);
    --sp-green-glow: rgba(30, 215, 96, .35);
    --sp-text: #ffffff;
    --sp-text-2: #b3b3b3;
    --sp-text-3: #7a7a7a;
    --sp-danger: #f15e6c;
    --sp-danger-soft: rgba(241, 94, 108, .14);
    --sp-warning: #ffa42b;
    --sp-warning-soft: rgba(255, 164, 43, .14);
    --sp-info: #4fa8ff;
    --sp-info-soft: rgba(79, 168, 255, .14);
    --sp-purple: #b49bff;
    --sp-purple-soft: rgba(180, 155, 255, .14);
    --sp-teal: #2ee6a8;
    --sp-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --sp-shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --sp-radius: 14px;
    --sp-radius-sm: 10px;
    --sp-pill: 500px;
    --sp-font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --hive-primary: #1ed760;
    --hive-primary-dark: #169c46;
    --hive-primary-light: #6ee7a8;
    --hive-sidebar: #181818;
    --hive-sidebar-2: #121212;
    --hive-sidebar-hover: #282828;
    --hive-sidebar-active: #1ed760;
    --hive-bg: #121212;
    --hive-card-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --hive-card-shadow-hover: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(30, 215, 96, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--sp-bg);
    font-family: var(--sp-font);
    margin: 0;
    color: var(--sp-text);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: .1px;
}
::selection { background: rgba(30, 215, 96, .35); color: #fff; }

/* 滚动条美化（暗色） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4d4d4d; }

/* ========== Bootstrap 明色工具类 → 暗色覆盖 ========== */
.text-muted { color: var(--sp-text-2) !important; }
.text-dark { color: var(--sp-text) !important; }
.text-warning { color: var(--sp-warning) !important; }
.text-primary { color: var(--sp-green) !important; }
.text-success { color: var(--sp-green) !important; }
.text-danger { color: var(--sp-danger) !important; }
.text-secondary { color: var(--sp-text-2) !important; }
.text-white { color: #fff !important; }
.bg-light { background: var(--sp-surface-2) !important; }
.bg-white { background: var(--sp-surface) !important; }
.bg-dark { background: #0d0d0d !important; }
.bg-warning { background: var(--sp-warning) !important; }
.bg-body { background: var(--sp-bg) !important; }
.border { border-color: var(--sp-border) !important; }
.border-top { border-top-color: var(--sp-border) !important; }
.border-bottom { border-bottom-color: var(--sp-border) !important; }
.border-end { border-right-color: var(--sp-border) !important; }
.border-start { border-left-color: var(--sp-border) !important; }
hr { border-color: var(--sp-border); opacity: 1; }
kbd {
    background: var(--sp-surface-3);
    color: var(--sp-text-2);
    border: 1px solid var(--sp-border-strong);
    border-radius: 6px;
    padding: .2em .5em;
    font-size: .78em;
}
code {
    color: var(--sp-green);
    background: rgba(30, 215, 96, .08);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: .9em;
}
a { color: var(--sp-green); }
a:hover { color: var(--sp-green-dark); }

/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 248px;
    background: linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
    border-right: 1px solid var(--sp-border);
    color: var(--sp-text-2);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .28s ease;
    box-shadow: 2px 0 18px rgba(0, 0, 0, .4);
}
.sidebar-brand {
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sp-border);
}
.sidebar-brand .logo-box {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1ed760 0%, #0e9c47 100%);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(30, 215, 96, .35);
}
.sidebar-brand .brand-text { line-height: 1.2; }
.sidebar-brand .brand-text .title {
    font-size: 15px; font-weight: 800; color: #fff;
    letter-spacing: .5px;
}
.sidebar-brand .brand-text .sub {
    font-size: 11px; color: var(--sp-text-3); margin-top: 2px;
    letter-spacing: .3px;
}

.sidebar-nav { padding: 14px 12px; flex: 1 1 auto; overflow-y: auto; }
.sidebar-nav .nav-section {
    font-size: 10px; color: var(--sp-text-3); text-transform: uppercase;
    letter-spacing: 1.4px; padding: 14px 12px 8px; font-weight: 600;
}
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    color: var(--sp-text-2);
    text-decoration: none;
    border-radius: var(--sp-pill);
    margin-bottom: 3px;
    font-size: 13.5px;
    transition: all .18s ease;
    position: relative;
}
.sidebar-nav .nav-item i { font-size: 17px; width: 20px; text-align: center; }
.sidebar-nav .nav-item:hover {
    background: var(--sp-surface-3);
    color: #fff;
}
.sidebar-nav .nav-item.active {
    background: rgba(30, 215, 96, .16);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(30, 215, 96, .35);
}
.sidebar-nav .nav-item.active i { color: var(--sp-green); }
.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--sp-green-light, #7df0a8), var(--sp-green));
    box-shadow: 0 0 10px rgba(30, 215, 96, .7);
}
.sidebar-nav .nav-item.active::after {
    content: '\F285';
    font-family: "bootstrap-icons";
    position: absolute; right: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--sp-green);
    font-size: 12px; opacity: .85;
}
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--sp-border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 14px;
    flex: 0 0 34px;
    box-shadow: 0 2px 8px rgba(30, 215, 96, .35);
}
.sidebar-footer .meta { flex: 1 1 auto; min-width: 0; }
.sidebar-footer .meta .name { color: #fff; font-size: 13px; font-weight: 700; }
.sidebar-footer .meta .role { color: var(--sp-text-3); font-size: 11px; }
.sidebar-footer .logout-btn {
    color: var(--sp-text-3); background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 4px 6px; border-radius: 6px; transition: all .18s;
}
.sidebar-footer .logout-btn:hover { color: var(--sp-danger); background: rgba(241, 94, 108, .12); }

/* ===== 主内容区 ===== */
.main-wrap {
    margin-left: 248px;
    min-height: 100vh;
    transition: margin .28s ease;
}
.topbar {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(18, 18, 18, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sp-border);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar .topbar-title { font-size: 17px; font-weight: 800; color: #fff; margin: 0; letter-spacing: .2px; }
.topbar .topbar-sub { font-size: 12px; color: var(--sp-text-3); margin-top: 2px; }
.topbar .topbar-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 24px; }

/* 移动端遮罩 */
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .6);
    z-index: 1035; opacity: 0; visibility: hidden;
    transition: opacity .25s ease;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

.menu-toggle {
    background: var(--sp-surface-2); border: 1px solid var(--sp-border);
    border-radius: 10px;
    width: 38px; height: 38px; cursor: pointer; display: none;
    align-items: center; justify-content: center; color: var(--sp-text);
}
.menu-toggle:hover { background: var(--sp-surface-3); }

/* ===== 卡片 ===== */
.card {
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-surface);
    box-shadow: var(--hive-card-shadow);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--hive-card-shadow-hover); }
.card.card-table { overflow: hidden; }
.card-header-sm {
    padding: 14px 18px; background: transparent;
    border-bottom: 1px solid var(--sp-border);
}
.card-header-sm .fw-bold { color: #fff; }

/* 统计卡片 */
.stat-card {
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
    overflow: hidden;
    position: relative;
    background: var(--sp-surface);
    box-shadow: var(--hive-card-shadow);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(30, 215, 96, .35);
    box-shadow: var(--hive-card-shadow-hover);
}
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex: 0 0 52px;
}
.stat-card .stat-num { font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.stat-card .stat-label { font-size: 12.5px; color: var(--sp-text-2); margin-top: 6px; }

/* 状态徽章 */
.badge-status {
    font-weight: 700; padding: .45em .8em; border-radius: var(--sp-pill); font-size: 11px;
    letter-spacing: .3px;
}
.badge-on { background: var(--sp-green-soft); color: var(--sp-green); }
.badge-off { background: var(--sp-danger-soft); color: var(--sp-danger); }

/* 主动进程（Workerman）状态指示 */
.worker-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    padding: .45em .8em; border-radius: var(--sp-pill);
    border: 1px solid var(--sp-border); color: var(--sp-text-2);
    cursor: default; white-space: nowrap;
}
.worker-status .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sp-text-3); flex: none; }
.worker-status.online { border-color: rgba(46, 230, 168, .35); color: var(--sp-green); }
.worker-status.online .ws-dot { background: var(--sp-green); box-shadow: 0 0 6px rgba(46, 230, 168, .7); animation: pulse-dot 2s ease-in-out infinite; }
.worker-status.offline { border-color: rgba(255, 93, 93, .35); color: var(--sp-danger); }
.worker-status.offline .ws-dot { background: var(--sp-danger); box-shadow: 0 0 6px rgba(255, 93, 93, .6); }

/* 表格 */
.table { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--sp-text); --bs-table-border-color: var(--sp-border); }
.table thead th {
    background: var(--sp-surface-2); color: var(--sp-text-3); font-weight: 700;
    font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
    border-bottom: 1px solid var(--sp-border); padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 13px 16px; vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    color: var(--sp-text);
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--sp-surface-2); }
.table tbody tr:last-child td { border-bottom: none; }

/* 按钮（胶囊） */
.btn { border-radius: var(--sp-pill); font-weight: 600; letter-spacing: .2px; }
.btn-hive {
    background: linear-gradient(135deg, var(--sp-green) 0%, #16b85a 100%);
    border: none; color: #0a0a0a; font-weight: 800;
    box-shadow: 0 2px 10px rgba(30, 215, 96, .3);
    transition: all .18s ease;
}
.btn-hive:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30, 215, 96, .42); color: #0a0a0a; }
.btn-hive:active { transform: translateY(0) scale(.98); }
.btn-hive:disabled { opacity: .6; }
.btn-soft { font-size: 12px; padding: .32rem .68rem; border-radius: var(--sp-pill); }
.btn-soft-action { background: var(--sp-info-soft); color: var(--sp-info); }
.btn-soft-action:hover { background: rgba(79, 168, 255, .25); color: #7dbcff; }
.btn-soft-edit { background: var(--sp-warning-soft); color: var(--sp-warning); }
.btn-soft-edit:hover { background: rgba(255, 164, 43, .26); color: #ffc069; }
.btn-soft-danger { background: var(--sp-danger-soft); color: var(--sp-danger); }
.btn-soft-danger:hover { background: rgba(241, 94, 108, .26); color: #ff8a94; }
.btn-light {
    background: var(--sp-surface-2); color: var(--sp-text-2);
    border: 1px solid var(--sp-border);
}
.btn-light:hover { background: var(--sp-surface-3); color: #fff; border-color: var(--sp-border-strong); }
.btn-outline-light { border-color: var(--sp-border-strong); color: var(--sp-text-2); }
.btn-outline-light:hover { background: var(--sp-surface-2); color: #fff; }

/* 表单 */
.form-control, .form-select {
    border-radius: var(--sp-radius-sm);
    border: 1px solid var(--sp-border-strong);
    background: var(--sp-surface-2);
    color: var(--sp-text);
    padding: .55rem .85rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #6a6a6a; }
.form-control:focus, .form-select:focus {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 3px rgba(30, 215, 96, .16);
    background: var(--sp-surface-2);
    color: var(--sp-text);
}
.form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23b3b3b3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    --bs-form-select-icon: none;
    background-image: var(--bs-form-select-bg-img);
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 14px 10px;
}
.form-select option { background: var(--sp-surface-2); color: var(--sp-text); }
.form-select::-ms-expand { display: none; }
.form-label { font-weight: 700; color: var(--sp-text); margin-bottom: .4rem; font-size: 13px; }
.form-text { color: var(--sp-text-3); font-size: 12px; }
.form-control[readonly], .form-control:disabled { background: #141414; color: var(--sp-text-3); }
.input-group-text { background: var(--sp-surface-2); border-color: var(--sp-border-strong); color: var(--sp-text-2); }

/* 开关（绿色） */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #3a3a3a; border-radius: 24px; transition: .25s;
}
.switch .slider::before {
    content: ""; position: absolute; height: 18px; width: 18px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .slider { background: var(--sp-green); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.form-check-input {
    background-color: #3a3a3a; border-color: #4d4d4d;
}
.form-check-input:checked { background-color: var(--sp-green); border-color: var(--sp-green); }
.form-switch .form-check-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); }
.form-check-label { color: var(--sp-text); }

/* 分页 */
.pagination { margin: 18px 0 0; }
.pagination .page-link {
    border: 1px solid var(--sp-border); color: var(--sp-text-2); margin: 0 2px;
    border-radius: var(--sp-pill) !important;
    padding: .42rem .75rem; transition: all .15s ease;
    background: transparent;
}
.pagination .page-link:hover { background: var(--sp-surface-3); color: #fff; }
.pagination .active .page-link {
    background: var(--sp-green); color: #0a0a0a; font-weight: 800;
    border-color: var(--sp-green);
    box-shadow: 0 2px 8px rgba(30, 215, 96, .35);
}
.pagination .disabled .page-link { color: var(--sp-text-3); background: transparent; }

/* 友站 logo 圆 */
.site-favicon {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--sp-green-soft);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--sp-green); font-weight: 800; font-size: 14px;
    flex: 0 0 32px;
}
.site-favicon img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }

/* ===== 后台切换统计条 ===== */
.console-statbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.console-stat-item {
    background: var(--sp-surface); border-radius: var(--sp-radius);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--sp-border);
    box-shadow: var(--hive-card-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
    border-left: 3px solid var(--sp-green);
}
.console-stat-item:hover { transform: translateY(-2px); box-shadow: var(--hive-card-shadow-hover); }
.console-stat-item i {
    font-size: 22px; color: var(--sp-green);
    background: var(--sp-green-soft); width: 44px; height: 44px;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    flex: 0 0 44px;
}
.console-stat-item .num { font-size: 22px; font-weight: 800; color: #fff; line-height: 1; }
.console-stat-item .num-sm { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; max-width: 130px; }
.console-stat-item .label { font-size: 12px; color: var(--sp-text-2); margin-top: 3px; }
.console-stat-recent { border-left-color: var(--sp-info); }
.console-stat-recent i { color: var(--sp-info); background: var(--sp-info-soft); }

/* ===== 后台切换卡片 ===== */
.console-card {
    border: 1px solid var(--sp-border); border-radius: var(--sp-radius); overflow: hidden;
    box-shadow: var(--hive-card-shadow);
    transition: all .22s ease;
    height: 100%;
    background: var(--sp-surface);
    border-top: 3px solid var(--sp-green);
}
.console-card:hover {
    transform: translateY(-4px);
    border-color: rgba(30, 215, 96, .3);
    box-shadow: var(--hive-card-shadow-hover);
}
.console-card.console-card-disabled { opacity: .55; border-top-color: #3a3a3a; }
.console-card.console-card-disabled:hover { opacity: 1; }
.console-card .console-head {
    padding: 16px 18px; display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, rgba(30, 215, 96, .06) 0%, transparent 60%);
    border-bottom: 1px solid var(--sp-border);
}
.console-card .console-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    display: flex; align-items: center; justify-content: center;
    color: #0a0a0a; font-size: 20px;
    box-shadow: 0 3px 12px rgba(30, 215, 96, .3);
    flex: 0 0 44px;
}
.console-card .console-name { font-weight: 800; color: #fff; font-size: 15px; line-height: 1.2; }
.console-card .console-url { font-size: 12px; color: var(--sp-text-3); margin-top: 2px; word-break: break-all; }
.console-card .console-body { padding: 12px 18px; }
.console-card .console-meta { font-size: 12px; color: var(--sp-text-2); }
.console-card .console-stats {
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 11px; color: var(--sp-text-3);
    padding-top: 8px; border-top: 1px dashed var(--sp-border-strong);
}
.console-card .console-stat { display: inline-flex; align-items: center; }
.console-card .console-foot {
    padding: 10px 18px; background: var(--sp-surface-2); border-top: 1px solid var(--sp-border);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.btn-enter {
    font-weight: 800; font-size: 13px;
    padding: .45rem 1rem; border-radius: var(--sp-pill);
    box-shadow: 0 2px 10px rgba(30, 215, 96, .3);
    transition: all .18s ease;
}
.btn-enter:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(30, 215, 96, .45); }

/* 卡片网格响应式 */
.console-grid .col-md-6, .console-grid [class*="col-"] { display: flex; }
.console-grid .console-card { width: 100%; }

/* 卡片选择 checkbox */
.console-card-check {
    position: absolute; top: 10px; left: 10px;
    z-index: 5; opacity: 0;
    transition: opacity .18s ease;
}
.console-card-check .form-check-input {
    width: 18px; height: 18px; cursor: pointer;
    border: 2px solid #4d4d4d; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    background-color: #2a2a2a;
}
.console-card-check .form-check-input:checked {
    background-color: var(--sp-green);
    border-color: var(--sp-green);
}
.console-card:hover .console-card-check,
.console-card .console-card-check .form-check-input:checked { opacity: 1; }
.console-card { position: relative; }
.console-card:has(.console-card-check .form-check-input:checked) {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 2px rgba(30, 215, 96, .4), var(--hive-card-shadow-hover);
}

/* ===== 图标选择器 ===== */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    max-height: 200px; overflow-y: auto;
}
.icon-pick { cursor: pointer; margin: 0; }
.icon-pick input { display: none; }
.icon-pick-body {
    display: flex; align-items: center; justify-content: center;
    height: 44px; background: var(--sp-surface); border: 1.5px solid var(--sp-border-strong);
    border-radius: 9px; font-size: 18px; color: var(--sp-text-2);
    transition: all .15s ease;
}
.icon-pick:hover .icon-pick-body {
    border-color: var(--sp-green); color: var(--sp-green);
    transform: translateY(-2px);
}
.icon-pick input:checked + .icon-pick-body {
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    color: #0a0a0a; border-color: var(--sp-green);
    box-shadow: 0 3px 12px rgba(30, 215, 96, .35);
}

/* 便捷提示条 */
.console-tip {
    margin-top: 16px;
    background: var(--sp-surface-2);
    border: 1px solid rgba(30, 215, 96, .25); border-radius: var(--sp-radius-sm);
    padding: 12px 16px; display: flex; gap: 10px;
    font-size: 13px; color: var(--sp-text-2); align-items: flex-start;
}
.console-tip i { font-size: 16px; color: var(--sp-green); margin-top: 1px; }
.console-tip strong { color: var(--sp-green); }

.home-console-card {
    background: var(--sp-surface); border-radius: var(--sp-radius); overflow: hidden;
    border: 1px solid var(--sp-border);
    box-shadow: var(--hive-card-shadow);
    transition: all .22s ease;
    border-top: 3px solid var(--sp-green);
    display: flex; flex-direction: column;
    height: 100%;
}
.home-console-card:hover {
    transform: translateY(-4px);
    border-color: rgba(30, 215, 96, .3);
    box-shadow: var(--hive-card-shadow-hover);
}
.home-console-link {
    padding: 14px 14px 8px;
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
}
.home-console-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    display: flex; align-items: center; justify-content: center;
    color: #0a0a0a; font-size: 18px;
    box-shadow: 0 3px 10px rgba(30, 215, 96, .3);
    flex: 0 0 40px;
}
.home-console-name {
    font-weight: 700; color: #fff; font-size: 14px;
    flex: 1 1 auto; min-width: 0;
}
.home-console-meta { padding: 0 14px 10px; }
.home-console-meta .text-muted { font-size: 11px; }
.home-console-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.home-console-tags .category-pill { font-size: 10px; padding: 2px 7px; cursor: pointer; transition: opacity .15s; }
.home-console-tags .category-pill:hover { opacity: .85; }
.home-console-actions {
    padding: 8px 14px; background: var(--sp-surface-2); border-top: 1px solid var(--sp-border);
    display: flex; gap: 6px;
    margin-top: auto;
}
.home-console-actions .btn { font-size: 11px; padding: .35rem .6rem; }

/* 首页醒目文档卡片 */
.highlight-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    color: #fff;
    border: 1px solid rgba(30, 215, 96, .3);
    position: relative;
    overflow: hidden;
}
.highlight-card::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(30, 215, 96, .35) 0%, transparent 70%);
    border-radius: 50%;
    opacity: .5;
}
.highlight-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: #0a0a0a; font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(30, 215, 96, .35);
}
.highlight-card .text-muted { color: var(--sp-text-2) !important; }
.highlight-card .fw-bold { color: #fff; }
@media (max-width: 576px) {
    .highlight-card .btn span { display: none; }
    .highlight-card .btn i { margin-right: 0 !important; }
}

/* 仪表盘快捷入口 */
.quick-console-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--sp-pill);
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-border);
    text-decoration: none;
    transition: all .2s ease;
    height: 100%;
}
.quick-console-item > i:first-child {
    font-size: 16px; color: var(--sp-green);
    background: var(--sp-green-soft); width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 28px;
}
.quick-console-item span {
    font-size: 13px; font-weight: 600; color: var(--sp-text);
    flex: 1 1 auto; min-width: 0;
}
.quick-console-item .quick-go {
    font-size: 11px; color: var(--sp-green); opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    flex: 0 0 auto;
}
.quick-console-item:hover {
    transform: translateY(-2px);
    background: var(--sp-surface-3);
    border-color: rgba(30, 215, 96, .35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.quick-console-item:hover .quick-go { opacity: 1; transform: translateX(2px); }

.search-box { max-width: 400px; }
.search-box .form-control { font-size: 14px; padding: .55rem .85rem; }

/* 空状态 */
.empty-state {
    text-align: center; padding: 50px 20px; color: var(--sp-text-3);
}
.empty-state i { font-size: 48px; color: #3a3a3a; margin-bottom: 12px; display: block; }

/* ===== 分类胶囊（暗色） ===== */
.category-pill {
    display: inline-flex; align-items: center; padding: 3px 11px;
    border-radius: var(--sp-pill); font-size: 12px; font-weight: 600;
    letter-spacing: .2px;
}
.pill-bee_series, .cat-dropdown-trigger.pill-bee_series { background: var(--sp-green-soft); color: var(--sp-green); }
.pill-tool, .cat-dropdown-trigger.pill-tool { background: var(--sp-info-soft); color: var(--sp-info); }
.pill-resource, .cat-dropdown-trigger.pill-resource { background: rgba(255, 111, 181, .14); color: #ff6fb5; }
.pill-community, .cat-dropdown-trigger.pill-community { background: var(--sp-purple-soft); color: var(--sp-purple); }
.pill-game, .cat-dropdown-trigger.pill-game { background: var(--sp-warning-soft); color: var(--sp-warning); }
.pill-other, .cat-dropdown-trigger.pill-other { background: rgba(255, 255, 255, .08); color: var(--sp-text-2); }

/* ===== 表头排序链接 ===== */
.th-sort {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--sp-text-2); text-decoration: none;
    font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: color .15s, border-color .15s;
}
.th-sort:hover { color: var(--sp-text); border-color: rgba(255, 255, 255, .25); }
.th-sort.active { color: var(--sp-green); border-color: var(--sp-green); }
.th-sort.active i { font-size: 11px; }

/* ===== 排序值内联编辑 ===== */
.sort-order-edit {
    display: inline-flex; align-items: center; gap: 5px;
    cursor: pointer; border-radius: 6px; padding: 1px 3px;
    transition: background .15s;
}
.sort-order-edit .sort-edit-icon {
    font-size: 10px; opacity: 0; color: var(--sp-text-3);
    transition: opacity .15s;
}
.sort-order-edit:hover { background: rgba(255, 255, 255, .06); }
.sort-order-edit:hover .sort-edit-icon { opacity: .8; color: var(--sp-warning); }
.sort-order-edit .sort-order-input {
    width: 64px; font-size: 12px; padding: 1px 6px;
    background: var(--sp-surface-2); color: var(--sp-text);
    border: 1px solid var(--sp-warning); border-radius: 6px;
    outline: none;
}
.sort-order-edit .sort-order-input:focus { box-shadow: 0 0 0 2px rgba(255, 164, 43, .25); }

/* 列表内联分类下拉：胶囊着色（风格同 subdomain 的 sub-type-select） */
.category-inline-select {
    font-size: 11px !important;
    padding: .25rem .5rem !important;
    border-radius: 500px !important;
    transition: border-color .15s, box-shadow .15s;
}
.category-inline-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.10); }
.category-inline-select option { background: #1f1f1f; color: #ddd; }

.category-inline-select.pill-bee_series {
    color: var(--sp-green);
    border-color: rgba(30, 215, 96, .55);
    background-color: rgba(30, 215, 96, .14);
}
.category-inline-select.pill-tool {
    color: var(--sp-info);
    border-color: rgba(79, 168, 255, .55);
    background-color: rgba(79, 168, 255, .14);
}
.category-inline-select.pill-resource {
    color: #ff6fb5;
    border-color: rgba(255, 111, 181, .55);
    background-color: rgba(255, 111, 181, .14);
}
.category-inline-select.pill-community {
    color: var(--sp-purple);
    border-color: rgba(180, 155, 255, .55);
    background-color: rgba(180, 155, 255, .14);
}
.category-inline-select.pill-game {
    color: var(--sp-warning);
    border-color: rgba(255, 164, 43, .55);
    background-color: rgba(255, 164, 43, .14);
}
.category-inline-select.pill-other {
    color: var(--sp-text-2);
    border-color: rgba(255, 255, 255, .22);
    background-color: rgba(255, 255, 255, .05);
}

/* 分类图标（跟随分类色，currentColor 继承容器） */
.category-icon-wrap {
    display: inline-flex; align-items: center; gap: 5px;
}
.category-icon-wrap .category-icon {
    color: inherit; font-size: 12px;
    transition: color .15s;
}
.category-icon-wrap.pill-bee_series { color: var(--sp-green); }
.category-icon-wrap.pill-tool { color: var(--sp-info); }
.category-icon-wrap.pill-resource { color: #ff6fb5; }
.category-icon-wrap.pill-community { color: var(--sp-purple); }
.category-icon-wrap.pill-game { color: var(--sp-warning); }
.category-icon-wrap.pill-other { color: var(--sp-text-2); }

/* ===== 自定义下拉组件（icon + 文字选项）===== */
.cat-dropdown { position: relative; display: inline-flex; }
.cat-dropdown-trigger {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid transparent; background: transparent;
    font-size: 12px; font-weight: 600; padding: .25rem .5rem;
    border-radius: 500px; cursor: pointer; color: inherit;
    transition: border-color .15s, background .15s;
}
.cat-dropdown-trigger:hover { border-color: currentColor; }
.cat-dropdown-trigger i { font-size: 12px; }
.cat-dropdown-arrow { font-size: 9px !important; opacity: .7; transition: transform .15s; }
.cat-dropdown.open .cat-dropdown-arrow { transform: rotate(180deg); }
.cat-dropdown-menu {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
    min-width: 165px; background: var(--sp-surface-2);
    border: 1px solid var(--sp-border-strong); border-radius: 10px;
    padding: 4px; box-shadow: var(--sp-shadow);
    max-height: 300px; overflow-y: auto;
}
.cat-dropdown-option {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 7px; cursor: pointer;
    font-size: 12px; color: var(--sp-text-2);
    --opt-color: var(--sp-text-2);
    transition: background .12s, color .12s;
}
.cat-dropdown-option .opt-icon { color: var(--opt-color); font-size: 12px; }
.cat-dropdown-option:hover { background: var(--sp-surface-3); color: var(--opt-color); }
.cat-dropdown-option.selected { color: var(--opt-color); background: rgba(255, 255, 255, .06); }
.cat-dropdown-check { margin-left: auto; font-size: 11px; opacity: 0; }
.cat-dropdown-option.selected .cat-dropdown-check { opacity: 1; }

/* ===== 登录页（Spotify 暗色） ===== */
.login-page {
    margin: 0; min-height: 100vh;
    background: radial-gradient(ellipse at top, #1d1d1d 0%, #121212 55%, #0a0a0a 100%);
    overflow: hidden;
    position: relative;
}

/* 蜂巢背景图案（暗色描边） */
.hive-bg {
    position: absolute; inset: 0; z-index: 0; opacity: .4;
    pointer-events: none;
}
.hive-pattern {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-repeat: repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 0L56 16.18V49.4L28 65.6L0 49.4V16.18L28 0z' fill='none' stroke='rgba(30,215,96,0.12)' stroke-width='1'/%3E%3Cpath d='M28 33.8L56 50V83.2L28 99.4L0 83.2V50L28 33.8z' fill='none' stroke='rgba(30,215,96,0.08)' stroke-width='1'/%3E%3C/svg%3E");
}

/* 背景光晕（绿色） */
.login-glow {
    position: absolute; border-radius: 50%; filter: blur(90px);
    pointer-events: none; z-index: 0;
}
.login-glow-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(30, 215, 96, .22) 0%, transparent 70%);
    top: -140px; right: -120px;
    animation: glowDrift1 14s ease-in-out infinite alternate;
}
.login-glow-2 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(79, 168, 255, .14) 0%, transparent 70%);
    bottom: -140px; left: -100px;
    animation: glowDrift2 18s ease-in-out infinite alternate;
}
@keyframes glowDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes glowDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -30px) scale(1.15); }
}

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
    position: relative; z-index: 2;
}
.login-card {
    width: 100%; max-width: 420px;
    background: rgba(24, 24, 24, .92);
    border: 1px solid var(--sp-border-strong);
    border-radius: 20px; padding: 40px 36px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
    position: relative; z-index: 2;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: cardIn .6s cubic-bezier(.2, .8, .3, 1.1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
    width: 70px; height: 70px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(30, 215, 96, .4), 0 0 0 6px rgba(30, 215, 96, .12);
    position: relative;
}
.login-logo::after {
    content: ''; position: absolute; inset: -2px;
    border-radius: 22px; border: 1px solid rgba(255, 255, 255, .2);
    pointer-events: none;
}
.login-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0; letter-spacing: .3px; }
.login-sub { font-size: 12.5px; color: var(--sp-text-3); margin: 6px 0 0; letter-spacing: .5px; }

/* 浮动标签输入框 */
.login-card .form-floating > .form-control {
    height: calc(3.4rem + 2px);
    border-radius: var(--sp-radius-sm);
    border: 1.5px solid var(--sp-border-strong);
    background: #141414;
    padding: 1.5rem 1rem .55rem;
    transition: border-color .15s, box-shadow .15s;
}
.login-card .form-floating > .form-control:focus {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 4px rgba(30, 215, 96, .15);
}
.login-card .form-floating > label {
    padding: 1rem 1rem; color: var(--sp-text-3); font-size: 14px;
    transition: color .15s;
}
.login-card .form-floating > .form-control:focus ~ label,
.login-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--sp-green);
}

/* 密码框 */
.password-wrap { position: relative; }
.pwd-toggle {
    position: absolute; top: 50%; right: 14px;
    transform: translateY(-50%);
    background: transparent; border: none; padding: 4px;
    color: var(--sp-text-3); cursor: pointer; font-size: 16px;
    z-index: 5; border-radius: 6px; transition: color .15s, background .15s;
}
.pwd-toggle:hover { color: var(--sp-green); background: rgba(30, 215, 96, .1); }
.password-wrap .form-control { padding-right: 48px; }

/* 表单开关 */
.login-card .form-switch .form-check-input {
    width: 2.3em; height: 1.25em; cursor: pointer;
}
.login-card .form-switch .form-check-input:checked {
    background-color: var(--sp-green);
    border-color: var(--sp-green);
}

/* 安全徽章 */
.secure-badge {
    background: var(--sp-green-soft); color: var(--sp-green);
    font-weight: 700; padding: .45em .8em; font-size: 11px; border-radius: var(--sp-pill);
}

/* 登录按钮 */
.btn-login {
    font-size: 15px; font-weight: 800;
    padding: 11px 16px !important;
    border-radius: var(--sp-pill);
    letter-spacing: 2px;
    box-shadow: 0 6px 20px rgba(30, 215, 96, .4);
    transition: all .2s ease;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(30, 215, 96, .55); }
.btn-login:active { transform: translateY(0); }
.btn-loader { display: inline-flex; align-items: center; }

/* 底部信息 */
.login-foot {
    margin-top: 28px; padding-top: 18px;
    border-top: 1px dashed var(--sp-border-strong);
    text-align: center;
}
.login-foot-row {
    font-size: 12px; color: var(--sp-text-2);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-bottom: 6px;
}
.login-foot-meta {
    font-size: 11px; color: var(--sp-text-3);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-foot-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sp-text-3); }

/* Toast */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 2000; }
.app-toast {
    min-width: 260px; border-radius: var(--sp-radius-sm); overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5); margin-bottom: 10px;
    animation: slideIn .3s ease;
    border: 1px solid rgba(255, 255, 255, .1);
}
.app-toast > div { background: transparent !important; }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.app-toast.fade-out { animation: slideOut .3s ease forwards; }
@keyframes slideOut { to { transform: translateX(110%); opacity: 0; } }

/* 自定义确认对话框（替代 window.confirm） */
.app-confirm-modal {
    position: fixed; inset: 0; z-index: 2100;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.app-confirm-modal.show { display: flex; }
.app-confirm-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.app-confirm-card {
    position: relative;
    background: var(--sp-surface-2, #1f1f1f);
    border: 1px solid var(--sp-border-strong, #2a2a2a);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02);
    width: 100%; max-width: 420px;
    padding: 26px 24px 20px;
    color: #e5e5e5;
}
.app-confirm-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(30, 215, 96, .14); color: #1ed760;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 14px;
}
.app-confirm-icon.app-confirm-danger {
    background: rgba(241, 94, 108, .14); color: #f15e6c;
}
.app-confirm-title {
    font-size: 16px; font-weight: 700; color: #fff;
    margin-bottom: 8px; line-height: 1.4;
}
.app-confirm-msg {
    font-size: 13.5px; line-height: 1.6; color: #b3b3b3;
    margin-bottom: 20px; word-break: break-word; white-space: pre-wrap;
}
.app-confirm-actions {
    display: flex; gap: 10px; justify-content: flex-end;
}
.app-confirm-actions .btn {
    min-width: 88px; font-size: 13.5px; font-weight: 600;
    padding: .45rem 1.1rem; border-radius: 500px;
}
.app-confirm-cancel {
    background: var(--sp-surface, #181818);
    color: var(--sp-text-2, #b3b3b3);
    border: 1px solid var(--sp-border-strong, #2a2a2a);
}
.app-confirm-cancel:hover { background: #2a2a2a; color: #fff; }
.app-confirm-ok {
    background: linear-gradient(135deg, var(--sp-green, #1ed760), #16b85a);
    color: #0a0a0a; border: 0;
}
.app-confirm-ok:hover { background: linear-gradient(135deg, #2ee87a, #1ed760); }
.app-confirm-ok.app-confirm-danger-btn {
    background: linear-gradient(135deg, #f15e6c, #d63a4e);
    color: #fff;
}
.app-confirm-ok.app-confirm-danger-btn:hover { background: linear-gradient(135deg, #ff7884, #f15e6c); }
.app-confirm-in { animation: confirmIn .18s ease forwards; }
.app-confirm-out { animation: confirmOut .18s ease forwards; }
@keyframes confirmIn {
    from { opacity: 0; transform: translateY(-6px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes confirmOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
    .app-confirm-in, .app-confirm-out { animation: none; }
}

/* 分类进度条（暗色） */
.progress {
    background: var(--sp-surface-2);
    border-radius: var(--sp-pill);
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--sp-green), #6ee7a8) !important;
    border-radius: var(--sp-pill);
}

/* 最近访问块 */
.bg-light.rounded { background: var(--sp-surface-2) !important; }

/* ============================================================
   移动端 · 底部标签栏（Spotify 风格）
   ============================================================ */
.sp-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1045;
    display: none;
    background: rgba(18, 18, 18, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--sp-border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .5);
}
.sp-tabbar-inner { display: flex; max-width: 520px; margin: 0 auto; }
.sp-tabbar-item {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    color: var(--sp-text-3);
    text-decoration: none;
    border-radius: 12px;
    transition: color .18s ease, background .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.sp-tabbar-item i { font-size: 20px; line-height: 1; }
.sp-tabbar-item .sp-tabbar-label { font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.sp-tabbar-item:active { background: var(--sp-surface-3); }
.sp-tabbar-item.active { color: var(--sp-green); }
.sp-tabbar-item.active i { filter: drop-shadow(0 0 6px rgba(30, 215, 96, .5)); }

/* 移动端内容底部留白（给标签栏让位） */
@media (max-width: 767.98px) {
    .main-wrap { padding-bottom: 64px; }
}

/* ===== 响应式 · 移动端全面优化 ===== */

/* 大屏平板及以下：侧边栏抽屉化 */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: 268px; }
    .sidebar.show { transform: translateX(0); box-shadow: 4px 0 30px rgba(0, 0, 0, .5); }
    .main-wrap { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 20px; }
}

/* 手机端（含大屏手机） */
@media (max-width: 767.98px) {
    .sp-tabbar { display: block; }
    .content { padding: 14px; padding-bottom: 8px; }
    .topbar {
        padding: 10px 14px;
        flex-wrap: wrap; gap: 8px;
    }
    .topbar-title { font-size: 15px; }
    .topbar-sub { display: none; }
    .topbar-actions .badge-status { display: none; }
    .topbar-actions .btn-soft-action { width: 34px; height: 34px; padding: 0; }

    /* 统计卡片手机两列 */
    .stat-card { padding: 14px !important; }
    .stat-card .stat-icon { width: 42px; height: 42px; font-size: 20px; flex: 0 0 42px; }
    .stat-card .stat-num { font-size: 22px; }

    /* 后台卡片网格单列 */
    .console-grid [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .console-card .console-foot { flex-wrap: wrap; gap: 10px; }
    .console-card .console-foot .btn-enter { flex: 1 1 auto; }
    .console-card .console-foot .btn-group { flex: 0 0 auto; }

    /* 后台切换统计条两列 */
    .console-statbar { grid-template-columns: 1fr 1fr; gap: 10px; }
    .console-stat-item { padding: 12px 13px; }
    .console-stat-item i { width: 38px; height: 38px; font-size: 19px; flex: 0 0 38px; }
    .console-stat-item .num { font-size: 18px; }

    /* 操作栏表单堆叠 */
    .card-body .row.g-2 > [class*="col-md"] { flex: 0 0 100%; max-width: 100%; }
    .card-body .row.g-2 .btn { width: 100%; }

    /* 表单全宽 */
    .row.g-3 > [class*="col-md"] { flex: 0 0 100%; max-width: 100%; }

    /* 分页居中 */
    .pagination { justify-content: center; }
    .pagination .page-link { padding: .5rem .8rem; }

    /* 卡片头部紧凑 */
    .card-header-sm { padding: 12px 14px; }
    .card-body { padding: 16px !important; }

    /* 便捷提示紧凑 */
    .console-tip { font-size: 12px; padding: 10px 12px; }

    /* 表格单元格紧凑 */
    .table thead th { padding: 10px 12px; font-size: 11px; }
    .table tbody td { padding: 10px 12px; }

    /* 登录页手机适配 */
    .login-wrap { padding: 16px; }
    .login-card { padding: 30px 22px 22px; border-radius: 16px; }
    .login-logo { width: 60px; height: 60px; border-radius: 16px; }
    .login-title { font-size: 19px; }
    .login-sub { font-size: 11.5px; }
    .login-card .form-floating > .form-control { height: calc(3.2rem + 2px); }
    .btn-login { font-size: 14px; padding: 10px 14px !important; letter-spacing: 1px; }

    /* 背景光晕缩小避免溢出 */
    .login-glow-1 { width: 300px; height: 300px; }
    .login-glow-2 { width: 260px; height: 260px; }
}

/* 小屏手机 */
@media (max-width: 575.98px) {
    .content { padding: 12px; padding-bottom: 8px; }
    .topbar { padding: 9px 12px; }
    .topbar-title { font-size: 14px; }
    .menu-toggle { width: 34px; height: 34px; }

    .stat-card { padding: 12px !important; }
    .stat-card .stat-icon { width: 38px; height: 38px; font-size: 18px; flex: 0 0 38px; }
    .stat-card .stat-num { font-size: 20px; }
    .stat-card .stat-label { font-size: 11.5px; }

    .console-statbar { grid-template-columns: 1fr 1fr; gap: 8px; }
    .console-stat-item { padding: 10px 11px; gap: 8px; }
    .console-stat-item i { width: 34px; height: 34px; font-size: 17px; flex: 0 0 34px; }
    .console-stat-item .num { font-size: 16px; }
    .console-stat-item .label { font-size: 11px; }

    .console-card .console-head { padding: 12px 14px; gap: 10px; }
    .console-card .console-icon { width: 38px; height: 38px; font-size: 17px; flex: 0 0 38px; }
    .console-card .console-name { font-size: 14px; }
    .console-card .console-body { padding: 10px 14px; }
    .console-card .console-foot { padding: 9px 14px; }

    .login-card { padding: 26px 18px 20px; border-radius: 14px; }
    .login-logo { width: 54px; height: 54px; border-radius: 14px; }
    .login-logo svg { width: 28px; height: 28px; }
    .login-title { font-size: 18px; }
    .login-foot { margin-top: 22px; padding-top: 14px; }
    .login-foot-row { font-size: 11px; }

    /* 表格操作按钮加大触摸区 */
    .btn-soft { padding: .42rem .72rem; min-height: 34px; }

    /* 仪表盘快捷入口单列 */
    .quick-console-item { padding: 9px 11px; }

    /* 底部标签栏更紧凑 */
    .sp-tabbar { padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
    .sp-tabbar-item i { font-size: 19px; }
}

/* 超小屏手机（≤375px） */
@media (max-width: 375.98px) {
    .content { padding: 10px; padding-bottom: 8px; }
    .topbar { padding: 8px 10px; }
    .console-statbar { grid-template-columns: 1fr; gap: 8px; }
    .console-stat-item { padding: 9px 10px; }
    .login-card { padding: 22px 14px 18px; }
    .login-title { font-size: 17px; }
}

/* 横屏手机优化 */
@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 500px) {
    .login-wrap { align-items: flex-start; padding: 16px; }
    .login-card { margin-top: 12px; padding: 20px 22px 16px; }
    .login-brand { margin-bottom: 16px; }
    .login-logo { width: 48px; height: 48px; }
    .login-foot { margin-top: 14px; padding-top: 10px; }
}

/* ===== 微交互 ===== */
.btn:focus { box-shadow: none; }
.btn-hive:focus { box-shadow: 0 0 0 3px rgba(30, 215, 96, .28); }
.btn-soft:active { transform: scale(.96); }

/* 表格行点击反馈 */
.table tbody tr:active { background: var(--sp-surface-3) !important; }

/* 卡片悬停阴影统一 */
.card.hover-lift { cursor: pointer; }

/* 顶部状态徽章脉冲 */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}
.badge-status.badge-on i.bi-circle-fill { animation: pulse-dot 2s ease-in-out infinite; }

/* 加载动画 */
.btn .spinner-border { width: 1rem; height: 1rem; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* GA 数据统计 · KPI 网格（5 列，自动适配） */
.ga-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 1rem;
}
.ga-stat-row .stat-card { margin: 0; }
@media (max-width: 575.98px) {
    .ga-stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ga-stat-row .stat-card { padding: 12px !important; }
    .ga-stat-row .stat-icon { width: 36px !important; height: 36px !important; font-size: 17px !important; flex: 0 0 36px; }
    .ga-stat-row .stat-num { font-size: 18px !important; }
    .ga-stat-row .stat-label { font-size: 11px; }
}

/* 页面进入动画 */
.content > * { animation: fadeUp .35s ease both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   AI 助手 · 全局悬浮对话窗（Spotify 暗色风格）
   ============================================================ */
.ai-chat-fab {
    position: fixed;
    top: 70px; right: 20px;
    z-index: 1060;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sp-green) 0%, #0e9c47 100%);
    color: #0a0a0a;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(30, 215, 96, .4), 0 0 0 1px rgba(255,255,255,.08);
    transition: transform .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.ai-chat-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 26px rgba(30, 215, 96, .55); }
.ai-chat-fab:active { transform: scale(.96); }
.ai-chat-fab .ai-chat-fab-tip {
    position: absolute; right: 56px; top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-border-strong);
    color: var(--sp-text);
    font-size: 12px; font-weight: 600;
    padding: 4px 10px; border-radius: var(--sp-pill);
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.ai-chat-fab:hover .ai-chat-fab-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* 对话面板 */
.ai-chat-panel {
    position: fixed;
    top: 70px; right: 20px;
    z-index: 1070;
    width: 400px; height: 620px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    background: var(--sp-surface);
    border: 1px solid var(--sp-border-strong);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255,255,255,.03);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: aiPanelIn .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes aiPanelIn {
    from { opacity: 0; transform: translateY(-14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 头部 */
.ai-chat-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--sp-border);
    background: linear-gradient(135deg, rgba(30,215,96,.08) 0%, transparent 70%);
}
.ai-chat-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-chat-logo {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--sp-green), #0e9c47);
    color: #0a0a0a;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    box-shadow: 0 3px 12px rgba(30, 215, 96, .35);
}
.ai-chat-title { font-size: 14px; font-weight: 800; color: #fff; line-height: 1.2; }
.ai-chat-sub { font-size: 11px; color: var(--sp-text-3); margin-top: 1px; }
.ai-chat-head-actions { display: flex; align-items: center; gap: 6px; }
.ai-chat-model { width: 150px; font-size: 11px !important; padding: .3rem .6rem !important; }
.ai-chat-icon-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--sp-border);
    background: var(--sp-surface-2);
    color: var(--sp-text-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer;
    transition: all .15s ease;
}
.ai-chat-icon-btn:hover { color: #fff; background: var(--sp-surface-3); }
#aiChatClear:hover { color: var(--sp-danger); border-color: rgba(241,94,108,.4); }
#aiChatClose:hover { color: var(--sp-danger); border-color: rgba(241,94,108,.4); }

/* 消息区 */
.ai-chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.ai-chat-body::-webkit-scrollbar { width: 6px; }
.ai-chat-body::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }

.ai-chat-welcome { text-align: center; margin: auto; padding: 20px 10px; color: var(--sp-text-3); }
.ai-chat-welcome-icon {
    width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--sp-green-soft);
    color: var(--sp-green);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
}
.ai-chat-welcome-title { font-size: 15px; font-weight: 700; color: var(--sp-text); margin-bottom: 6px; }
.ai-chat-welcome-sub { font-size: 12px; line-height: 1.8; }

/* 消息气泡 */
.ai-msg { display: flex; flex-direction: column; max-width: 88%; animation: aiMsgIn .22s ease both; }
@keyframes aiMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.ai-msg-user { align-self: flex-end; align-items: flex-end; }
.ai-msg-ai   { align-self: flex-start; align-items: flex-start; }
.ai-msg-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}
.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, var(--sp-green), #16b85a);
    color: #0a0a0a;
    font-weight: 500;
    border-bottom-right-radius: 5px;
}
.ai-msg-ai .ai-msg-bubble {
    background: var(--sp-surface-2);
    color: #e8e8e8;
    border: 1px solid var(--sp-border);
    border-bottom-left-radius: 5px;
}
.ai-msg-meta {
    font-size: 10px; color: var(--sp-text-3);
    margin-top: 4px; padding: 0 4px;
}

/* 思考过程（折叠） */
.ai-think {
    width: 100%;
    margin-bottom: 6px;
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    overflow: hidden;
}
.ai-think summary {
    cursor: pointer;
    list-style: none;
    padding: 6px 10px;
    font-size: 11px; color: var(--sp-text-2);
    display: flex; align-items: center; gap: 6px;
    user-select: none;
}
.ai-think summary::-webkit-details-marker { display: none; }
.ai-think summary::before { content: '\F4E5'; font-family: "bootstrap-icons"; font-size: 11px; }
.ai-think[open] summary::before { content: '\F4E6'; }
.ai-think-body {
    padding: 2px 10px 8px;
    font-size: 11.5px; color: var(--sp-text-3);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px; overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* 输入区 */
.ai-chat-foot {
    border-top: 1px solid var(--sp-border);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--sp-surface);
}
.ai-chat-input-wrap {
    display: flex; align-items: flex-end; gap: 8px;
    background: var(--sp-surface-2);
    border: 1px solid var(--sp-border-strong);
    border-radius: 14px;
    padding: 7px 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ai-chat-input-wrap:focus-within {
    border-color: var(--sp-green);
    box-shadow: 0 0 0 3px rgba(30, 215, 96, .14);
}
#aiChatInput {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--sp-text);
    font-size: 13.5px;
    font-family: var(--sp-font);
    line-height: 1.5;
    max-height: 110px;
    padding: 4px 2px;
}
#aiChatInput::placeholder { color: #6a6a6a; }
.ai-chat-send {
    flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, var(--sp-green), #16b85a);
    color: #0a0a0a;
    font-size: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s ease;
}
.ai-chat-send:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(30, 215, 96, .35); }
.ai-chat-send:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-chat-foot-meta {
    margin-top: 7px;
    font-size: 10.5px; color: var(--sp-text-3);
    text-align: center;
    letter-spacing: .2px;
}

/* 发送中 … 动画 */
.ai-msg-ai .ai-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ai-typing i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--sp-green);
    animation: aiTyping 1.2s infinite ease-in-out;
}
.ai-typing i:nth-child(2) { animation-delay: .18s; }
.ai-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes aiTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 767.98px) {
    .ai-chat-fab { top: 64px; right: 14px; width: 44px; height: 44px; font-size: 19px; }
    .ai-chat-fab .ai-chat-fab-tip { display: none; }
    .ai-chat-panel {
        top: 12px; right: 12px; left: 12px; bottom: calc(74px + env(safe-area-inset-bottom));
        width: auto; height: auto;
        max-width: none; max-height: none;
        border-radius: 16px;
    }
    .ai-chat-model { width: 118px; }
}

/* ===== 返回顶部悬浮按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 22px; right: 22px;
    z-index: 1050;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sp-green) 0%, #0e9c47 100%);
    color: #0a0a0a;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border: none;
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    box-shadow: 0 4px 18px rgba(30, 215, 96, .4), 0 0 0 1px rgba(255,255,255,.08);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.back-to-top.show {
    opacity: 1; visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 26px rgba(30, 215, 96, .55);
}
.back-to-top:active { transform: scale(.94); }
@media (max-width: 767.98px) {
    .back-to-top { bottom: 74px; right: 14px; width: 42px; height: 42px; font-size: 18px; }
}

/* ========== 重构 v2 新增样式 ========== */

/* 玻璃卡片 */
.glass-card {
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

/* 监控股票卡片 */
.stock-card {
    position: relative;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    overflow: hidden;
}
.stock-card:hover {
    transform: translateY(-3px);
    border-color: rgba(240, 185, 11, .45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.stock-card.active { border-left: 3px solid #f0b90b; }
.stock-name { font-size: 16px; font-weight: 700; color: #e8ecf4; }
.stock-code { font-size: 11.5px; color: #8b93a7; font-family: Consolas, monospace; margin-top: 2px; letter-spacing: .06em; }
.stock-industry {
    display: inline-block; font-size: 10.5px; color: #f0b90b;
    background: rgba(240, 185, 11, .12); border-radius: 4px; padding: 1px 6px; margin-left: 4px;
}
.stock-price { font-size: 24px; font-weight: 700; font-family: Consolas, monospace; line-height: 1.1; }
.stock-chg { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.up-red { color: #ff5d5d !important; }
.down-green { color: #2ee6a8 !important; }
.paused-mask {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(18, 18, 18, .66); color: #8b93a7; font-size: 14px; backdrop-filter: blur(2px);
    z-index: 2;
}

/* 评分环 */
.score-ring {
    --val: 0;
    width: 58px; height: 58px; border-radius: 50%;
    background: conic-gradient(#f0b90b calc(var(--val) * 1%), rgba(255, 255, 255, .09) 0);
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.score-ring::before {
    content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #1a1e28;
}
.score-ring-inner { position: relative; z-index: 1; text-align: center; line-height: 1.1; }
.score-ring-inner b { display: block; font-size: 15px; color: #e8ecf4; font-family: Consolas, monospace; }
.score-ring-inner small { font-size: 9px; color: #8b93a7; }
.score-ring-lg { width: 84px; height: 84px; }
.score-ring-lg::before { inset: 7px; }
.score-ring-lg .score-ring-inner b { font-size: 22px; }
.score-ring-lg .score-ring-inner small { font-size: 10px; }

/* 卡片标题区域 */
.stock-title { min-width: 0; flex: 1; }

/* 卡片底部行：指标 + 按钮 */
.card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}
.card-bottom-row > .d-flex:first-child { min-width: 0; }
.card-bottom-row > .d-flex:last-child { flex-shrink: 0; }

/* 卡片底部指标自适应 */
.card-bottom-row .text-light { font-weight: 600; }

/* 按钮区域不被压缩 */
.card-bottom-row .btn-sm {
    flex-shrink: 0;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
}

/* 暂停遮罩优化 */
.paused-mask {
    z-index: 5;
}
.stock-card:not(.active) .card-bottom-row {
    opacity: .5;
}

/* 空数据兜底文字 */
.stock-name[style*="--"] { color: #6a6a6a; }
