/**
 * 智慧小宝 · 云后台壳
 * 真正风格皮肤（材质/密度/阴影/圆角/侧栏形态），默认「atelier」高端工坊感
 * 按钮刻意紧凑，避免肥大控件
 */

/* ========== 结构变量（皮肤可覆写） ========== */
:root {
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", sans-serif;
    --mono: Consolas, "Sarasa Mono SC", ui-monospace, monospace;
    --rail-w: 56px;
    --menu-w: 196px;
    --side-w: calc(var(--rail-w) + var(--menu-w));
    --space: 26px;
    --radius: 2px;
    --radius-lg: 4px;
    --btn-h: 26px;
    --btn-px: 10px;
    --btn-py: 3px;
    --btn-fs: 12px;
    --input-h: 28px;
    --input-fs: 12.5px;
    --zone-head-bg: transparent;
    --side-pattern: none;
    --page-pattern: none;
    --card-glow: none;
    --hairline: 1px solid var(--border);
    --elev-1: none;
    --elev-2: 0 10px 40px rgba(0, 0, 0, 0.12);
    --modal-radius: 6px;
    --top-h: 48px;
    --brand-mark: "";
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

/* ========== 皮肤：atelier · 高端工坊（默认） ========== */
html[data-skin="atelier"],
html:not([data-skin]) {
    --bg: #ebe6df;
    --bg-deep: #e2dcd3;
    --card: #f7f4ef;
    --card-solid: #fbf9f6;
    --text: #1c1916;
    --muted: #6f675e;
    --accent: #8a4b2a;
    --accent-soft: rgba(138, 75, 42, 0.1);
    --accent-hover: #6e3a1f;
    --ok: #2f6b4f;
    --ok-soft: rgba(47, 107, 79, 0.1);
    --danger: #a33a32;
    --danger-soft: rgba(163, 58, 50, 0.1);
    --border: #cfc5b8;
    --border-strong: #b7aa9a;
    --side: #211e1b;
    --side-text: #e8e2d8;
    --side-muted: #9a9186;
    --side-hover: rgba(255, 248, 238, 0.06);
    --side-on-bg: rgba(138, 75, 42, 0.22);
    --side-on-bar: #c47a4a;
    --input: #f1ebe3;
    --input-focus: #fffdf9;
    --top: #f7f4ef;
    --elev-1: 0 1px 0 rgba(33, 30, 27, 0.04), 0 8px 24px rgba(33, 30, 27, 0.06);
    --elev-2: 0 18px 50px rgba(33, 30, 27, 0.18);
    --radius: 1px;
    --radius-lg: 3px;
    --page-pattern:
        linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 120px),
        repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(33, 30, 27, 0.03) 47px, rgba(33, 30, 27, 0.03) 48px);
    --side-pattern: linear-gradient(180deg, #292521 0%, #211e1b 40%, #1a1815 100%);
    --zone-head-bg: linear-gradient(180deg, #fbf8f3, #f3eee7);
    --card-glow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ========== 皮肤：obsidian · 黑金控制台 ========== */
html[data-skin="obsidian"] {
    --bg: #0d0f12;
    --bg-deep: #090b0e;
    --card: #151922;
    --card-solid: #1a1f2a;
    --text: #e8e6e1;
    --muted: #8b909a;
    --accent: #c6a15b;
    --accent-soft: rgba(198, 161, 91, 0.14);
    --accent-hover: #d4b36e;
    --ok: #5faf86;
    --ok-soft: rgba(95, 175, 134, 0.14);
    --danger: #d26666;
    --danger-soft: rgba(210, 102, 102, 0.14);
    --border: #2a3140;
    --border-strong: #3a4458;
    --side: #0a0c10;
    --side-text: #d5d2cb;
    --side-muted: #7a808c;
    --side-hover: rgba(198, 161, 91, 0.08);
    --side-on-bg: rgba(198, 161, 91, 0.12);
    --side-on-bar: #c6a15b;
    --input: #10141c;
    --input-focus: #1c2230;
    --top: #10131a;
    --elev-1: 0 0 0 1px rgba(198, 161, 91, 0.06), 0 12px 28px rgba(0, 0, 0, 0.35);
    --elev-2: 0 24px 60px rgba(0, 0, 0, 0.55);
    --radius: 2px;
    --radius-lg: 4px;
    --page-pattern:
        radial-gradient(900px 400px at 10% -10%, rgba(198, 161, 91, 0.08), transparent 55%),
        linear-gradient(180deg, #11151c, #0d0f12);
    --side-pattern: linear-gradient(180deg, #10131a, #0a0c10);
    --zone-head-bg: linear-gradient(180deg, #1b2130, #151922);
    --card-glow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --btn-h: 26px;
}

/* ========== 皮肤：porcelain · 瓷器精密 ========== */
html[data-skin="porcelain"] {
    --bg: #f2f3f5;
    --bg-deep: #e8eaee;
    --card: #ffffff;
    --card-solid: #ffffff;
    --text: #14171c;
    --muted: #6b7280;
    --accent: #1f4b7a;
    --accent-soft: rgba(31, 75, 122, 0.08);
    --accent-hover: #16385c;
    --ok: #1f7a52;
    --ok-soft: rgba(31, 122, 82, 0.08);
    --danger: #b42318;
    --danger-soft: rgba(180, 35, 24, 0.08);
    --border: #e2e5ea;
    --border-strong: #c9ced6;
    --side: #f7f8fa;
    --side-text: #2a3038;
    --side-muted: #8b93a0;
    --side-hover: rgba(31, 75, 122, 0.06);
    --side-on-bg: #ffffff;
    --side-on-bar: #1f4b7a;
    --input: #f7f8fa;
    --input-focus: #ffffff;
    --top: #ffffff;
    --elev-1: 0 1px 2px rgba(20, 23, 28, 0.04), 0 6px 16px rgba(20, 23, 28, 0.04);
    --elev-2: 0 16px 40px rgba(20, 23, 28, 0.12);
    --radius: 6px;
    --radius-lg: 10px;
    --side-w: 220px;
    --page-pattern: none;
    --side-pattern: none;
    --zone-head-bg: #fbfbfc;
    --card-glow: none;
    --btn-h: 26px;
    --modal-radius: 12px;
}

/* ========== 皮肤：ink · 水墨留白 ========== */
html[data-skin="ink"] {
    --bg: #f4f1ea;
    --bg-deep: #ebe6db;
    --card: #fffcf6;
    --card-solid: #fffcf6;
    --text: #1a1a1a;
    --muted: #6a655c;
    --accent: #1f3d2f;
    --accent-soft: rgba(31, 61, 47, 0.08);
    --accent-hover: #14281f;
    --ok: #2d6a4f;
    --ok-soft: rgba(45, 106, 79, 0.1);
    --danger: #9b2226;
    --danger-soft: rgba(155, 34, 38, 0.08);
    --border: #d9d2c4;
    --border-strong: #bfb6a4;
    --side: #1a1f1c;
    --side-text: #ece7dc;
    --side-muted: #9aa095;
    --side-hover: rgba(255, 255, 255, 0.05);
    --side-on-bg: rgba(236, 231, 220, 0.08);
    --side-on-bar: #d4c4a0;
    --input: #f7f3ea;
    --input-focus: #fffdf8;
    --top: #fffcf6;
    --elev-1: 0 1px 0 rgba(26, 26, 26, 0.04);
    --elev-2: 0 20px 48px rgba(26, 26, 26, 0.14);
    --radius: 0;
    --radius-lg: 0;
    --page-pattern:
        radial-gradient(circle at 100% 0%, rgba(31, 61, 47, 0.05), transparent 40%);
    --side-pattern: linear-gradient(180deg, #222826, #1a1f1c);
    --zone-head-bg: #f7f2e8;
    --card-glow: none;
}

body.admin-body {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}
.breadcrumb{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px;margin-bottom:2px}.breadcrumb a{color:var(--muted);text-decoration:none}.breadcrumb a:hover{color:var(--accent)}.page-title-line{display:flex;align-items:center;gap:9px}.page-title-line h1{margin:0}.badge.environment{border-color:var(--border-strong);background:var(--accent-soft);color:var(--accent)}
.list-toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:var(--hairline);background:var(--card-solid)}.filter-bar,.bulk-bar,.pager{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.filter-bar .field{min-width:140px;margin:0}.filter-bar .field.search{min-width:220px}.bulk-bar[hidden]{display:none}.bulk-count{color:var(--accent);font-weight:600}.table-scroll{width:100%;overflow:auto}.table-scroll table{min-width:720px}.check-col{width:38px;text-align:center}.pager{justify-content:flex-end;padding:12px 14px;border-top:var(--hairline)}.pager-info{color:var(--muted);margin-right:auto}.state-box{display:flex;min-height:180px;padding:28px;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted)}.state-box strong{color:var(--text);font-size:15px;margin-bottom:5px}.state-box.error strong{color:var(--danger)}.state-icon{width:36px;height:36px;border:1px solid var(--border-strong);display:grid;place-items:center;margin-bottom:10px;color:var(--accent)}
@media(max-width:720px){.list-toolbar,.filter-bar,.bulk-bar{align-items:stretch}.list-toolbar>*,.filter-bar .field,.filter-bar .field.search{width:100%;min-width:0}.pager{justify-content:center}.pager-info{width:100%;margin:0;text-align:center}}

/* —— 千牛/微信双栏：左图标轨 + 二级菜单，不穿透 —— */
.shell-left {
    display: flex;
    flex-shrink: 0;
    width: var(--side-w);
    height: 100vh;
    max-height: 100vh;
    position: relative;
    z-index: 40;
    isolation: isolate;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.rail {
    width: var(--rail-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    color: #ddd;
    border-right: 1px solid rgba(0, 0, 0, 0.35);
}
html[data-skin="porcelain"] .rail {
    background: #2b3038;
}
.rail-brand {
    height: var(--top-h);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, var(--side-on-bar), transparent 60%),
        var(--accent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.rail-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.rail-foot {
    flex-shrink: 0;
    padding: 8px 0 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
}
.rail-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b8b8b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}
.rail-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 0;
}
.rail-btn.on {
    background: rgba(7, 193, 96, 0.18);
    color: #07c160;
}
html[data-skin="atelier"] .rail-btn.on,
html[data-skin="ink"] .rail-btn.on {
    background: var(--accent-soft);
    color: var(--side-on-bar);
}
html[data-skin="obsidian"] .rail-btn.on {
    background: rgba(198, 161, 91, 0.18);
    color: #c6a15b;
}
.rail-tip {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 50;
    pointer-events: none;
}
.rail-btn:hover .rail-tip { display: block; }

.menu-pane {
    width: var(--menu-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--side);
    background-image: var(--side-pattern);
    color: var(--side-text);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
html[data-skin="porcelain"] .menu-pane {
    background: #f7f8fa;
    color: var(--text);
    border-right: 1px solid var(--border);
}
.menu-hd {
    flex-shrink: 0;
    min-height: var(--top-h);
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(0, 0, 0, 0.12);
}
html[data-skin="porcelain"] .menu-hd {
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.menu-hd strong {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.menu-hd-desc {
    margin-top: 2px;
    font-size: 11px;
    color: var(--side-muted);
}
.menu-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 8px 18px;
}
.menu-panel[hidden] { display: none !important; }
.menu-pane a.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin: 0 0 4px;
    border-radius: var(--radius);
    border-left: 2px solid transparent;
    color: var(--side-text);
    text-decoration: none;
    font-size: 12.5px;
}
html[data-skin="porcelain"] .menu-pane a.nav-item { color: var(--side-text); }
.nav-ico {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--side-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
html[data-skin="porcelain"] .nav-ico {
    background: #eef1f5;
    border-color: var(--border);
    color: var(--muted);
}
.nav-svg { display: block; }
.nav-txt {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-pane a.nav-item:hover { background: var(--side-hover); }
.menu-pane a.nav-item.on {
    background: var(--side-on-bg);
    border-left-color: var(--side-on-bar);
    color: #fff;
    font-weight: 500;
}
.menu-pane a.nav-item.on .nav-ico {
    color: var(--side-on-bar);
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}
html[data-skin="porcelain"] .menu-pane a.nav-item.on {
    color: var(--text);
    background: #fff;
    box-shadow: var(--elev-1);
}
html[data-skin="porcelain"] .menu-pane a.nav-item.on .nav-ico {
    background: var(--accent-soft);
    color: var(--accent);
}
html[data-skin="atelier"] .menu-pane a.nav-item.on,
html[data-skin="ink"] .menu-pane a.nav-item.on,
html:not([data-skin]) .menu-pane a.nav-item.on {
    color: #fff8f0;
}

/* —— 主区：独立滚动，不压侧栏 —— */
.wrap {
    flex: 1;
    min-width: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-color: var(--bg);
    background-image: var(--page-pattern);
}

header.top {
    flex-shrink: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--top-h);
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
    background: var(--top);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.top-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
header.top h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.top-crumb {
    font-size: 11px;
}
header.top .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
#adminWho {
    color: var(--muted);
    font-size: 12px;
}
.skin-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
}
.skin-wrap select {
    width: auto;
    min-width: 108px;
    height: var(--btn-h);
    padding: 0 8px;
    font-size: 11px;
}

main.page {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--space);
    max-width: none;
    isolation: isolate;
}
main.page > * {
    max-width: 1180px;
}
.page-lead {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    max-width: 52em;
    letter-spacing: 0.01em;
}

/* —— 功能分区：疏朗，不挤 —— */
.zone {
    background: var(--card);
    border: var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--elev-1), var(--card-glow);
    margin: 0 0 20px;
    overflow: hidden;
}
.zone-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: var(--hairline);
    background: var(--zone-head-bg);
}
.zone-head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.zone-head .desc {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
}
.zone-head .tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.zone-body { padding: 18px 20px 20px; }
.zone-body.pad-table { padding: 0; }

/* 短字段 2～3 一排；长文本单独一排 */
.fields-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
    margin: 0 0 4px;
}
.fields-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    margin: 0 0 4px;
}
.field-stack .field,
.field-stack > label {
    display: block;
    margin: 0 0 16px;
}
.field-stack textarea,
.field.full textarea,
.field.full input,
.field.full select {
    max-width: 100%;
    width: 100%;
}
@media (max-width: 1100px) {
    .fields-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .fields-3, .fields-2 { grid-template-columns: 1fr; }
}

/* —— 紧凑按钮 —— */
button, .btn {
    appearance: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--card-solid);
    color: var(--text);
    padding: var(--btn-py) var(--btn-px);
    min-height: var(--btn-h);
    font-size: var(--btn-fs);
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}
button:hover, .btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
button.primary, .btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
button.primary:hover, .btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
html[data-skin="obsidian"] button.primary,
html[data-skin="obsidian"] .btn.primary {
    color: #1a140a;
}
button.danger, .btn.danger {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}
button.ok, .btn.ok {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: var(--ok);
}
button:disabled, .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

label, .field-label {
    display: block;
    margin: 0 0 4px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.field { margin: 0; min-width: 0; }
.field-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}
.field-row .field { margin: 0; }
.field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: var(--hairline);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: var(--input-h);
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--input);
    color: var(--text);
    font-size: var(--input-fs);
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--input-focus);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
textarea { min-height: 84px; resize: vertical; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.muted, .hint { color: var(--muted); font-size: 11.5px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0 0 10px;
}
.toolbar input[type="text"],
.toolbar input[type="search"],
.toolbar select {
    width: auto;
    min-width: 180px;
}

table.ov, table.data, table.svc, table.ul {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: transparent;
}
table.ov th, table.ov td,
table.data th, table.data td,
table.svc th, table.svc td,
table.ul th, table.ul td {
    padding: 9px 12px;
    border-bottom: var(--hairline);
    text-align: left;
    vertical-align: middle;
}
table.ov th, table.data th, table.svc th, table.ul th {
    color: var(--muted);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.06em;
    background: var(--zone-head-bg);
    white-space: nowrap;
}
table.ov tr:hover td,
table.data tr:hover td,
table.svc tr:hover td,
table.ul tr:hover td {
    background: var(--accent-soft);
}
table.ov tr:last-child td,
table.data tr:last-child td,
table.svc tr:last-child td,
table.ul tr:last-child td { border-bottom: 0; }
table.svc input[type="text"],
table.svc input[type="number"] {
    width: 100%;
    max-width: 220px;
}
table.svc input.port { max-width: 84px; }

.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius);
    font-size: 11px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
}
.badge.on {
    background: var(--ok-soft);
    border-color: transparent;
    color: var(--ok);
}
.badge.off {
    background: var(--danger-soft);
    border-color: transparent;
    color: var(--danger);
}
.badge.priv { color: var(--muted); }

