/* Guard管理系统 - clean, neutral, responsive */
:root{
  --bg:#ffffff;
  --layer:#f6f7f9;
  --layer2:#eef1f4;
  --text:#1f2d3d;
  --muted:#6b7a8a;
  --line:#e2e8f0;
  --blue:#2563eb;
  --green:#16a34a;
  --danger:#dc2626;
  --radius:4px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--text);
  background:var(--bg);
}
a{color:inherit;text-decoration:none}

.layout{
  min-height:100vh;
  display:grid;
  grid-template-columns: 260px 1fr;
  background:linear-gradient(90deg,var(--layer) 0,var(--layer) 260px,var(--bg) 260px);
}

.sidebar{
  padding:18px 14px;
  border-right:1px solid var(--line);
}
.brand{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:var(--radius);
}
.brand .mark{
  width:30px;height:30px;border-radius:6px;
  background:#0b1220;
}
.brand .title{font-weight:650;letter-spacing:.2px}
.brand .sub{font-size:12px;color:var(--muted);margin-top:2px}

.nav{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav-group{
  border:1px solid var(--line);
  background:#fff;
  border-radius:var(--radius);
  overflow:hidden;
}
.nav-group-hd{
  padding:10px 12px;
  font-size:12px;
  color:var(--muted);
  background:var(--layer);
  border-bottom:1px solid var(--line);
}
.nav-group-hd.js-nav-toggle{
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  user-select:none;
}
.nav-caret{
  font-size:12px;
  color:var(--muted);
}
.nav-group.is-collapsed .nav-caret{
  transform: rotate(-90deg);
  display:inline-block;
}
.nav-group.is-collapsed a{
  display:none;
}
.nav-group.is-collapsed .nav-group-hd{
  border-bottom:0;
}
.nav a{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 12px;
  border-top:1px solid var(--line);
}
.nav a:first-of-type{border-top:0}
.nav a.active{
  background:#eaf0ff;
  color:#163a9a;
}
.nav a:hover{background:var(--layer)}
.tag{
  font-size:12px;
  color:var(--muted);
}

.content{
  padding:22px 24px 40px;
}
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.page-title{font-size:18px;font-weight:650}
.page-desc{font-size:12px;color:var(--muted);margin-top:4px}

.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
}
.card-hd{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:var(--layer);
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.card-bd{padding:14px}
.grid{
  display:grid;
  grid-template-columns: repeat(12,1fr);
  gap:12px;
}
.col-3{grid-column: span 3}
.col-4{grid-column: span 4}
.col-6{grid-column: span 6}
.col-12{grid-column: span 12}

.metric{
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
}
.metric .k{font-size:12px;color:var(--muted)}
.metric .v{font-size:20px;font-weight:700;margin-top:6px}
.metric.blue{border-left:3px solid var(--blue)}
.metric.green{border-left:3px solid var(--green)}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th,.table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:13px;
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:600;
  background:#fafbfc;
}
.pill{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
}
.pill.ok{border-color:#bfe8cc;color:#126a2e;background:#f1fbf4}
.pill.bad{border-color:#f7c4c4;color:#8a1f1f;background:#fff5f5}
.pill.warn{border-color:#f2e2b6;color:#7a5d11;background:#fffaf0}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.input, select{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:9px 10px;
  background:#fff;
  min-height:36px;
  outline:none;
  font-size:13px;
}
.input:focus, select:focus{
  border-color:#b8c8ff;
  box-shadow:0 0 0 3px rgba(37,99,235,.08);
}
.btn{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:9px 12px;
  background:#fff;
  cursor:pointer;
  font-size:13px;
  color:var(--text);
}
.btn.sm{
  padding:6px 10px;
  min-height:30px;
  line-height:1.2;
  font-size:12px;
}
.btn.primary{
  border-color:#c9d6ff;
  background:#2563eb;
  color:#fff;
}
.btn.good{
  border-color:#c9f0d6;
  background:#16a34a;
  color:#fff;
}
.btn.danger{
  border-color:#ffd0d0;
  background:#dc2626;
  color:#fff;
}
.btn:active{transform:translateY(1px)}

/* 禁止重复点击：统一禁用样式 */
.btn.is-disabled,
.btn[disabled],
.btn[aria-disabled="true"]{
  opacity:.55 !important;
  cursor:not-allowed !important;
  transform:none !important;
  pointer-events:none !important;
}

.pagination{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.pagination .page{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:6px 10px;
  background:#fff;
  font-size:13px;
}
.pagination .page.active{
  background:#eaf0ff;
  border-color:#c9d6ff;
}

/* log table single line + highlight */
.nowrap-ellipsis{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
tr.row-success td{ background:#f1fbf4; }
tr.row-fail td{ background:#fff5f5; }

/* login */
.login-wrap{
  min-height:100vh;
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  background:linear-gradient(90deg,var(--layer) 0,var(--layer) 55%,var(--bg) 55%);
}
.login-left{
  padding:56px 40px;
}
.login-right{
  display:flex;align-items:center;justify-content:center;
  padding:28px;
}
.login-hero{
  max-width:560px;
}
.login-hero h1{margin:0;font-size:28px;letter-spacing:.2px}
.login-hero p{margin:10px 0 0;color:var(--muted);line-height:1.7}
.login-box{
  width:100%;
  max-width:420px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
}
.login-box .hd{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:var(--layer);
  font-weight:650;
}
.login-box .bd{padding:16px}
.captcha-img{
  width:120px;height:44px;
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--layer);
  display:block;
}
.hint{font-size:12px;color:var(--muted);line-height:1.6}
.error{color:var(--danger);font-size:13px;margin-top:10px}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr;background:var(--bg)}
  .sidebar{position:sticky;top:0;background:var(--layer);z-index:5}
  .content{padding:16px}
  .login-wrap{grid-template-columns:1fr;background:var(--bg)}
  .login-left{padding:26px 18px}
}

