:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ee;
  --primary: #2563eb;
  --primary-2: #0ea5e9;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 480px at -10% -20%, rgba(37, 99, 235, 0.1), transparent 60%),
    radial-gradient(900px 360px at 110% -10%, rgba(14, 165, 233, 0.1), transparent 55%),
    var(--bg);
}

.wrap {
  max-width: 1120px !important;
  padding: 24px !important;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  margin-bottom: 14px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 2px 10px;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
}

.badge.role-admin { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.badge.role-trainer { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }
.badge.role-guest { border-color: #fcd34d; color: #92400e; background: #fffbeb; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
  margin-bottom: 14px;
}

.hero.hero-single {
  display: block;
}

.hero.hero-single .hero-main {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .hero.hero-single .hero-main {
    grid-template-columns: 1fr;
  }
}

.section-card {
  margin-top: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.section-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.1);
}

.section-card--primary {
  border-color: #cfe1ff !important;
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.1) !important;
}

.section-card--soft {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #dbe3ee;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.section-sub {
  font-size: 12px;
  color: #64748b;
}

.hero-main,
.hero-side {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.hero-main h1,
.hero-main .sub {
  margin: 0;
}

.hero-main h1 { font-size: 24px !important; }
.hero-main .sub { margin-top: 6px; color: var(--muted); font-size: 13px !important; }
.hero-side { font-size: 13px; color: #334155; display: flex; align-items: center; justify-content: center; text-align: center; }

.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
}

.kpi-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-color: #cfe1ff;
}

.kpi-value {
  font-variant-numeric: tabular-nums;
}

input, select, textarea {
  border-color: #cbd5e1 !important;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35);
}

button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.26);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
button:hover { transform: translateY(-1px); filter: saturate(1.06) brightness(1.03); }
button:disabled { transform: none; box-shadow: none; }

.btn-secondary {
  background: #fff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.link-btn:hover {
  background: #f8fbff;
  border-color: #bfd6ff;
  color: #1d4ed8;
}

.login-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #1c1c22;
  background-image: linear-gradient(rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.62));
}

#vanta_bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.login-shell {
  width: min(980px, 96vw);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(28px) saturate(180%) brightness(1.10);
  -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.28) 0%,
    rgba(255,255,255,0.10) 18%,
    rgba(255,255,255,0.03) 50%,
    rgba(255,255,255,0.12) 100%
  );
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}

.login-shell::after {
  content: "";
  position: absolute;
  inset: -40%;
  background-image: url('/image/branding_v2/tex_noise_tile_1024.png');
  background-size: 420px 420px;
  opacity: 0.06;
  mix-blend-mode: overlay;
  transform: rotate(8deg);
  pointer-events: none;
  z-index: 0;
}

.login-poster {
  position: relative;
  z-index: 1;
  padding: 26px;
  color: #f8fbff;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.15), rgba(14, 165, 233, 0.08));
}

.login-brand-logo {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
  margin-bottom: 2px;
}

.poster-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.poster-tile {
  border-radius: 12px;
  border: 1px solid #dbe3ee;
  overflow: hidden;
  background: #eef2f7;
  aspect-ratio: 16 / 9;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 可按素材内容微调构图，解决首图视觉位置与后两张不一致 */
.poster-img-arch { object-position: 50% 52%; }
.poster-img-struct { object-position: 50% 50%; }
.poster-img-mep { object-position: 50% 50%; }

.login-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.login-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 10px;
  padding: 11px 12px !important;
  font-size: 14px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.login-input,
.login-input::placeholder {
  color: #f8fafc;
}

.login-input::placeholder {
  color: rgba(248, 250, 252, 0.78);
}

.login-input:hover {
  border-color: #93c5fd !important;
}

.login-input:focus {
  transform: translateY(-1px);
}

.login-submit {
  min-width: 150px;
  padding: 11px 20px !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  border-radius: 10px;
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255,255,255,.28) !important;
}

.login-form {
  position: relative;
  z-index: 1;
  padding: 26px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255,255,255,0.24);
}

.login-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}
.login-sub {
  margin-top: 6px;
  color: #dbeafe;
  font-size: 13px;
}

.login-form .row { margin-top: 12px; }
.login-status { min-height: 20px; margin-top: 10px; font-size: 12px; color: #e2e8f0; }

.demo-accounts {
  margin-top: 14px;
  border: 1px dashed rgba(148, 163, 184, .5);
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.55;
  background: rgba(248, 250, 252, .24);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .login-shell {
    background: rgba(15, 23, 42, 0.80);
    border-color: rgba(255, 255, 255, 0.16);
  }
  .login-poster,
  .login-form {
    background: rgba(255, 255, 255, 0.92);
  }
  .login-input {
    background: rgba(255,255,255,0.92);
  }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .poster-tile { aspect-ratio: 16 / 10; }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow);
  padding: 12px;
}

.kpi-title {
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.flow-step {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: #334155;
  background: #fff;
}

.flow-step.on {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  color: #1d4ed8;
}

.surface-enter {
  animation: surfaceEnter .28s ease;
}

@keyframes surfaceEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 120;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(2, 6, 23, .22);
  padding: 10px 12px;
  font-size: 12px;
  color: #0f172a;
  backdrop-filter: blur(8px);
  animation: toastIn .22s ease;
}

.toast.success { border-color: #86efac; }
.toast.warn { border-color: #fbbf24; }
.toast.error { border-color: #fca5a5; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