.ops { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pager {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 9px 12px;
    border-top: var(--hairline);
    background: var(--zone-head-bg);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 1100px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .cards { grid-template-columns: 1fr; }
}
a.card, .card-link {
    display: block;
    padding: 18px 16px;
    background: var(--card-solid);
    border: var(--hairline);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-decoration: none;
    min-height: 92px;
    box-shadow: var(--card-glow);
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
a.card:hover, .card-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}
a.card .t, .card-link .t {
    margin: 0 0 5px;
    font-weight: 600;
    font-size: 13px;
}
a.card .d, .card-link .d {
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.msg {
    display: none;
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    border: 1px solid transparent;
}
.msg.show { display: block; }
.msg.err { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.msg.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
h2.sec { margin: 4px 0 10px; font-size: 13px; font-weight: 600; }

/* —— 弹窗 —— */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-root.show { display: flex; }
.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 14, 0.48);
    backdrop-filter: blur(2px);
}
.modal {
    position: relative;
    width: min(500px, 100%);
    max-height: min(84vh, 740px);
    display: flex;
    flex-direction: column;
    background: var(--card-solid);
    border: var(--hairline);
    border-radius: var(--modal-radius);
    box-shadow: var(--elev-2);
    overflow: hidden;
}
.modal.wide { width: min(700px, 100%); }
.modal.narrow { width: min(380px, 100%); }
.modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: var(--hairline);
    background: var(--zone-head-bg);
}
.modal-hd h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.modal-x {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    min-height: auto;
    cursor: pointer;
}
.modal-x:hover { color: var(--text); background: transparent; border: 0; }
.modal-bd { padding: 14px; overflow: auto; flex: 1; }
.modal-bd .confirm-text { font-size: 13px; line-height: 1.55; }
.modal-ft {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    border-top: var(--hairline);
    background: var(--zone-head-bg);
}

