:root {
  --blue-900: #0b2b63;
  --blue-700: #155bd4;
  --blue-500: #2f80ff;
  --blue-100: #e8f2ff;
  --line: #d9e6f7;
  --text: #11223a;
  --muted: #667894;
  --panel: rgba(255,255,255,.9);
  --danger: #e23d52;
  --ok: #10a66a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", "Segoe UI", Arial, "Microsoft YaHei", sans-serif; color: var(--text); background: #f4f8ff; }
input, select, textarea, button { font: inherit; }
a { color: var(--blue-700); text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue-900); cursor: pointer; }
.btn.primary { color: #fff; border: none; background: linear-gradient(135deg, #1260f0, #31a9ff); box-shadow: 0 12px 26px rgba(47,128,255,.22); }
.btn.danger { color: #fff; border: none; background: linear-gradient(135deg, #e23d52, #ff7a59); }
.btn.ghost { background: rgba(255,255,255,.58); }
.btn.full { width: 100%; }
.brand-mark { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0b5cff, #42d3ff); font-weight: 800; box-shadow: 0 18px 40px rgba(21,91,212,.25); }
.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.login-body, .install-body { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(circle at 20% 10%, rgba(59,163,255,.28), transparent 35%),
  linear-gradient(135deg, #eef6ff 0%, #ffffff 48%, #eaf5ff 100%); }
.login-panel { width: min(420px, calc(100vw - 32px)); padding: 34px; border: 1px solid rgba(151,188,235,.55); border-radius: 18px; background: rgba(255,255,255,.82); box-shadow: 0 24px 80px rgba(18,75,148,.16); backdrop-filter: blur(14px); }
.login-panel h1, .install-hero h1 { margin: 18px 0 4px; font-size: 34px; letter-spacing: 0; }
.login-panel p, .install-hero p { color: var(--muted); margin: 0 0 24px; }
label { display: grid; gap: 8px; color: #28405f; font-size: 14px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: rgba(255,255,255,.92); color: var(--text); outline: none; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47,128,255,.12); }
form { display: grid; gap: 16px; }
.inline-form { display: inline-grid; margin-left: 10px; }
.install-shell { width: min(1060px, calc(100vw - 36px)); display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: stretch; }
.install-hero, .install-card { border: 1px solid rgba(151,188,235,.55); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: 0 24px 80px rgba(18,75,148,.14); padding: 34px; }
.install-hero { display: flex; flex-direction: column; justify-content: center; }
.install-checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.install-checks span { padding: 8px 12px; border-radius: 999px; background: var(--blue-100); color: var(--blue-900); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); }
.alert.error { background: #fff0f2; color: #9d1b2d; border-color: #ffc7d0; }
.alert.info { background: #eaf4ff; color: #15447d; }
.success-box { display: grid; gap: 14px; align-content: center; min-height: 320px; }
.admin-body { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; background:
  linear-gradient(180deg, #f8fbff, #eef5ff),
  radial-gradient(circle at 80% 10%, rgba(47,128,255,.18), transparent 30%); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: linear-gradient(180deg, #08295e, #10499d); color: #fff; }
.side-brand { display: flex; gap: 12px; align-items: center; padding: 8px 8px 22px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { color: rgba(255,255,255,.76); padding: 12px 14px; border-radius: 8px; }
.sidebar a.active, .sidebar a:hover { color: #fff; background: rgba(255,255,255,.14); }
.main { padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.86); box-shadow: 0 10px 36px rgba(27,84,145,.08); }
.topbar h1 { margin: 0; font-size: 25px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.app-switch { display: flex; grid-auto-flow: column; grid-template-columns: 220px auto; align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.metric, .panel, .empty-state { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 34px rgba(20,83,154,.08); }
.metric { padding: 20px; position: relative; overflow: hidden; }
.metric:after { content: ""; position: absolute; right: -34px; top: -34px; width: 100px; height: 100px; border-radius: 50%; background: rgba(47,128,255,.12); }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 12px; font-size: 34px; color: var(--blue-900); }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { padding: 20px; overflow: hidden; }
.panel.wide { grid-column: span 1; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-title-row h2 { margin: 0; }
.search-form { display: grid; grid-template-columns: minmax(220px, 360px) auto; gap: 10px; align-items: center; }
.form-grid.compact { gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e8effa; text-align: left; vertical-align: top; }
th { color: #45617f; font-weight: 700; background: #f7fbff; }
code { padding: 2px 6px; border-radius: 6px; background: #eef5ff; color: #114b9b; word-break: break-all; }
pre { overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f7fbff; }
.secret-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; padding: 14px; border-radius: 10px; color: #09315f; background: #e8f6ff; border: 1px solid #bce4ff; }
.secret-box span { color: var(--muted); }
.chart-bars { height: 250px; display: flex; align-items: end; gap: 10px; padding: 20px 4px 28px; border-radius: 12px; background: linear-gradient(180deg, #f8fbff, #edf6ff); }
.bar { flex: 1; min-width: 18px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #2f80ff, #61d4ff); position: relative; box-shadow: 0 10px 22px rgba(47,128,255,.22); }
.bar span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); color: var(--blue-900); font-size: 12px; }
.bar em { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; font-style: normal; }
.status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.status-list li { display: flex; justify-content: space-between; padding: 13px; border-radius: 8px; background: #f7fbff; }
.status-list b { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.status-list b.on { background: #e8fff4; color: var(--ok); }
.status-list b.off { background: #edf2f7; color: #64748b; }
.status-list b.warn { background: #fff4e8; color: #c25a00; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; min-width: 260px; }
.action-link { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 32px; padding: 0 12px; border: 1px solid #cfe0f7; border-radius: 8px; background: #f7fbff; color: var(--blue-700); font-weight: 700; }
.action-link:hover { background: #e8f2ff; border-color: #9fc6ff; }
.danger-link { color: var(--danger); border-color: #ffd0d7; background: #fff7f8; }
.create-drawer { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f7fbff; }
.create-drawer summary { cursor: pointer; padding: 13px 14px; color: var(--blue-700); font-weight: 800; }
.create-drawer form { padding: 0 14px 14px; }
.danger-panel { border-color: #ffc7d0; background: #fff8f9; }
.muted-note { color: var(--muted); margin: -4px 0 12px; }
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.doc-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7fbff; display: grid; gap: 8px; }
.doc-grid span { color: var(--muted); font-size: 13px; }
.compact-doc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.compact-doc p { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7fbff; display: grid; gap: 8px; min-width: 0; }
.compact-doc span { color: var(--muted); font-size: 13px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.doc-details { margin: 10px 0 14px; }
.doc-details summary { cursor: pointer; color: var(--blue-700); font-weight: 700; }
.empty-state { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 16px; }
@media (max-width: 980px) {
  .admin-body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .install-shell, .content-grid, .metric-grid, .doc-grid, .compact-doc { grid-template-columns: 1fr; }
  .three-col, .two-col { grid-template-columns: 1fr; }
  .panel-title-row { align-items: stretch; flex-direction: column; }
  .search-form { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
}
