/* ============================================================
   南通云控 · 设备管理系统
   统一 UI 设计系统（侧边栏 + 顶部状态栏 + 明暗主题）
   纯本地资源，无外部 CDN 依赖；全站图标使用内联 SVG。
   ============================================================ */

/* ---------------- 主题变量 ---------------- */
:root {
    --bg: #f2f5fa;
    --bg-soft: #e9eff8;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef2f8;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8eef6;
    --topbar-bg: rgba(255, 255, 255, .82);

    --text: #0d1526;
    --text-2: #50607a;
    --muted: #8a99b0;

    --border: #e3eaf3;
    --border-2: #edf2f8;

    --brand: #2f6bff;
    --brand-600: #1e54e6;
    --brand-50: #eef4ff;
    --brand-100: #dbe7ff;
    --accent: #7c3aed;

    --success: #12a150;
    --success-bg: #e8f8ee;
    --danger: #e11d48;
    --danger-bg: #ffeff2;
    --warning: #d97706;
    --warning-bg: #fff7e6;
    --info: #0891b2;
    --info-bg: #e9fbff;
    --purple: #7c3aed;
    --purple-bg: #f4f0ff;

    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 9px;

    --shadow-xs: 0 1px 2px rgba(13, 21, 38, .05);
    --shadow-sm: 0 1px 2px rgba(13, 21, 38, .04), 0 5px 14px -6px rgba(13, 21, 38, .10);
    --shadow: 0 2px 4px rgba(13, 21, 38, .04), 0 14px 32px -14px rgba(13, 21, 38, .18);
    --shadow-lg: 0 30px 60px -18px rgba(13, 21, 38, .30);

    --sidebar-w: 250px;
    --topbar-h: 62px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
    --bg: #0a1020;
    --bg-soft: #0d1526;
    --surface: #111a2e;
    --surface-2: #16203a;
    --surface-3: #1b2742;
    --sidebar-bg: #0e1729;
    --sidebar-border: #1e2a45;
    --topbar-bg: rgba(14, 23, 41, .82);

    --text: #e8eefb;
    --text-2: #a7b6cf;
    --muted: #6f809d;

    --border: #22304e;
    --border-2: #1b2740;

    --brand: #5b8cff;
    --brand-600: #7aa2ff;
    --brand-50: #16223c;
    --brand-100: #1b2b4d;
    --accent: #a78bfa;

    --success: #34d399;
    --success-bg: #10281f;
    --danger: #fb7185;
    --danger-bg: #2a1420;
    --warning: #fbbf24;
    --warning-bg: #2a2110;
    --info: #22d3ee;
    --info-bg: #0d2630;
    --purple: #a78bfa;
    --purple-bg: #1d1832;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 5px 14px -6px rgba(0, 0, 0, .5);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 34px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 60px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

/* 主题切换时的全局渐变过渡（仅切换瞬间启用，平时不影响性能） */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
    transition: background-color .45s ease, color .45s ease, border-color .45s ease,
                fill .45s ease, stroke .45s ease, box-shadow .45s ease !important;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.62;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
p { margin: 0 0 10px; }
code, kbd, pre { font-family: var(--mono); }
::selection { background: var(--brand-100); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c2cddd; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c3b5c; background-clip: content-box; }

/* ============================================================
   骨架：侧边栏 + 主区
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    transition: width .22s cubic-bezier(.4, 0, .2, 1), transform .22s cubic-bezier(.4, 0, .2, 1);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-group { margin-bottom: 20px; }
.nav-group-title {
    font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding: 0 12px 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-2);
    font-size: 14px; font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
    background: linear-gradient(135deg, var(--brand) 0%, #4d7dff 100%);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(47, 107, 255, .95);
}
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
    margin-left: auto; font-size: 11px; font-weight: 700;
    background: var(--surface-3); color: var(--text-2);
    border-radius: 999px; padding: 1px 8px;
}
.nav-item.active .nav-badge { background: rgba(255, 255, 255, .25); color: #fff; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-border); }
.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    background: var(--surface-2); margin-bottom: 9px;
    overflow: hidden;
}
.user-card .uc-meta { min-width: 0; }
.user-card .uc-meta strong { display: block; font-size: 13.5px; font-weight: 700; }
.user-card .uc-meta small { display: block; font-size: 11.5px; color: var(--muted); }

.avatar {
    width: 32px; height: 32px; flex: none; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff; font-size: 14px; font-weight: 700;
}
.avatar-img { width: 32px; height: 32px; flex: none; border-radius: 10px; object-fit: cover; }

.sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 70;
    background: rgba(6, 12, 24, .5); backdrop-filter: blur(2px);
}

/* 主区域：顶栏 + 内容，整体随页面滚动 */
.main {
    flex: 1; min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    transition: margin-left .22s cubic-bezier(.4, 0, .2, 1);
}

/* 折叠态（桌面端） */
body.sidebar-collapsed .sidebar { width: 74px; }
body.sidebar-collapsed .main { margin-left: 74px; }
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-item .nav-badge,
body.sidebar-collapsed .user-card .uc-meta,
body.sidebar-collapsed .sidebar-foot .btn span { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
body.sidebar-collapsed .user-card { justify-content: center; }
body.sidebar-collapsed .sidebar-foot .btn { padding: 9px; justify-content: center; }

/* ============================================================
   顶部状态栏（随页面一起滚动：下滑滚走、上滑滚回）
   ============================================================ */
.topbar {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    z-index: 60;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    background: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    transition: background-color .3s ease, border-color .3s ease;
}

.topbar-brand {
    display: flex; align-items: center; gap: 12px;
    color: var(--text); min-width: 0; flex: none;
}
.topbar-brand:hover { color: var(--text); }
.brand-img {
    width: 42px; height: 42px; flex: none;
    border-radius: 13px; object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px -8px rgba(13, 21, 38, .55);
}
.brand-mark {
    width: 42px; height: 42px; flex: none;
    border-radius: 13px;
    display: grid; place-items: center;
    background: #2b6470; color: #fff;
    box-shadow: 0 6px 16px -8px rgba(13, 21, 38, .55);
}
.brand-mark svg { width: 23px; height: 23px; stroke-width: 2.2; }
[data-theme="dark"] .brand-mark { background: #93c5d8; color: #0d1526; }
.brand-text { display: flex; flex-direction: column; line-height: 1.16; min-width: 0; }
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

.topbar-page { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--border); }
.topbar-page strong { font-size: 14.5px; font-weight: 700; }
.topbar-page small { font-size: 11.5px; color: var(--muted); }
.topbar-spacer { flex: 1; }

/* 右侧按钮组：连在一起 */
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar-actions .icon-btn:first-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.topbar-actions .icon-btn:last-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.topbar-actions .icon-btn + .icon-btn { margin-left: -11px; }

.icon-btn {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: all .16s ease;
    box-shadow: var(--shadow-xs);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--text); border-color: var(--brand); background: var(--brand-50); }
.icon-btn:active { transform: scale(.96); }
.icon-btn .ic-moon { display: none; }
[data-theme="dark"] .icon-btn .ic-sun { display: none; }
[data-theme="dark"] .icon-btn .ic-moon { display: block; }

.chip-user {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 5px 13px 5px 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13.5px; font-weight: 600; color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: all .16s ease;
}
.chip-user:hover { border-color: var(--brand); color: var(--text); }
.chip-user .avatar { width: 28px; height: 28px; font-size: 13px; border-radius: 50%; }

/* ============================================================
   内容区
   ============================================================ */
.content { padding: 22px 24px 56px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.page-head h1 svg { width: 22px; height: 22px; color: var(--brand); }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 5px; }
.page-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.section-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; margin: 24px 0 13px; }
.section-title svg { width: 17px; height: 17px; color: var(--brand); }
.section-title .count-pill { font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: 999px; padding: 2px 10px; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}
.card--flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title svg { width: 17px; height: 17px; color: var(--brand); }
.card-desc { color: var(--text-2); font-size: 13px; margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 13px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px 17px;
    box-shadow: var(--shadow-xs);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.stat-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 11px; }