.toast-host {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    z-index: 4500;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}
.toast {
    min-width: 140px;
    max-width: 320px;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: rgba(20, 20, 22, 0.88);
    color: #fff;
    font-size: 12px;
    text-align: center;
    pointer-events: auto;
    box-shadow: var(--elev-2);
}
.toast.ok { background: rgba(47, 107, 79, 0.94); }
.toast.err { background: rgba(163, 58, 50, 0.94); }

/* —— 登录 —— */
body.login-body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(260px, 34%) 1fr;
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
}
.login-aside {
    background: var(--side-pattern), var(--side);
    color: var(--side-text);
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-aside::after {
    content: "";
    position: absolute;
    right: -40%;
    bottom: -20%;
    width: 80%;
    height: 70%;
    background: radial-gradient(circle, var(--accent-soft), transparent 65%);
    pointer-events: none;
}
.login-aside h1 {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.12em;
    position: relative;
}
.login-aside p {
    margin: 0;
    color: var(--side-muted);
    font-size: 12.5px;
    max-width: 16em;
    line-height: 1.7;
    position: relative;
}
.login-aside .foot {
    font-size: 11px;
    color: var(--side-muted);
    letter-spacing: 0.08em;
    position: relative;
}
.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    background: var(--page-pattern), var(--bg);
}
.login-box {
    width: min(360px, 100%);
    background: var(--card-solid);
    border: var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--elev-1), var(--card-glow);
    padding: 28px 26px 22px;
    position: relative;
}
.login-box .skin-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
}
.login-box h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.06em;
}
.login-box .sub {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12px;
}
.login-box button.primary {
    width: 100%;
    margin-top: 6px;
    min-height: 30px;
    font-size: 13px;
}

