/* 注册后台 v3 UI - Linear / Vercel 风格 + 平面线性图标 (Lucide CDN) */
/* 黎总要: 正规后台逻辑 + 平面图标 + 按钮不堆顶部 + 对齐小雷Claw */

:root {
    /* 颜色 - Linear 紫蓝主色 */
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --border: #e5e5e7;
    --border-strong: #d2d2d7;
    --text-1: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #aeaeb2;
    --primary: #5e6ad2;
    --primary-hover: #4d59c4;
    --primary-light: #eef0fb;
    --primary-text: #ffffff;
    --success: #10b981;
    --success-light: #d1fae5;
    --success-text: #065f46;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #92400e;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-text: #991b1b;
    --gray: #6b7280;
    --gray-light: #f3f4f6;

    /* 形状 */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;

    /* 阴影 (极少用) */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* 字体 */
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

    /* 尺寸 */
    --topbar-h: 52px;
    --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Lucide 图标 (线性 1.5px stroke) ===== */
.icon {
    display: inline-block;
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 1.75;
    stroke-linecap: round; stroke-linejoin: round;
    vertical-align: middle;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* ===== TOP BAR (52px, 极简) ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 16px; gap: 16px;
    z-index: 100;
}
.topbar .brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 600;
    color: var(--text-1);
    width: calc(var(--sidebar-w) - 16px);
}
.topbar .brand-mark {
    width: 28px; height: 28px;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.topbar .brand-mark img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.topbar .topbar-status {
    flex: 1; display: flex; align-items: center; gap: 20px;
    font-size: 12px; color: var(--text-2);
}
.topbar .topbar-status .stat {
    display: flex; align-items: center; gap: 6px;
}
.topbar .topbar-status .stat-label { color: var(--text-3); }
.topbar .topbar-status .stat-value { color: var(--text-1); font-weight: 500; }
.topbar .topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .health-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; background: var(--success-light);
    color: var(--success-text);
    border-radius: 12px; font-size: 11px; font-weight: 600;
}
.health-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
}

/* 小雷 Claw 对接状态徽章 — v4.6 */
.topbar .xiaolei-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
    border: 1px solid transparent;
    transition: all .2s ease;
}
.topbar .xiaolei-pill.online {
    background: #eef2ff; color: #4f46e5;
    border-color: #c7d2fe;
}
.topbar .xiaolei-pill.offline {
    background: #fef2f2; color: #dc2626;
    border-color: #fecaca;
}
.xiaolei-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: xiaolei-pulse 2s infinite;
}
.topbar .xiaolei-pill.offline .xiaolei-dot {
    animation: none;
    opacity: 0.6;
}
@keyframes xiaolei-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
.topbar .icon-btn {
    width: 32px; height: 32px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.topbar .icon-btn:hover { background: var(--gray-light); color: var(--text-1); }
.topbar .user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px 4px 4px; border-radius: 16px;
    cursor: pointer; border: 1px solid transparent;
}
.topbar .user-chip:hover { background: var(--gray-light); }
.topbar .user-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white; font-size: 11px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}

/* ===== SIDEBAR (240px, 侧边导航) ===== */
.sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 12px 8px;
    overflow-y: auto;
    z-index: 99;
}
.sidebar .nav-group { margin-bottom: 16px; }
.sidebar .nav-group-title {
    font-size: 11px; font-weight: 600; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.3px;
    padding: 8px 12px 6px;
}
.sidebar .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    border-radius: var(--radius);
    color: var(--text-2); font-size: 13px; font-weight: 500;
    margin-bottom: 1px; cursor: pointer;
    transition: all 0.1s;
}
.sidebar .nav-item:hover { background: var(--gray-light); color: var(--text-1); text-decoration: none; }
.sidebar .nav-item.active { background: var(--primary-light); color: var(--primary); }
.sidebar .nav-item.active .icon { color: var(--primary); }
.sidebar .nav-item .nav-label { flex: 1; }
.sidebar .nav-item .nav-count {
    font-size: 10px; padding: 1px 6px;
    background: var(--gray-light); border-radius: 8px;
    color: var(--text-3); font-weight: 600;
}
.sidebar .nav-item.active .nav-count { background: var(--primary); color: white; }

