* { box-sizing: border-box; }
:root {
  --bg: #f5f6f8; --surface: #fff; --border: #dfe3e8; --text: #1f2329;
  --muted: #6b7280; --primary: #2563eb; --primary-hover: #1d4ed8;
  --danger: #dc2626; --success: #16a34a; --warning: #d97706;
}
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.health { font-size: 12px; padding: 4px 10px; border-radius: 12px; background: #e5e7eb; color: var(--muted); }
.health.ok { background: #dcfce7; color: var(--success); }
.health.bad { background: #fee2e2; color: var(--danger); }
.gate { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 62px); }
.gate-card { width: 380px; background: var(--surface); padding: 32px; border-radius: 12px; border: 1px solid var(--border); }
.gate-card h1 { margin: 0 0 6px; font-size: 20px; }
.key-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.key-section h3 { margin: 0 0 6px; font-size: 15px; }
hr { border: none; border-top: 1px solid var(--border); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { border: none; background: none; padding: 10px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h2 { margin: 0; font-size: 18px; }
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; margin: 12px 0; font-size: 13px; color: var(--muted); }
label input, label select { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; color: var(--text); background: var(--surface); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; margin: 0; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.6; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; white-space: pre-wrap; }
.note { background: #eff6ff; border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f9fafb; font-weight: 500; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e5e7eb; }
.badge.online { background: #dcfce7; color: var(--success); }
.badge.offline { background: #fee2e2; color: var(--danger); }
.badge.warn { background: #fef3c7; color: var(--warning); }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.result { margin-top: 12px; font-size: 12px; white-space: pre-wrap; line-height: 1.6; padding: 10px; background: #f9fafb; border-radius: 4px; display: none; }
.result.show { display: block; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { width: 440px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 12px; padding: 24px; }
.modal-card h2 { margin: 0 0 16px; font-size: 18px; }
code { background: #f3f4f6; padding: 2px 5px; border-radius: 3px; font-size: 12px; }