/* 类型切换条 / 权限勾选 / 紧凑列表操作 */
.type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.type-tabs button {
    min-height: var(--btn-h); padding: var(--btn-py) 12px; font-size: var(--btn-fs);
    border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer;
}
.type-tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.perm-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 12px; max-height: 280px; overflow: auto; padding: 4px 0;
}
.perm-grid label {
    display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text);
    margin: 0; cursor: pointer; line-height: 1.35;
}
.perm-grid input { margin-top: 2px; flex-shrink: 0; }
.perm-grid .pc { color: var(--muted); font-size: 11px; display: block; }
.ops-inline { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ops-inline button { min-height: 24px; padding: 2px 8px; font-size: 11px; }
.export-box { white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow: auto;
    font-family: var(--mono); font-size: 12px; padding: 10px; background: var(--input); border: 1px solid var(--border); }
.check-col { width: 36px; text-align: center; }
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }

@media (max-width: 900px) {
    body.admin-body { flex-direction: column; height: 100vh; }
    .shell-left {
        width: 100%;
        height: auto;
        max-height: 46vh;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }
    .rail { width: 52px; }
    .menu-pane { flex: 1; width: auto; }
    .wrap { height: auto; flex: 1; min-height: 0; }
    body.login-body { grid-template-columns: 1fr; }
    .login-aside { padding: 28px 22px; }
}