/* ===== MAIN CONTENT ===== */
.main {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 20px 24px;
    min-height: calc(100vh - var(--topbar-h));
    max-width: 1600px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-2);
    margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text-1); }
.breadcrumb .sep { color: var(--text-3); }
.breadcrumb .current { color: var(--text-1); font-weight: 500; }

/* ===== Page Header ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 600; margin: 0; color: var(--text-1); }
.page-subtitle { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-1);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--surface-hover); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .icon { flex-shrink: 0; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--gray-light); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-lg { padding: 9px 16px; font-size: 14px; }

/* Icon-only button (行内操作) */
.icon-btn-sm {
    width: 24px; height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.1s;
}
.icon-btn-sm:hover { background: var(--gray-light); color: var(--text-1); border-color: var(--border); }
.icon-btn-sm.danger:hover { background: var(--danger-light); color: var(--danger); }
.icon-btn-sm.success:hover { background: var(--success-light); color: var(--success); }

/* ===== Cards (极简, 极少阴影) ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 600; margin: 0; color: var(--text-1); }
.card-subtitle { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-body { padding: 16px; }
.card-toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
}
.card-toolbar .filters { display: flex; gap: 6px; flex-wrap: wrap; }

/* KPI Card */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 600; margin-top: 4px; color: var(--text-1); letter-spacing: -0.02em; }
.kpi-delta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.kpi-card.accent-success .kpi-value { color: var(--success); }
.kpi-card.accent-warning .kpi-value { color: var(--warning); }
.kpi-card.accent-danger .kpi-value { color: var(--danger); }
.kpi-card.accent-primary .kpi-value { color: var(--primary); }

/* ===== Tables (Linear 风格) ===== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: var(--gray-light);
    text-align: left;
    padding: 8px 14px;
    font-size: 11px; font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr.selected { background: var(--primary-light); }
td .row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ===== Form ===== */
.input, .select, .textarea {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-1);
    font-family: inherit;
    transition: border 0.1s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}
.input::placeholder { color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.form-row { display: flex; gap: 8px; align-items: center; }
.form-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; display: block; font-weight: 500; }

/* ===== Badges (极简胶囊) ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px; font-weight: 600;
    white-space: nowrap;
}
.badge-success, .badge-active, .badge-enabled, .badge-running { background: var(--success-light); color: var(--success-text); }
.badge-warning, .badge-registering, .badge-pending { background: var(--warning-light); color: var(--warning-text); }
.badge-danger, .badge-suspended, .badge-banned, .badge-failed { background: var(--danger-light); color: var(--danger-text); }
.badge-gray, .badge-dormant, .badge-cancelled, .badge-timeout, .badge-disabled { background: var(--gray-light); color: var(--text-2); }
.badge-info { background: var(--primary-light); color: var(--primary); }

/* ===== Status / Progress bars ===== */
.bar-row { margin: 8px 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; color: var(--text-2); }
.bar-track { background: var(--gray-light); height: 6px; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ===== Empty / Loading ===== */
.empty {
    text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty .icon { width: 40px; height: 40px; opacity: 0.3; margin-bottom: 8px; }
.empty .text { font-size: 13px; }
.empty .text a { color: var(--primary); font-weight: 500; }

.loading {
    text-align: center; padding: 40px; color: var(--text-3); font-size: 13px;
}

/* ===== Drawer (右侧详情) ===== */
.drawer-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s;
    z-index: 200;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 480px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.2s ease-out;
    z-index: 201;
    display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.drawer-title { font-size: 14px; font-weight: 600; margin: 0; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }

/* ===== Toast ===== */
#toast {
    position: fixed; top: 70px; right: 20px;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--text-1);
    color: white;
    font-size: 13px;
    box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(-8px);
    transition: all 0.15s;
    z-index: 9999;
    max-width: 380px;
}
#toast.show { opacity: 0.95; transform: translateY(0); }
#toast.success { background: var(--success); }
#toast.error { background: var(--danger); }
#toast.warning { background: var(--warning); }

