:root {
  --background: 0 0% 100%;
  --foreground: 220 20% 10%;
  --primary: 226.187 57.202% 47.647%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 20% 96%;
  --secondary-foreground: 220 20% 10%;
  --muted: 210 20% 96%;
  --muted-foreground: 220 10% 46%;
  --destructive: 0 84% 60%;
  --border: 220 13% 91%;
  --ring: 226.187 57.202% 47.647%;
  --radius: 0.75rem;
  --brand: #3454bf;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: hsl(var(--foreground));
  background: #fff;
  font: 14px/1.6 Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.025em; }
h2 { font-size: 16px; }
.muted { color: hsl(var(--muted-foreground)); font-size: 13px; }
.brand-icon {
  display: inline-flex; height: 30px; width: 30px; flex: none;
  align-items: center; justify-content: center; color: #fff;
  background: var(--brand); border-radius: 8px;
}
.brand-name { font-weight: 700; font-size: 18px; }
.brand-sub { color: hsl(var(--muted-foreground)); font-size: 12px; }
.login-page {
  min-height: 100dvh;
  background: linear-gradient(135deg, #f6f8fd, #fff 65%);
  padding: 32px 6vw;
  display: flex; flex-direction: column;
}
.login-brand, .sidebar-head { display: flex; align-items: center; gap: 10px; }
.login-center {
  width: min(1020px, 100%); margin: auto; padding: 64px 0;
  display: grid; grid-template-columns: 1fr 410px; align-items: center; gap: 72px;
}
.intro-kicker { margin: 0 0 20px; color: var(--brand); font-size: 14px; font-weight: 600; }
.login-intro h1 { font-size: clamp(38px, 4vw, 54px); font-weight: 650; line-height: 1.25; letter-spacing: -0.05em; }
.intro-copy { margin-top: 20px; max-width: 380px; color: hsl(var(--muted-foreground)); line-height: 1.75; }
.intro-note { margin-top: 28px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.card {
  background: #fff; border: 1px solid hsl(var(--border));
  border-radius: 16px; padding: 28px;
}
.login-card h2 { font-size: 20px; }
.login-card .muted { margin: 8px 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.field input, textarea {
  width: 100%; border: 1px solid hsl(var(--border)); border-radius: 8px;
  background: #fff; padding: 10px 12px; outline: none;
}
.field input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2); }
textarea { resize: vertical; min-height: 120px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; background: #fff;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover, .nav-item:hover { background: hsl(var(--secondary)); }
.btn-block { width: 100%; }
.icon-btn { width: 40px; padding: 0; }
.form-error { color: hsl(var(--destructive)); font-size: 13px; margin: 0 0 12px; }
.dashboard-layout { height: 100dvh; overflow: hidden; background: hsl(var(--secondary) / 0.45); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 240px;
  display: flex; flex-direction: column; background: hsl(var(--background));
  border-right: 1px solid hsl(var(--border));
}
.sidebar-head { height: 56px; padding: 0 16px; border-bottom: 1px solid hsl(var(--border)); }
.nav-label { padding: 22px 24px 8px; font-size: 11px; color: hsl(var(--muted-foreground)); }
.nav-item {
  margin: 0 12px; text-align: left; border: 0; border-radius: 8px;
  padding: 10px 12px; background: transparent; cursor: pointer; font-weight: 500;
}
.nav-item.active { background: hsl(var(--primary) / 0.1); color: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 16px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.dashboard-main { height: 100%; margin-left: 240px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid hsl(var(--border));
}
.topbar-title { font-weight: 650; }
.topbar-spacer { flex: 1; }
#menu-btn { display: none; }
.main-content { flex: 1; overflow: auto; padding: 24px; }
.page { display: flex; flex-direction: column; gap: 16px; }
.page-heading h1 { font-size: 23px; font-weight: 650; }
.page-heading p { margin: 6px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.callout {
  border: 1px solid #f3e2b8; border-left: 3px solid #d97706; background: #fffbeb;
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.7;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 16px 18px; }
.stat-label { font-size: 12px; color: hsl(var(--muted-foreground)); }
.stat-value { font-size: 28px; font-weight: 650; letter-spacing: -0.04em; }
.stat-value.ok { color: #059669; }
.stat-value.sauce { color: #d97706; }
.stat-value.fail { color: hsl(var(--destructive)); }
.row-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.data-table { background: #fff; border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden; }
.data-table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
th { height: 42px; font-size: 12px; font-weight: 600; background: hsl(var(--secondary)); white-space: nowrap; }
td:nth-child(2) { font-weight: 600; }
.check { width: 42px; }
.table-empty { min-height: 160px; display: flex; align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 650; white-space: nowrap;
}
.badge-ok { background: #059669; color: #fff; }
.badge-sauce { background: #d97706; color: #fff; }
.badge-fail { background: hsl(var(--destructive)); color: #fff; }
.badge-run { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.badge-model { background: hsl(var(--primary) / 0.1); color: var(--brand); }
.steps { margin-top: 6px; color: hsl(var(--muted-foreground)); font-size: 12px; font-weight: 400; }
.link { border: 0; background: transparent; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }
.sidebar-backdrop { display: none; }
@media (max-width: 1023px) {
  .login-center { grid-template-columns: 1fr 380px; gap: 32px; }
}
@media (max-width: 767px) {
  .login-intro { display: none; }
  .login-center { display: block; padding: 48px 0; max-width: 420px; }
  .login-page { padding: 24px 16px; }
  #menu-btn { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: none; }
  .dashboard-main { margin-left: 0; }
  .main-content { padding: 16px 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-heading h1 { font-size: 21px; }
}