/* 2026 UI refinement: calm blue-green accent, clearer hierarchy, no contract changes. */
:root,
html[data-skin="atelier"], html[data-skin="obsidian"], html[data-skin="porcelain"], html[data-skin="ink"] {
    --accent: #176b78;
    --accent-hover: #125762;
    --accent-soft: rgba(23, 107, 120, .11);
    --side-on-bg: #176b78;
    --side-on-bar: #b9f1e7;
    --elev-1: 0 1px 2px rgba(16, 42, 52, .06), 0 10px 26px rgba(16, 42, 52, .08);
}
body.admin-body { background: var(--bg); color: var(--text); }
.wrap { background: var(--bg); }
header.top { border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(16,42,52,.03); }
main.page { padding: clamp(14px, 2.2vw, 28px); }
.zone { border: 1px solid var(--border); box-shadow: var(--elev-1); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 5px 14px rgba(23,107,120,.2); }
button:hover, .btn:hover { box-shadow: 0 4px 12px rgba(16,42,52,.1); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,107,120,.16); outline: 0; }
::selection { background: rgba(23,107,120,.2); color: var(--text); }
@media (max-width: 760px) {
    main.page { padding: 12px 10px; }
    .zone { border-radius: 10px; }
    .zone-head, .zone-body { padding-left: 14px; padding-right: 14px; }
}