/* ===== Platform cards ===== */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.platform-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: border 0.1s;
}
.platform-card:hover { border-color: var(--border-strong); }
.platform-card.enabled { border-left: 3px solid var(--success); }
.platform-card.disabled { border-left: 3px solid var(--border); opacity: 0.85; }
.platform-card .pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.platform-card .pc-name { font-size: 14px; font-weight: 600; }
.platform-card .pc-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.platform-card .pc-stats { display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.platform-card .pc-stats strong { color: var(--text-1); display: block; font-size: 13px; }
.platform-card .pc-actions { margin-top: 10px; display: flex; gap: 6px; }

/* ===== Quick links ===== */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.quick-link {
    display: flex; gap: 10px; align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none; color: var(--text-1);
    transition: all 0.1s;
}
.quick-link:hover { border-color: var(--primary); background: var(--primary-light); text-decoration: none; }
.quick-icon {
    width: 32px; height: 32px;
    background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.quick-link:hover .quick-icon { background: var(--primary); color: white; }
.quick-title { font-weight: 600; font-size: 13px; }
.quick-desc { font-size: 11px; color: var(--text-2); margin-top: 1px; }

/* ===== Layout helpers ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-bold { font-weight: 600; }
.text-mono { font-family: var(--font-mono); font-size: 12px; }

code { background: var(--gray-light); padding: 1px 6px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; }

/* ============ 仿真手机 (v4 新增) ============ */
.phone-frame {
    width: 240px; height: 460px;
    background: #1d1d1f;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), inset 0 0 0 2px #2a2a2e;
    margin: 0 auto;
    position: relative;
}
.phone-frame::before {
    /* 刘海 */
    content: ''; position: absolute; top: 16px; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 22px;
    background: #1d1d1f;
    border-radius: 0 0 12px 12px;
    z-index: 2;
}
.phone-screen {
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f3 100%);
    border-radius: 26px;
    padding: 36px 14px 14px;
    overflow: hidden;
    position: relative;
}
.phone-status-bar {
    position: absolute; top: 18px; left: 0; right: 0;
    display: flex; justify-content: space-between;
    padding: 0 18px;
    font-size: 10px; color: var(--text-2);
    font-weight: 600;
    z-index: 1;
}
.phone-status-bar .dots {
    display: flex; gap: 3px;
}
.phone-status-bar .dots span {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--text-2);
}
.phone-content {
    display: flex; flex-direction: column;
    height: 100%; gap: 8px;
}
.phone-app-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin-top: 6px;
}
.phone-app {
    aspect-ratio: 1;
    background: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    color: var(--primary);
}
.phone-status-card {
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-top: 8px;
}
.phone-status-card .ps-label {
    font-size: 9px; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.3px;
    font-weight: 600;
}
.phone-status-card .ps-value {
    font-size: 13px; font-weight: 600; color: var(--text-1);
    margin-top: 2px;
}
.phone-status-card .ps-bar {
    height: 3px; background: var(--gray-light); border-radius: 2px;
    margin-top: 6px; overflow: hidden;
}
.phone-status-card .ps-bar .fill {
    height: 100%; background: var(--primary);
    transition: width 0.4s;
}
.phone-status-card.idle .ps-bar .fill { background: var(--gray-3); }
.phone-status-card.registering .ps-bar .fill { background: var(--primary); }
.phone-status-card.crawling .ps-bar .fill { background: var(--success); }
.phone-status-card.nurturing .ps-bar .fill { background: var(--warning); }
.phone-home-bar {
    position: absolute; bottom: 6px; left: 50%;
    transform: translateX(-50%);
    width: 100px; height: 4px;
    background: var(--text-1);
    border-radius: 2px;
    opacity: 0.5;
}
.phone-floating-status {
    /* 仿真手机旁边的实时状态文字 */
    display: flex; flex-direction: column; gap: 6px;
}
.phone-floating-status .pf-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: white;
    border: 1px solid var(--border); border-radius: var(--radius);
}
.phone-floating-status .pf-label {
    font-size: 11px; color: var(--text-2);
    text-transform: uppercase; font-weight: 600;
    min-width: 60px;
}
.phone-floating-status .pf-value {
    font-size: 13px; font-weight: 600; color: var(--text-1);
}
.phone-floating-status .pf-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s ease-in-out infinite;
}
.phone-floating-status .pf-pulse.warn { background: var(--warning); }
.phone-floating-status .pf-pulse.idle { background: var(--text-3); animation: none; }

