:root {
  --navy: #071428;
  --blue: #1565c0;
  --blue2: #1e88e5;
  --line: #e4eef8;
  --text: #1a2332;
  --muted: #5b6b7c;
  --danger: #c62828;
  --ok: #1b8a4a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #eef3f9; color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
a { color: var(--blue); }
.layout { display: flex; min-height: 100vh; }
.sider { width: 230px; background: linear-gradient(180deg, #071428, #0d2b57); color: #d7e6f8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 22px 18px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #1e88e5, #4fc3f7); color: #fff; display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; opacity: .7; font-size: 12px; }
.sider nav { padding: 8px; flex: 1; }
.sider nav a { display: block; color: #d7e6f8; text-decoration: none; padding: 11px 14px; border-radius: 10px; margin-bottom: 4px; }
.sider nav a:hover, .sider nav a.on { background: rgba(30,136,229,.25); color: #fff; }
.sider-foot { padding: 16px 18px; display: flex; justify-content: space-between; font-size: 13px; border-top: 1px solid rgba(255,255,255,.08); }
.sider-foot a { color: #9ecbff; text-decoration: none; }
.main { flex: 1; padding: 0 28px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 0 8px; }
.topbar h1 { margin: 0; font-size: 22px; }
.hint { color: var(--muted); font-size: 13px; }
.card { background: #fff; border-radius: 14px; padding: 20px; margin: 16px 0; box-shadow: 0 8px 24px rgba(15,40,80,.06); }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 8px 24px rgba(15,40,80,.06); }
.stat b { display: block; font-size: 28px; color: var(--blue); }
.stat span { color: var(--muted); font-size: 13px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.on { color: var(--ok) !important; }
.off { color: var(--danger) !important; }
.note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.btn { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn.ghost { background: #e8f1fb; color: #0d47a1; }
.btn-on { background: var(--ok); }
.btn-off { background: #90a4ae; }
.inline-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-row { display: flex; gap: 10px; align-items: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=file], select, textarea {
  width: 100%; border: 1px solid #d5e0ec; border-radius: 8px; padding: 9px 10px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.hl { background: #e3f2fd; }
.table .final { font-weight: 800; color: var(--blue); }
.ops { display: flex; gap: 8px; align-items: center; }
.ops form { display: inline; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-size: 13px; }
.link.danger { color: var(--danger); }
.flash { padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.flash.ok { background: #e8f5e9; color: #1b5e20; }
.flash.err { background: #fdecea; color: #b71c1c; }
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tabs a { padding: 8px 12px; border-radius: 999px; background: #fff; text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--blue); color: #fff; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(180deg, #071428, #1565c0); }
.login-card { width: 380px; background: #fff; padding: 32px; border-radius: 16px; }
.login-mark { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #1e88e5, #4fc3f7); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.login-card h1 { margin: 0 0 6px; font-size: 20px; }
.login-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.login-card button { width: 100%; margin-top: 16px; height: 44px; background: var(--blue); color: #fff; border: 0; border-radius: 10px; cursor: pointer; }
@media (max-width: 1100px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .sider { width: 200px; }
}