/* ========== 旧项目后台视觉基准：深色左栏 + 浅色工作区 ========== */
:root,
html[data-skin="atelier"],
html[data-skin="obsidian"],
html[data-skin="porcelain"],
html[data-skin="ink"] {
    --rail-w: 58px;
    --menu-w: 202px;
    --side-w: 260px;
    --space: 20px;
    --top-h: 58px;
    --radius: 5px;
    --radius-lg: 10px;
    --modal-radius: 10px;
    --btn-h: 34px;
    --btn-px: 14px;
    --btn-py: 7px;
    --btn-fs: 13px;
    --input-h: 38px;
    --input-fs: 14px;
    --bg: #f0f2f5;
    --bg-deep: #e8ebef;
    --card: #fff;
    --card-solid: #fff;
    --text: #333;
    --muted: #6c757d;
    --accent: #667eea;
    --accent-soft: rgba(102, 126, 234, .11);
    --accent-hover: #5a6fd6;
    --ok: #28a745;
    --ok-soft: #e8f5eb;
    --danger: #dc3545;
    --danger-soft: #fbeaec;
    --border: #e4e7eb;
    --border-strong: #d7dce2;
    --side: #2c3e50;
    --side-text: #ecf0f1;
    --side-muted: #b8c2cc;
    --side-hover: #34495e;
    --side-on-bg: #667eea;
    --side-on-bar: #fff;
    --input: #fff;
    --input-focus: #fff;
    --top: #fff;
    --side-pattern: none;
    --page-pattern: none;
    --zone-head-bg: #f8f9fa;
    --card-glow: none;
    --hairline: 1px solid var(--border);
    --elev-1: 0 2px 10px rgba(0, 0, 0, .08);
    --elev-2: 0 12px 32px rgba(0, 0, 0, .18);
}

