:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff4ff;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e5e9f0;
    --text: #1f2937;
    --text-2: #5b6577;
    --text-3: #98a2b3;
    --green: #16a34a;
    --green-soft: #ecfdf3;
    --red: #dc2626;
    --red-soft: #fef3f2;
    --amber: #d97706;
    --amber-soft: #fffaeb;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 8px 24px rgba(16, 24, 40, .10);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* 有登录态时的首屏：先藏起登录页，避免 Ctrl+F5 后闪一下登录页再跳回首页。
   类名由 index.html 的内联脚本同步添加，app.js 的 boot() 校验完登录态后移除。 */
html.gw-booting { background: var(--bg); }
html.gw-booting #login { display: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------------- 登录 ---------------- */
.login-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 600px at 20% -10%, #dbeafe 0%, transparent 60%),
                radial-gradient(900px 500px at 110% 110%, #e0e7ff 0%, transparent 55%),
                #f6f8fc;
}

.login-card {
    width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .12);
    padding: 34px 32px 26px;
}

.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: .3px; }
.login-brand p { margin: 0; color: var(--text-3); font-size: 12.5px; }

.logo {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff; font-weight: 700; letter-spacing: .5px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.login-error { color: var(--red); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }
.login-foot {
    margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border);
    color: var(--text-3); font-size: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.login-foot .dot { opacity: .5; }

/* ---------------- 布局 ---------------- */
.shell { display: grid; grid-template-columns: 228px 1fr; height: 100%; }

.sidebar {
    background: #0f1729;
    color: #c7d2e4;
    display: flex; flex-direction: column;
    border-right: 1px solid #101a2e;
}

.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.side-brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.side-brand-text small { color: #64748b; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }

.side-nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-group {
    padding: 16px 10px 8px;
    font-size: 11px; color: #56637d; letter-spacing: .8px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 2px;
    border-radius: 8px; cursor: pointer;
    color: #b6c2d6; font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav-item i { font-style: normal; width: 16px; text-align: center; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .65)); color: #fff; }
/* 可选模块未挂载：菜单弱化显示，配置挂载后恢复 */
.nav-item.optional-off { opacity: .62; }
.nav-item.optional-off span::after { content: ' +'; font-size: 10px; opacity: .7; }
.nav-item.optional-off.active { opacity: 1; }

.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-stat { display: flex; justify-content: space-between; font-size: 11.5px; color: #64748b; padding: 3px 0; }
.side-stat code { font-family: var(--mono); color: #93c5fd; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }

.topbar {
    height: 66px; padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex: none;
}
.topbar-left h2 { margin: 0; font-size: 17px; }
.topbar-left p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary);
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 0 2px; }
.link:hover { text-decoration: underline; }

.view { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }

/* ---------------- 通用组件 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 15px; border-radius: 8px; font-size: 13.5px; cursor: pointer;
    border: 1px solid transparent; background: #fff; color: var(--text);
    transition: all .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { border-color: var(--border); background: #fff; color: var(--text-2); }
.btn-ghost:hover { border-color: #c9d2e3; color: var(--text); background: #fafbfe; }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px; font-size: 14.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
    width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
    color: var(--text-3); font-size: 20px; line-height: 1; border-radius: 8px;
}
.icon-btn:hover { background: #f2f4f8; color: var(--text); }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14.5px; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }

.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat.accent .value { color: var(--primary); }
.stat.ok .value { color: var(--green); }
.stat.warn .value { color: var(--amber); }
.stat.err .value { color: var(--red); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar input.search {
    width: 240px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; outline: none; background: #fff;
}
.toolbar input.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
    text-align: left; padding: 11px 14px; background: #fafbfd;
    color: var(--text-2); font-weight: 600; font-size: 12.5px;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 13px 14px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
table.tbl td .badge, table.tbl th { white-space: nowrap; }
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.nw { white-space: nowrap; }
.small { font-size: 12px; }

.badge {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.gray { background: #f2f4f8; color: var(--text-2); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: #f3eeff; color: #6d3bd6; }

/* 集群成员：一行展示节点、角色、权重、健康 */
.node-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.node-line .micro { font-size: 11.5px; color: var(--text-3); }

.tag {
    display: inline-block; white-space: nowrap; padding: 1px 7px; margin: 1px 3px 1px 0;
    border-radius: 5px; background: #f1f5fb; color: #475467; font-size: 11.5px; font-family: var(--mono);
}

/* 行内次要说明（表格单元格里也能用） */
.micro { font-size: 11.5px; color: var(--text-3); }

/* 以链接形态出现的按钮 */
a.btn { text-decoration: none; }

/* 要点列表（雷池接入要点等） */
.tips { margin: 0; padding-left: 18px; }
.tips li { font-size: 12.5px; line-height: 1.75; color: var(--text-2); margin-bottom: 9px; }
.tips li:last-child { margin-bottom: 0; }
.tips li b { color: var(--text); font-weight: 600; }

.row-actions { display: flex; gap: 4px; white-space: nowrap; }
.row-actions button {
    background: none; border: 0; padding: 4px 7px; border-radius: 6px;
    color: var(--primary); cursor: pointer; font-size: 12.5px;
}
.row-actions button:hover { background: var(--primary-soft); }
.row-actions button.danger { color: var(--red); }
.row-actions button.danger:hover { background: var(--red-soft); }

.empty { padding: 46px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 30px; opacity: .35; margin-bottom: 8px; }
.empty p { margin: 6px 0 14px; font-size: 13px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 1.45; }
.switch-row { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
    position: absolute; inset: 0; background: #d5dce8; border-radius: 999px; cursor: pointer; transition: .18s;
}
.switch span::after {
    content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }

.check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 12.5px;
    background: #fff; user-select: none;
}
.check-chip input { margin: 0; }
.check-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* 节点编辑器 */
.node-list { display: flex; flex-direction: column; gap: 8px; }
.node-row { display: grid; grid-template-columns: 1fr 90px 36px; gap: 8px; align-items: center; }
.node-row input {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
    font-size: 13px; outline: none; font-family: var(--mono);
}
.node-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.node-del {
    border: 1px solid var(--border); background: #fff; border-radius: 7px; height: 34px;
    color: var(--red); cursor: pointer; font-size: 15px;
}
.node-del:hover { background: var(--red-soft); }

/* 抽屉 */
.drawer-mask {
    position: fixed; inset: 0; background: rgba(15, 23, 41, .38);
    display: flex; justify-content: flex-end; z-index: 60; backdrop-filter: blur(1px);
}
.drawer {
    width: 620px; max-width: 94vw; height: 100%; background: #fff;
    display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(16, 24, 40, .18);
    animation: slideIn .22s ease;
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--border); background: #fbfcfe; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(15, 23, 41, .42);
    display: flex; align-items: center; justify-content: center; z-index: 70;
}
.modal {
    width: 520px; max-width: 92vw; max-height: 86vh; background: #fff; border-radius: 14px;
    display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(16, 24, 40, .28);
    animation: pop .16s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 20px; overflow-y: auto; font-size: 13.5px; line-height: 1.65; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fbfcfe; }

.cred-box { background: #0f1729; color: #e2e8f0; border-radius: 10px; padding: 16px; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.cred-box .k { color: #93c5fd; font-size: 11.5px; display: block; margin-bottom: 4px; letter-spacing: .5px; }
.cred-box .v { color: #fff; }
.cred-row { margin-bottom: 14px; }
.cred-row:last-child { margin-bottom: 0; }
.copy-line { display: flex; gap: 8px; align-items: center; }
.copy-line .cred-box { flex: 1; }

.notice {
    display: flex; gap: 10px; padding: 12px 14px; border-radius: 9px;
    background: var(--amber-soft); color: #92400e; font-size: 12.5px; line-height: 1.6;
    border: 1px solid #fde68a;
}
.notice.blue { background: var(--primary-soft); color: #1e40af; border-color: #dbeafe; }
.notice b { font-weight: 650; }

/* 概览页 */
.hero {
    background: linear-gradient(120deg, #12203c 0%, #1e3a8a 55%, #2563eb 100%);
    border-radius: 14px; color: #fff; padding: 22px 24px; margin-bottom: 18px;
    display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero h3 { margin: 0 0 6px; font-size: 17px; }
.hero p { margin: 0; color: #c7d2fe; font-size: 13px; }
.hero .hero-code {
    background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .14);
    padding: 10px 14px; border-radius: 9px; font-family: var(--mono); font-size: 12.5px; color: #dbeafe;
    line-height: 1.8;
}
.hero .hero-code b { color: #93c5fd; font-weight: 600; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.bar-row .name { width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { flex: 1; height: 8px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 999px; }
.bar-row .num { width: 48px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

/* Toast */
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    padding: 10px 18px; border-radius: 9px; background: #111827; color: #fff; font-size: 13px;
    box-shadow: var(--shadow); animation: toastIn .2s ease;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dae7; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

code.inline { background: #f1f5fb; padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12px; }

/* ---------------- 链路健康 ---------------- */
.health-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.health-dot i {
    width: 8px; height: 8px; border-radius: 50%; font-style: normal; display: inline-block;
    background: #98a2b3; box-shadow: 0 0 0 3px rgba(152, 162, 179, .16);
}
.health-dot.up i { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .16); }
.health-dot.down i { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .16); }
.health-dot.degraded i { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, .16); }

.status-hero {
    display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 12px;
    border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.status-hero .big {
    width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
    font-size: 22px; font-weight: 700; color: #fff; flex: none;
}
.status-hero.up .big { background: linear-gradient(135deg, #16a34a, #22c55e); }
.status-hero.degraded .big { background: linear-gradient(135deg, #d97706, #f59e0b); }
.status-hero.down .big { background: linear-gradient(135deg, #dc2626, #ef4444); }
.status-hero h3 { margin: 0 0 4px; font-size: 16px; }
.status-hero p { margin: 0; font-size: 12.5px; color: var(--text-3); }
.status-hero .spacer { flex: 1; }

.code-box {
    background: #0f1729; color: #dbeafe; border-radius: 9px; padding: 11px 14px;
    font-family: var(--mono); font-size: 12px; word-break: break-all; line-height: 1.7;
    white-space: pre-wrap;
}
.code-box .lbl { color: #93c5fd; font-size: 11px; display: block; margin-bottom: 4px; letter-spacing: .4px; }

.metric-mini { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.metric-mini b { color: var(--text); font-variant-numeric: tabular-nums; }

.sev { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.sev.critical { background: #fef2f2; color: #b91c1c; }
.sev.warning { background: #fffaeb; color: #b45309; }
.sev.info { background: #eff6ff; color: #1d4ed8; }

/* ---------------- 智能接入 / 配置体检 ---------------- */
.smart-row { display: flex; gap: 10px; align-items: stretch; }
.smart-row input {
    flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px;
    font-size: 14px; font-family: var(--mono); color: var(--text); background: #fff;
}
.smart-row input::placeholder { color: var(--text-3); font-family: var(--sans, inherit); }
.smart-row input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.smart-opts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.smart-opts .switch-row { margin: 0; }
.steps { margin: 10px 0 0; padding-left: 20px; }
.steps li { font-size: 12.5px; line-height: 1.8; color: var(--text-2); }
.plan-box { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: #fbfcfe; }
.plan-box h4 { margin: 0 0 10px; font-size: 13.5px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 12px; }

.diag-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.diag-row:last-child { border-bottom: 0; }
.diag-row .diag-body { flex: 1; min-width: 0; }
.diag-row .diag-title { font-size: 13.5px; font-weight: 600; }
.diag-row .diag-detail { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.diag-row .diag-act { flex: none; }
@media (max-width: 900px) { .result-grid { grid-template-columns: 1fr; } }

/* ---------------- 首次部署引导 ---------------- */
.setup-wrap { max-width: 1060px; margin: 0 auto; padding: 18px 6px 40px; }
.setup-head { text-align: center; margin-bottom: 26px; }
.setup-logo {
    width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .5px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .22);
}
.setup-head h2 { margin: 0 0 6px; font-size: 21px; font-weight: 650; }
.setup-head p { margin: 0; color: var(--text-2); font-size: 13px; }
.setup-section { margin-bottom: 22px; }
.setup-label { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.setup-label b {
    width: 21px; height: 21px; border-radius: 50%; background: var(--primary-soft);
    color: var(--primary); font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.setup-label span { font-size: 14px; font-weight: 600; }
.setup-label small { font-size: 12px; color: var(--text-3); }
.setup-grid { display: grid; gap: 12px; }
.role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-card {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    text-align: left; padding: 16px 16px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.setup-card:hover { border-color: #b9cdf5; transform: translateY(-1px); box-shadow: var(--shadow); }
.setup-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.setup-icon {
    width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary);
    font-size: 17px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 2px;
}
.setup-card.selected .setup-icon { background: var(--primary); color: #fff; }
.setup-name { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.setup-name em {
    font-style: normal; font-size: 10.5px; font-weight: 500; padding: 1px 6px;
    border-radius: 9px; background: var(--amber-soft); color: var(--amber);
}
.setup-desc { font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.setup-check {
    position: absolute; top: 12px; right: 13px; width: 19px; height: 19px; border-radius: 50%;
    border: 1px solid var(--border); color: transparent; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
}
.setup-card.selected .setup-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.setup-peers {
    margin-top: 11px; padding: 12px 14px; border: 1px dashed #c7d5ef; border-radius: 9px; background: #fbfcff;
}
.setup-peers label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.setup-peers input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: var(--mono); color: var(--text); background: #fff;
}
.setup-peers input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.setup-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    margin-top: 26px; padding: 16px 18px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
}
.setup-summary { font-size: 13px; color: var(--text-2); }
.setup-summary b { color: var(--text); font-weight: 650; }
.setup-actions { display: flex; gap: 9px; }
/* 部署条件检查 */
.setup-checks {
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.check-row {
    display: grid; grid-template-columns: 22px 108px 1fr; align-items: center;
    gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border);
    font-size: 12.5px; color: var(--text-2);
}
.check-row:last-child { border-bottom: 0; }
.check-row.ok { background: #f7fdf9; }
.check-row.warn { background: #fffdf6; }
.check-row.fail { background: #fff7f7; }
.check-dot {
    width: 19px; height: 19px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff;
}
.check-dot.ok { background: #17a86b; }
.check-dot.warn { background: #d99b13; }
.check-dot.fail { background: #d9483b; }
.check-dot.wait { background: #b9c4d4; }
.check-name { font-weight: 650; color: var(--text); }
.check-msg { font-family: var(--mono); font-size: 12px; }
.check-hint { grid-column: 3; color: #a06a12; font-size: 11.5px; margin-top: -4px; }
.check-row.ok .check-hint { color: var(--text-2); }
.check-row.fail .check-hint { color: #c0392b; }
.setup-check-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px;
}
.check-summary { font-size: 12px; color: var(--text-2); }
.check-summary b.ok-text { color: #17a86b; }
.check-summary b.fail-text { color: #d9483b; }
@media (max-width: 900px) {
    .role-grid, .feature-grid { grid-template-columns: 1fr; }
    .setup-foot { flex-direction: column; align-items: stretch; }
    .setup-actions { justify-content: flex-end; }
    .check-row { grid-template-columns: 22px 1fr; }
    .check-msg, .check-hint { grid-column: 2; }
}
