:root{
  --bg:#f5f7fa; --card:#fff; --line:#e3e8ef; --text:#1f2937; --muted:#6b7280;
  --primary:#2563eb; --primary-d:#1d4ed8; --ok:#059669; --bad:#dc2626; --warn:#d97706;
  --nav:#1e293b; --nav-h:#334155;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);
  font:14px/1.6 -apple-system,"Segoe UI","Microsoft YaHei",sans-serif}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.hidden{display:none!important}

/* 布局 */
.layout{display:flex;min-height:100vh;width:1366px;margin:0 auto;background:var(--bg)}
.side{width:216px;background:var(--nav);color:#cbd5e1;flex:0 0 216px;padding-bottom:24px}
.side h1{font-size:15px;color:#fff;margin:0;padding:16px 18px;border-bottom:1px solid #0f172a;font-weight:600;letter-spacing:.5px}
.side h1 small{display:block;font-size:11px;color:#94a3b8;font-weight:400;margin-top:2px}
.side nav a{display:block;padding:9px 18px;color:#cbd5e1;font-size:13px;border-left:3px solid transparent}
.side nav a:hover{background:var(--nav-h);color:#fff;text-decoration:none}
.side nav a.on{background:#0f172a;color:#fff;border-left-color:var(--primary)}
.side .sep{padding:14px 18px 4px;font-size:11px;color:#64748b;letter-spacing:1px}
.main{flex:1;min-width:0;padding:20px 24px 48px}
.top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.top h2{margin:0;font-size:19px}
.top .who{font-size:12px;color:var(--muted)}

/* 卡片 */
.card{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:16px;margin-bottom:14px}
.card h3{margin:0 0 12px;font-size:15px;display:flex;align-items:center;gap:8px}
.card h3 .tag{margin-left:auto}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}

/* 表单 */
label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
input[type=text],input[type=password],input[type=number],select,textarea{
  width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:6px;font:inherit;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{outline:2px solid #bfdbfe;border-color:var(--primary)}
textarea{min-height:64px;font-family:ui-monospace,Consolas,monospace;font-size:12px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin-bottom:10px}
.row>div{flex:1;min-width:130px}
.row>div.narrow{flex:0 0 110px}
button{background:var(--primary);color:#fff;border:0;border-radius:6px;padding:8px 14px;font:inherit;cursor:pointer}
button:hover{background:var(--primary-d)}
button.ghost{background:#fff;color:var(--primary);border:1px solid var(--primary)}
button.ghost:hover{background:#eff6ff}
button.gray{background:#64748b}
button.gray:hover{background:#475569}
button.danger{background:var(--bad)}
button.sm{padding:4px 9px;font-size:12px}
button:disabled{opacity:.5;cursor:not-allowed}

/* 表格 */
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{border-bottom:1px solid var(--line);padding:7px 8px;text-align:left;vertical-align:top}
th{background:#f8fafc;font-weight:600;color:#475569;font-size:12px;white-space:nowrap}
tr:hover td{background:#fafcff}
.pill{display:inline-block;padding:1px 7px;border-radius:10px;font-size:11px;background:#eef2ff;color:#4338ca}
.pill.ok{background:#ecfdf5;color:var(--ok)}
.pill.bad{background:#fef2f2;color:var(--bad)}
.pill.warn{background:#fffbeb;color:var(--warn)}
.pill.gray{background:#f1f5f9;color:#475569}
.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}
.kv{font-size:12px}
.kv div{display:flex;gap:8px;padding:3px 0;border-bottom:1px dashed #eef2f6}
.kv div b{flex:0 0 120px;color:var(--muted);font-weight:500}
.kv div span{flex:1;word-break:break-all}
pre.json{background:#0f172a;color:#e2e8f0;padding:12px;border-radius:6px;overflow:auto;max-height:420px;font-size:12px;line-height:1.5}
.hint{font-size:12px;color:var(--muted)}
.err{color:var(--bad);font-size:12px}
.okmsg{color:var(--ok);font-size:12px}
.spin{display:inline-block;width:13px;height:13px;border:2px solid #cbd5e1;border-top-color:var(--primary);border-radius:50%;animation:sp .7s linear infinite;vertical-align:-2px}
@keyframes sp{to{transform:rotate(360deg)}}

/* 登录 */
.login-wrap{width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#1e293b,#334155)}
.login{background:#fff;padding:30px 32px;border-radius:10px;width:340px;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.login h1{font-size:17px;margin:0 0 4px}
.login p{font-size:12px;color:var(--muted);margin:0 0 18px}
.login .row{display:block;margin-bottom:12px}
.login button{width:100%}

/* 模态 */
.modal-mask{position:fixed;inset:0;background:rgba(15,23,42,.5);display:flex;align-items:center;justify-content:center;z-index:99}
.modal{background:#fff;border-radius:8px;width:760px;max-height:84vh;display:flex;flex-direction:column}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line);font-weight:600}
.modal-body{padding:16px;overflow:auto}
.modal .x{background:none;color:#64748b;font-size:20px;line-height:1;padding:0 6px}

.toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:#111827;color:#fff;
  padding:9px 18px;border-radius:6px;font-size:13px;opacity:0;transition:.25s;pointer-events:none;z-index:200}
.toast.show{opacity:1}
.toast.bad{background:var(--bad)}
.toast.ok{background:var(--ok)}

.tabs{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
.tabs button{background:#fff;color:#475569;border:1px solid var(--line)}
.tabs button.on{background:var(--primary);color:#fff;border-color:var(--primary)}
.diff-add{background:#ecfdf5}
.diff-del{background:#fef2f2}
.scroll{max-height:460px;overflow:auto}
.tree{font-size:12px}
.tree details{margin-left:10px}
.tree summary{cursor:pointer;color:#334155}