body.admin-body { font-size: 14px; background: var(--bg); }
.shell-left { width: var(--rail-w); overflow: visible; box-shadow: 2px 0 10px rgba(0, 0, 0, .18); }
.rail { background: #22313f !important; border-right-color: rgba(255,255,255,.08); }
.rail-brand { height: 58px; }
.brand-mark { border-radius: 8px; background: linear-gradient(135deg, #7b8df2, #5265d5); }
.rail-btn { width: 42px; height: 42px; min-height: 42px; border-radius: 6px; color: #b8c2cc; }
.rail-btn:hover { background: #34495e; color: #fff; }
.rail-btn.on,
html[data-skin] .rail-btn.on { background: #667eea; color: #fff; }
.menu-pane,
html[data-skin="porcelain"] .menu-pane {
    position: fixed;
    left: var(--rail-w);
    top: 0;
    width: var(--menu-w);
    max-height: min(70vh, 640px);
    background: #2c3e50;
    color: #ecf0f1;
    border: 1px solid #34495e;
    box-shadow: 0 8px 24px rgba(0,0,0,.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    z-index: 200;
}
.menu-pane.tray-open,
html[data-skin="porcelain"] .menu-pane.tray-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}
.menu-hd,
html[data-skin="porcelain"] .menu-hd { min-height: 58px; padding: 10px 16px; background: #263747; border-bottom: 1px solid rgba(255,255,255,.08); }
.menu-hd strong { font-size: 15px; }
.menu-hd-desc { color: #aeb9c4; }
.menu-nav { padding: 10px 0 18px; }
.menu-pane a.nav-item,
html[data-skin="porcelain"] .menu-pane a.nav-item { margin: 0; padding: 10px 16px; gap: 9px; border: 0; border-radius: 0; color: #ecf0f1; font-size: 14px; }
.menu-pane a.nav-item:hover { background: #34495e; }
.menu-pane a.nav-item.on,
html[data-skin] .menu-pane a.nav-item.on { background: #667eea; color: #fff; box-shadow: none; }
.nav-ico,
html[data-skin="porcelain"] .nav-ico { width: 22px; height: 22px; border: 0; border-radius: 0; background: transparent; color: #c7d0d9; }
.menu-pane a.nav-item.on .nav-ico,
html[data-skin] .menu-pane a.nav-item.on .nav-ico { background: transparent; color: #fff; }
.wrap { background: #f0f2f5; }
header.top { min-height: 58px; padding: 0 20px; }
header.top h1 { font-size: 20px; color: #333; }
.breadcrumb { font-size: 12px; }
main.page { padding: 20px; }
main.page > * { max-width: 1600px; }
.page-lead { font-size: 13px; }
.zone { margin-bottom: 20px; border: 0; border-radius: 10px; box-shadow: var(--elev-1); }
.zone-head { padding: 15px 20px; }
.zone-head h2 { font-size: 16px; color: #333; }
.zone-head .desc, .muted, .hint { font-size: 13px; }
.zone-body { padding: 20px; }
button, .btn { border-radius: 6px; font-weight: 500; transition: background .2s, border-color .2s, color .2s, box-shadow .2s; }
button:hover, .btn:hover { transform: none; box-shadow: 0 3px 10px rgba(102,126,234,.16); }
button.primary, .btn.primary { background: #667eea; border-color: #667eea; }
button.danger, .btn.danger { background: #dc3545; border-color: #dc3545; color: #fff; }
button.ok, .btn.ok { background: #28a745; border-color: #28a745; color: #fff; }
label, .field-label { margin-bottom: 6px; font-size: 13px; color: #555; letter-spacing: 0; }
input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="search"], input[type="url"], select, textarea { padding: 8px 12px; border-radius: 6px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
table.ov, table.data, table.svc, table.ul { background: #fff; font-size: 14px; }
table.ov th, table.ov td, table.data th, table.data td, table.svc th, table.svc td, table.ul th, table.ul td { padding: 12px 15px; }
table.ov th, table.data th, table.svc th, table.ul th { background: #f8f9fa; color: #495057; font-size: 13px; font-weight: 600; letter-spacing: 0; }
table.ov tr:hover td, table.data tr:hover td, table.svc tr:hover td, table.ul tr:hover td { background: #f8f9fa; }
.cards { gap: 20px; }
a.card, .card-link { min-height: 110px; padding: 22px; border: 0; border-radius: 10px; box-shadow: var(--elev-1); }
a.card:hover, .card-link:hover { border: 0; background: #fff; transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
a.card .t, .card-link .t { font-size: 16px; }
a.card .d, .card-link .d { font-size: 13px; }
.modal-mask { background: rgba(0,0,0,.5); backdrop-filter: none; }
.modal { width: min(500px, 100%); border: 0; border-radius: 10px; }
.modal-hd { padding: 15px 20px; background: #fff; }
.modal-hd h3 { font-size: 16px; letter-spacing: 0; }
.modal-bd { padding: 20px; }
.modal-ft { gap: 10px; padding: 12px 20px; background: #f8f9fa; }

@media (max-width: 900px) {
    body.admin-body { flex-direction: row; }
    .shell-left { width: 52px; height: 100vh; max-height: 100vh; }
    .menu-pane { left: 52px; width: min(240px, calc(100vw - 52px)); max-height: 70vh; }
    .wrap { height: 100vh; }
    header.top { padding: 0 12px; }
    header.top h1 { font-size: 17px; }
    main.page { padding: 10px; }
    .zone-body { padding: 14px; }
}