/* 仿真手机容器 (工作台布局) */
.phone-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
}
.phone-info-side {
    display: flex; flex-direction: column; gap: 12px;
}
@media (max-width: 900px) {
    .phone-container { grid-template-columns: 1fr; }
}

/* ============ 嵌套导航 (养号管理 二级菜单 - v4.3.1 默认收起点击展开) ============ */
.nav-group-sub {
    margin-bottom: 2px;
}
.nav-item.nav-parent {
    font-weight: 600;
    cursor: pointer;
}
.nav-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    opacity: 0.5;
}
.nav-group-sub.open .nav-chevron {
    transform: rotate(90deg);
    opacity: 0.9;
}
/* 默认收起: max-height 0 + opacity 0 */
.nav-sub {
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}
/* 展开 */
.nav-group-sub.open .nav-sub {
    max-height: 400px;
    opacity: 1;
    margin-top: 2px;
    margin-bottom: 6px;
    padding-top: 4px;
    padding-bottom: 4px;
}
.sidebar .nav-item.nav-child {
    padding: 6px 12px;
    font-size: 12.5px;
    color: var(--text-2);
    margin-bottom: 1px;
}
.sidebar .nav-item.nav-child:hover {
    background: var(--gray-light);
    color: var(--text-1);
}
.sidebar .nav-item.nav-child.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}
.sidebar .nav-item.nav-child .icon {
    width: 14px;
    height: 14px;
}

/* ============ 设备选择器 + 矩阵 (v4.4) ============ */
.device-section {
    margin-bottom: 12px;
}
.device-section-header {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 600;
}
.ds-title { flex: 1; }
.ds-stats {
    display: flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: var(--gray-light);
    border-radius: 10px;
    font-size: 11px;
}
.ds-stats strong { color: var(--success); }
.ds-dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.ds-dot.online { background: var(--success); animation: pulse 2s infinite; }
.ds-dot.idle { background: var(--gray-3); }
.ds-dot.busy { background: var(--warning); animation: pulse 1s infinite; }
.ds-dot.offline { background: var(--danger); }
.ds-dot.maintenance { background: var(--text-3); }
.ds-count { color: var(--text-3); margin-left: auto; font-size: 11px; }

.device-matrix {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.device-matrix-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}
.device-matrix-item:last-child { border-bottom: none; }
.device-matrix-item:hover { background: var(--gray-light); }
.device-matrix-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding-left: 7px;
}
.device-matrix-item .dm-name {
    flex: 1; font-size: 12px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.device-matrix-item .dm-meta {
    font-size: 10px; color: var(--text-3);
    max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.device-matrix-item .dm-type {
    font-size: 10px; padding: 1px 5px;
    background: var(--gray-light); border-radius: 3px;
    color: var(--text-3); font-weight: 500;
}