.stat-ico svg { width: 18px; height: 18px; }
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.stat--brand .stat-ico { background: var(--brand-50); color: var(--brand); }
.stat--success .stat-ico { background: var(--success-bg); color: var(--success); }
.stat--danger .stat-ico { background: var(--danger-bg); color: var(--danger); }
.stat--warning .stat-ico { background: var(--warning-bg); color: var(--warning); }
.stat--purple .stat-ico { background: var(--purple-bg); color: var(--purple); }
.stat--brand .stat-num { color: var(--brand); }
.stat--success .stat-num { color: var(--success); }
.stat--danger .stat-num { color: var(--danger); }
.stat--warning .stat-num { color: var(--warning); }
.stat--purple .stat-num { color: var(--purple); }

/* ============================================================
   按钮
   ============================================================ */
.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-bd: var(--border);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 15px;
    font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius-xs);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
    box-shadow: var(--shadow-xs);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { --btn-bg: linear-gradient(135deg, #2f6bff, #4d7dff); --btn-fg: #fff; --btn-bd: transparent; }
.btn-primary:hover { --btn-bg: linear-gradient(135deg, #1e54e6, #2f6bff); }
.btn-success { --btn-bg: linear-gradient(135deg, #12a150, #22c55e); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger { --btn-bg: linear-gradient(135deg, #e11d48, #f43f5e); --btn-fg: #fff; --btn-bd: transparent; }
.btn-warning { --btn-bg: linear-gradient(135deg, #d97706, #f59e0b); --btn-fg: #fff; --btn-bd: transparent; }
.btn-info { --btn-bg: linear-gradient(135deg, #0891b2, #06b6d4); --btn-fg: #fff; --btn-bd: transparent; }
.btn-purple { --btn-bg: linear-gradient(135deg, #7c3aed, #a855f7); --btn-fg: #fff; --btn-bd: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-bd: var(--border); --btn-fg: var(--text-2); box-shadow: none; }
.btn-ghost:hover { --btn-bg: var(--surface-3); --btn-fg: var(--text); }
.btn-soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand); --btn-bd: var(--brand-100); box-shadow: none; }
.btn-soft:hover { --btn-bg: var(--brand-100); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; display: flex; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ============================================================
   提示
   ============================================================ */
.alert { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; margin-bottom: 16px; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-success { background: var(--success-bg); border-color: rgba(18, 161, 80, .3); color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: rgba(225, 29, 72, .28); color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: rgba(8, 145, 178, .28); color: var(--info); }
.alert-warning { background: var(--warning-bg); border-color: rgba(217, 119, 6, .3); color: var(--warning); }

.hint { display: flex; gap: 10px; padding: 12px 15px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); }
.hint svg { width: 17px; height: 17px; color: var(--brand); flex: none; margin-top: 2px; }
.hint strong { color: var(--text); }
.hint ul { margin: 8px 0 0; padding-left: 18px; }
.hint li { margin-bottom: 4px; }

/* ============================================================
   表单
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.input, .select, textarea,
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="url"], select, textarea {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(47, 107, 255, .15); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a99b0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }

.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group > input { flex: 1; }

.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 17px; margin-bottom: 16px; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--text-2);
    transition: all .16s ease;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(47, 107, 255, .95); }
.chip.active--success { background: var(--success); border-color: var(--success); }
.chip.active--danger { background: var(--danger); border-color: var(--danger); }
.chip.active--warning { background: var(--warning); border-color: var(--warning); }

/* ============================================================
   徽章 / 状态
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.badge svg { width: 12px; height: 12px; }
.badge-admin { background: var(--danger-bg); color: var(--danger); }
.badge-user { background: var(--brand-50); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-online { background: var(--success); box-shadow: 0 0 0 3.5px rgba(18, 161, 80, .18); animation: pulse 2.2s infinite; }
.dot-offline { background: var(--muted); }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3.5px rgba(18, 161, 80, .18); }
    50% { box-shadow: 0 0 0 7px rgba(18, 161, 80, .04); }
}

/* ============================================================
   设备卡片
   ============================================================ */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(324px, 1fr)); gap: 15px; }
.device-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 17px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.device-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.device-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.device-id { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13.5px; font-weight: 700; word-break: break-all; line-height: 1.35; }
.device-id .avatar-sq {
    width: 34px; height: 34px; border-radius: 11px; flex: none;
    display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand);
}
.device-id .avatar-sq svg { width: 17px; height: 17px; }
.device-id-stack { min-width: 0; }
.device-id-stack small { display: block; font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--muted); }

.kv { display: grid; grid-template-columns: 70px 1fr; gap: 5px 10px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--text); font-weight: 500; word-break: break-all; }
.kv dd.mono { font-family: var(--mono); font-size: 12px; }

.status-line { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status-online { color: var(--success); }
.status-offline { color: var(--muted); }

.remark-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.remark-line .remark-text { color: var(--text-2); word-break: break-all; }
.icon-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--brand); }
.icon-link svg { width: 13px; height: 13px; }

.meta-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.meta-strip b { color: var(--text-2); font-weight: 600; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; margin-top: 11px; }
.status-pill svg { width: 14px; height: 14px; }
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-executed { background: var(--success-bg); color: var(--success); }
.status-idle { background: var(--surface-3); color: var(--text-2); }

.device-actions { display: flex; gap: 8px; margin-top: 13px; }
.device-actions .btn { flex: 1; }
.device-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--border-2); }
.device-foot .btn { flex: 1; }

.empty { grid-column: 1 / -1; text-align: center; padding: 50px 22px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-ico { width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.empty-ico svg { width: 27px; height: 27px; }
.empty h3 { font-size: 16.5px; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 13.5px; max-width: 460px; margin: 0 auto; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
table.tbl th, table.tbl td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--border-2); }
table.tbl th { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: 12px; white-space: nowrap; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.mono { font-family: var(--mono); font-size: 12px; }

/* ============================================================
   代码 / 日志
   ============================================================ */
.code-card { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #0a1020; }
.code-card-bar { display: flex; align-items: center; gap: 9px; padding: 9px 13px; background: #0e1729; border-bottom: 1px solid #1e2a45; color: #93a4c4; font-size: 12px; font-weight: 600; }
.code-card-bar .spacer { flex: 1; }
.code-card-bar .dot3 { display: flex; gap: 6px; }
.code-card-bar .dot3 i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-card pre, pre.code { margin: 0; padding: 17px; max-height: 460px; overflow: auto; color: #cbd5e1; font-family: var(--mono); font-size: 12.6px; line-height: 1.65; white-space: pre; tab-size: 4; }
pre.code { background: #0a1020; border: 1px solid var(--border); border-radius: var(--radius-sm); }
code.inline { background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .88em; color: var(--brand); }

.logview { background: #0a1020; border: 1px solid #1e2a45; border-radius: var(--radius-sm); padding: 17px; color: #cbd5e1; font-family: var(--mono); font-size: 12.6px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; max-height: 66vh; overflow: auto; }

.editor-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.editor-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 13px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.editor-bar .sep { width: 1px; height: 16px; background: var(--border); }
.editor-bar .spacer { flex: 1; }
.editor-bar strong { color: var(--text); font-weight: 700; }
textarea.editor { width: 100%; min-height: 440px; padding: 17px; border: none; outline: none; resize: vertical; background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.7; tab-size: 4; }

/* ============================================================
   标签页
   ============================================================ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 18px; overflow-x: auto; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: none; background: transparent; border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: all .16s ease; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs); }

/* ============================================================
   脚本卡片 / 邀请码
   ============================================================ */
.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 13px; }
.script-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px;
    box-shadow: var(--shadow-xs);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.script-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.script-card .name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; word-break: break-all; }
.script-card .name svg { width: 17px; height: 17px; color: var(--purple); flex: none; }
.script-card .meta { display: flex; gap: 13px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 9px 0 13px; }
.script-card .meta svg { width: 13px; height: 13px; vertical-align: -1.5px; margin-right: 3px; }
.script-card .acts { display: flex; gap: 8px; margin-top: auto; }
.script-card .acts .btn { flex: 1; }

.code-mono { font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .06em; color: var(--brand); word-break: break-all; }

/* ============================================================
   设备选择
   ============================================================ */
.pickall { display: flex; align-items: center; gap: 9px; padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; margin-bottom: 11px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; max-height: 360px; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.pick { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); cursor: pointer; transition: all .16s ease; }
.pick:hover { border-color: var(--brand); background: var(--brand-50); }
.pick input { margin: 2px 0 0; flex: none; }
.pick .t { font-weight: 600; font-size: 13px; word-break: break-all; }
.pick .s { font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* ============================================================
   分页
   ============================================================ */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 13px; flex-wrap: wrap; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); margin-bottom: 16px; }
.pager-info { font-size: 13px; color: var(--text-2); }
.pager-info b { color: var(--text); }
.pager-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pager-right form { display: flex; align-items: center; gap: 9px; }
.pager-right form label { white-space: nowrap; }
.pager-right input[type="number"] { width: 84px; padding: 7px 10px; }

/* ============================================================
   模态框
   ============================================================ */
.modal { display: none; position: fixed; inset: 0; z-index: 900; background: rgba(6, 12, 24, .58); backdrop-filter: blur(3px); padding: 22px; overflow: auto; }
.modal.open { display: grid; place-items: center; }
.modal-box { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal-box.lg { max-width: 640px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { padding: 17px 21px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
.modal-head h3 svg { width: 17px; height: 17px; color: var(--brand); }
.modal-body { padding: 19px 21px; }
.modal-foot { padding: 14px 21px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 9px; background: var(--surface-2); }
.modal-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px 7px; border-radius: 7px; display: grid; place-items: center; }
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-x svg { width: 17px; height: 17px; }

/* ============================================================
   Toast
   ============================================================ */
#toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #0d1526; color: #fff; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); animation: slide-up .24s ease; }
[data-theme="dark"] .toast { background: #1b2742; border: 1px solid #2c3b5c; }
.toast svg { width: 16px; height: 16px; }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   地址 / 复制
   ============================================================ */
.url-row { display: flex; gap: 9px; align-items: stretch; }
.url-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); font-family: var(--mono); font-size: 12.6px; color: var(--text-2); word-break: break-all; }
.url-box b { color: var(--brand); font-weight: 700; }

/* ============================================================
   人机验证步骤
   ============================================================ */
.steps-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.step-pill { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.step-pill .n { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.step-pill.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.step-pill.active .n { background: var(--brand); color: #fff; }
.step-pill.done { border-color: rgba(18, 161, 80, .4); background: var(--success-bg); color: var(--success); }
.step-pill.done .n { background: var(--success); color: #fff; }
.step-pill svg { width: 14px; height: 14px; }
.steps-bar .line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; min-width: 10px; }

.captcha-img { height: 44px; width: auto; border-radius: var(--radius-xs); border: 1px solid var(--border); cursor: pointer; background: var(--surface-2); display: block; }

.verify-block { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.verify-block + .verify-block { margin-top: 12px; }
.verify-block h4 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.verify-block h4 svg { width: 16px; height: 16px; color: var(--brand); }
.verify-block p.tip { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.verify-block.locked { opacity: .5; pointer-events: none; }

/* ============================================================
   登录 / 注册
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }
.auth-aside {
    position: relative; padding: 50px 48px;
    color: #eaf1ff;
    background:
        radial-gradient(760px 460px at 12% 6%, rgba(47, 107, 255, .55) 0%, transparent 62%),
        radial-gradient(620px 420px at 88% 92%, rgba(124, 58, 237, .48) 0%, transparent 58%),
        linear-gradient(158deg, #081127 0%, #0d1a3a 52%, #101331 100%);
    display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.auth-aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 28% 28%, #000 0%, transparent 76%);
    -webkit-mask-image: radial-gradient(circle at 28% 28%, #000 0%, transparent 76%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand-img { width: 62px; height: 62px; border-radius: 18px; border: 2px solid rgba(255, 255, 255, .22); box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .9); }
.auth-aside h2 { color: #fff; font-size: 30px; line-height: 1.24; letter-spacing: -.02em; margin: 22px 0 13px; }
.auth-aside p.lead { color: #a9bce0; font-size: 14px; max-width: 440px; }
.auth-feats { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: #cddcf5; }
.auth-feats svg { width: 18px; height: 18px; color: #4ade80; flex: none; margin-top: 2px; }
.auth-badge { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .17); font-size: 12px; font-weight: 600; color: #dbe6ff; width: fit-content; }
.auth-badge svg { width: 15px; height: 15px; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth-theme { position: absolute; top: 20px; right: 20px; }
.auth-card { width: 100%; max-width: 404px; }
.auth-card .logo-sm { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.auth-card .logo-sm img { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; border: 1px solid var(--border); }
.auth-card .logo-sm strong { font-size: 16px; font-weight: 800; display: block; }
.auth-card .logo-sm small { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }
.auth-card h1 { font-size: 23px; margin-bottom: 5px; }
.auth-card > p.sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; }
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ============================================================
   安装向导
   ============================================================ */
.install-wrap { max-width: 860px; margin: 0 auto; padding: 32px 22px 60px; }
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.step.done { color: var(--success); border-color: rgba(18, 161, 80, .4); background: var(--success-bg); }
.step.done .n { background: var(--success); color: #fff; }
.step.active { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 8px 20px -10px rgba(47, 107, 255, .95); }
.step.active .n { background: rgba(255, 255, 255, .25); color: #fff; }
.step-line { flex: 1; min-width: 12px; height: 2px; background: var(--border); border-radius: 2px; }

.check-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: var(--radius-xs); margin-bottom: 9px; background: var(--surface-2); }
.check-row .ck-name { font-weight: 600; font-size: 13px; }
.check-row .ck-desc { font-size: 11.5px; color: var(--muted); }
.check-pass { color: var(--success); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.check-fail { color: var(--danger); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   杂项
   ============================================================ */
.disclaimer { margin-top: 24px; padding: 14px 17px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; } .mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 15px; }
.nowrap { white-space: nowrap; } .center { text-align: center; } .hidden { display: none !important; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
    .main { margin-left: 0; }
    .topbar { padding: 0 12px; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
    body.sidebar-collapsed .main { margin-left: 0; }
    body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-group-title,
    body.sidebar-collapsed .nav-badge, body.sidebar-collapsed .uc-meta { display: revert; }
    body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 10px 12px; }
    .topbar-page { display: none; }
    .content { padding: 16px 14px 46px; }
    .page-head h1 { font-size: 21px; }
    .device-grid, .script-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .brand-text small { display: none; }
    .brand-text strong { font-size: 16px; }
    .brand-img, .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
    .device-actions, .script-card .acts, .btn-row { flex-direction: column; }
    .device-actions .btn, .btn-row .btn, .script-card .acts .btn { width: 100%; }
    .pager { flex-direction: column; align-items: stretch; }
    .topbar { gap: 8px; }
    .modal { padding: 10px; }
}

/* ============================================================
   模拟登录提示条 / 独立后台
   ============================================================ */
.impersonate-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 9px 20px;
    background: var(--warning-bg);
    border-bottom: 1px solid #f0c27b;
    color: #8a4b00;
    font-size: 13px; font-weight: 600;
}
.impersonate-bar svg { width: 16px; height: 16px; flex: none; }
.impersonate-bar strong { font-weight: 800; }

.mode-admin .topbar { border-bottom-color: var(--brand-100); }
[data-theme="dark"] .mode-admin .topbar { border-bottom-color: var(--brand-100); }

.expiry-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.expiry-ok { background: var(--success-bg); color: var(--success); }
.expiry-soon { background: var(--warning-bg); color: var(--warning); }
.expiry-dead { background: var(--danger-bg); color: var(--danger); }
.expiry-forever { background: var(--purple-bg); color: var(--purple); }

/* ============================================================
   折叠区（云端编译页的配置区）
   ============================================================ */
details.card > summary { outline: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    color: var(--muted);
    transition: transform .18s ease;
}
details.card[open] > summary::before { transform: rotate(90deg); }
details.card > summary svg { width: 18px; height: 18px; vertical-align: -3px; }

/* ============================================================
   生成格式选择（bin / sh / 面具模块）
   ============================================================ */
.fmt-pick {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.fmt-pick label { cursor: pointer; }
.fmt-pick input { display: none; }
.fmt-pick span {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 999px;
    border: 1.5px solid var(--border);
    font-size: 13px; font-weight: 700; color: var(--muted);
    transition: all .18s ease;
}
.fmt-pick span svg { width: 16px; height: 16px; }
.fmt-pick label:hover span { border-color: var(--brand); color: var(--text); }
.fmt-pick input:checked + span {
    background: var(--brand-100); border-color: var(--brand); color: var(--brand);
}

/* ============================================================
   插件中心 / 插件面板
   ============================================================ */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.plugin-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    padding: 15px; display: flex; flex-direction: column; gap: 11px; transition: .18s ease;
}
.plugin-card:hover { border-color: var(--brand); box-shadow: 0 12px 26px -18px rgba(47,107,255,.9); transform: translateY(-1px); }
.plugin-card .pc-head { display: flex; align-items: center; gap: 11px; }
.plugin-card .pc-ico {
    width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100);
}
.plugin-card .pc-ico svg { width: 21px; height: 21px; }
.plugin-card .pc-name { font-size: 14.5px; font-weight: 700; color: var(--text); }
.plugin-card .pc-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.plugin-card .pc-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.65; flex: 1; }
.plugin-card .pc-cmd {
    font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
    background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
    padding: 6px 9px; max-height: 62px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.pc-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 插件面板内的界面容器 */
.plugin-surface { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 16px; }
.plugin-surface iframe { width: 100%; min-height: 420px; border: 0; border-radius: var(--radius-sm); background: var(--surface); }
.plg-section { margin-bottom: 18px; }
.plg-section:last-child { margin-bottom: 0; }
.plg-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.plg-desc { font-size: 12px; color: var(--muted); font-weight: 500; }
.plg-divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.plg-log {
    margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
    white-space: pre-wrap; word-break: break-all; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
    max-height: 320px; overflow: auto; color: var(--text-2);
}
.plg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.plg-table th, .plg-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.plg-table th { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: 12px; }
.plg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 11px; }
.plg-stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.plg-stat .v { font-size: 21px; font-weight: 800; color: var(--text); }
.plg-stat .l { font-size: 12px; color: var(--muted); margin-top: 3px; }
.plg-progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.plg-progress > i { display: block; height: 100%; background: var(--brand); transition: width .3s ease; }
.plg-stages { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--muted); }
.plg-stages .st.done { color: var(--success); font-weight: 700; }
.plg-stages .st.cur { color: var(--brand); font-weight: 700; }
.plg-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 插件界面内的图标尺寸约束（避免内联 SVG 撑满容器） */
.plugin-surface svg { width: 15px; height: 15px; flex: none; }
.plugin-surface .plg-title svg { width: 16px; height: 16px; }
.plugin-surface .btn svg { width: 15px; height: 15px; }
.plugin-surface .plg-stat .l svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.plugin-surface .plg-stat .l { display: flex; align-items: center; gap: 4px; }
.plugin-surface .plg-log { min-height: 44px; }
.plugin-surface .chip-group { margin-top: 0; }

/* ============================================================
   截图放大预览（命令发送页 / 插件页共用）
   ============================================================ */
.cmd-shot { margin-top: 2px; }
.cmd-shot-img {
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
    background: var(--surface-2); padding: 8px; text-align: center;
}
.cmd-shot-img img {
    max-width: 100%; max-height: 460px; border-radius: 8px; display: block; margin: 0 auto;
    cursor: zoom-in; box-shadow: 0 8px 24px -16px rgba(0,0,0,.55);
}
.cmd-shot-note { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.shot-lightbox {
    position: fixed; inset: 0; background: rgba(8, 12, 24, .88); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.shot-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; }
