:root {
  --blue: #2f7cf6; --blue-d: #1f63d6; --blue-l: #e8f1ff;
  --bg: #f4f6fa; --panel: #fff; --line: #eceef3;
  --txt: #1f2733; --txt-2: #6b7480; --txt-3: #9aa3af;
  --green: #21c56c; --red: #f5483b; --orange: #ff9f1c;
  --radius: 14px; --shadow: 0 6px 24px rgba(31,66,122,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif; background: var(--bg); color: var(--txt); font-size: 14px; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d4dae4; border-radius: 8px; }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }

/* 登录/门户 */
.auth-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg,#2f7cf6,#6aa8ff); padding: 24px; }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 20px; padding: 34px 32px 28px; box-shadow: 0 20px 60px rgba(20,60,140,.28); }
.auth-logo { font-size: 42px; text-align: center; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 8px 0 4px; }
.auth-card .sub { color: var(--txt-2); font-size: 13px; text-align: center; margin-bottom: 20px; }
.tabs { display: flex; background: #f1f4f9; border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; height: 36px; border-radius: 8px; font-size: 14px; color: var(--txt-2); }
.tabs button.active { background: #fff; color: var(--blue); font-weight: 700; box-shadow: 0 2px 8px rgba(40,70,120,.1); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; background: #f8fafc; }
.field input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(47,124,246,.12); }
.btn { height: 42px; padding: 0 20px; border-radius: 11px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { width: 100%; height: 46px; background: linear-gradient(135deg,var(--blue),#5b97ff); color: #fff; box-shadow: 0 8px 20px rgba(47,124,246,.3); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-d); }
.btn.light { background: #eef3fb; color: var(--blue); }
.btn.light:hover { background: #e0ebfd; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--txt-2); }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn.danger { background: #fff0ef; color: var(--red); }
.btn.danger:hover { background: #ffe2df; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.err { color: var(--red); font-size: 13px; min-height: 19px; margin: 2px 0 8px; }
.ok-msg { color: #13934a; font-size: 13px; min-height: 19px; margin: 2px 0 8px; }

/* 状态卡 */
.status-hero { text-align: center; padding: 8px 0 4px; }
.status-hero .ic { font-size: 52px; }
.status-hero h2 { font-size: 19px; margin: 10px 0 6px; }
.status-hero p { color: var(--txt-2); font-size: 13.5px; line-height: 1.8; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 20px; }
.pill.pending { background: #fff4e0; color: #c77c0b; }
.pill.active { background: #e6f6ec; color: #13934a; }
.pill.disabled { background: #fdeceb; color: var(--red); }
.pill.online { background: #e6f6ec; color: #13934a; }
.pill.offline { background: #eef0f4; color: #8a93a0; }

/* 管理后台布局 */
.admin-layout { display: flex; height: 100%; }
.sidebar { width: 200px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; flex-shrink: 0; }
.sidebar .logo { font-weight: 800; font-size: 16px; padding: 6px 10px 18px; display: flex; gap: 8px; align-items: center; }
.sidebar nav button { width: 100%; text-align: left; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--txt-2); font-size: 14px; display: flex; gap: 9px; align-items: center; }
.sidebar nav button:hover { background: var(--blue-l); color: var(--blue); }
.sidebar nav button.active { background: var(--blue); color: #fff; font-weight: 600; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--txt-3); padding: 10px; }
.sidebar .foot button { color: var(--txt-2); margin-top: 6px; }
.main { flex: 1; overflow-y: auto; padding: 26px 30px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; }
.cards, .stat-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat-card .n { font-size: 30px; font-weight: 800; }
.stat-card .l { color: var(--txt-2); font-size: 13px; margin-top: 4px; }
.stat-card.blue .n { color: var(--blue); } .stat-card.green .n, .stat-card.active .n { color: var(--green); }
.stat-card.orange .n, .stat-card.pending .n { color: var(--orange); } .stat-card.gray .n { color: #8a93a0; }
.stat-card.disabled .n { color: var(--red); }
.stat-card.online .n { color: var(--green); }
.ov-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.ov-cols .panel { margin-bottom: 0; }
@media (max-width: 1100px) { .ov-cols { grid-template-columns: 1fr; } }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-inline input, .form-inline select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fafbfd; }
.form-inline input:focus, .form-inline select:focus { border-color: var(--blue); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--txt-3); font-weight: 600; font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #f4f6fa; vertical-align: middle; }
tr:hover td { background: #fafcff; }
.mono { font-family: ui-monospace,Consolas,monospace; font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; }
.mini-btn { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.empty { color: var(--txt-3); text-align: center; padding: 46px 0; line-height: 2; }
.empty .big { font-size: 42px; display: block; margin-bottom: 8px; }

.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-20px); opacity: 0; background: #2a3342; color: #fff; padding: 11px 22px; border-radius: 12px; font-size: 13.5px; transition: .25s; z-index: 999; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { background: #e5483d; }

.modal-mask { position: fixed; inset: 0; background: rgba(20,30,50,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 420px; max-width: 92%; background: #fff; border-radius: 16px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 86vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 17px; }
.modal .field input, .modal .field textarea, .modal .field select { width: 100%; }
.modal .field textarea { border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; background: #f8fafc; min-height: 70px; resize: vertical; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.code-box { background: #f6f8fb; border: 1px dashed #c6d2e6; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code-box .code { font-family: ui-monospace,Consolas,monospace; font-weight: 700; letter-spacing: 1px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--txt-3); } .kv dd { word-break: break-all; }
