:root {
  color-scheme: light;
  --bg: #f3f6f6;
  --surface: #fbfcfc;
  --surface-strong: #ffffff;
  --text: #17201f;
  --muted: #667270;
  --line: #dce4e2;
  --accent: #087d74;
  --accent-strong: #05635c;
  --accent-soft: #dcefeb;
  --danger: #a33a3a;
  --danger-soft: #f8e8e8;
  --radius: 14px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
}

button, input { font: inherit; }
button { white-space: nowrap; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 125, 116, 0.28);
  outline-offset: 2px;
}

button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #f6fbfa;
  background: var(--accent-strong);
  font-size: 18px;
  font-weight: 750;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(110deg, rgba(8, 125, 116, 0.09), transparent 42%),
    var(--bg);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  width: min(960px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 30px 80px rgba(34, 66, 62, 0.12);
}

.login-intro,
.login-panel { padding: clamp(34px, 6vw, 72px); }

.login-intro {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: #eaf3f1;
}

.brand-name {
  margin: 18px 0 48px;
  font-weight: 700;
}

.login-intro h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.login-intro > p:last-child {
  max-width: 34ch;
  margin: 24px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.login-panel > div > p { margin: 10px 0 30px; color: var(--muted); line-height: 1.6; }

form { display: grid; gap: 20px; }
label { display: grid; gap: 8px; font-weight: 650; }

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #bfcac8;
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-strong);
}

input:hover { border-color: #8ea19e; }

form button,
.button-secondary,
.button-quiet {
  min-height: 42px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 80ms ease;
}

form button {
  height: 48px;
  border: 1px solid var(--accent-strong);
  color: #f7fbfa;
  background: var(--accent-strong);
  font-weight: 700;
}

form button:hover { background: #034f4a; }

.form-error {
  margin: -4px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  color: #7b2424;
  background: var(--danger-soft);
  font-size: 14px;
  font-weight: 600;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(24px, calc((100% - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 252, 0.98);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}

.topbar .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
.topbar-actions { display: flex; gap: 8px; }

.button-secondary,
.button-quiet {
  padding: 0 16px;
  font-weight: 650;
}

.button-secondary {
  border: 1px solid #bfcac8;
  color: var(--text);
  background: var(--surface-strong);
}

.button-secondary:hover { border-color: #8ea19e; background: #f5f8f7; }

.button-quiet {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.button-quiet:hover { color: var(--text); background: #edf1f0; }

.dashboard-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 32px; }
.section-label { margin: 0 0 9px; color: var(--accent-strong); font-size: 13px; font-weight: 750; letter-spacing: 0.08em; }
.page-heading h1 { margin: 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.1; letter-spacing: -0.045em; }
.page-heading > div > p:last-child { margin: 12px 0 0; color: var(--muted); }

.metrics {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.metric {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.metric-primary { color: #f2fbf9; border-color: var(--accent-strong); background: var(--accent-strong); }
.metric p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 650; }
.metric-primary p, .metric-primary span { color: #c8e5e0; }
.metric strong { font-variant-numeric: tabular-nums; font-size: clamp(38px, 4.2vw, 58px); line-height: 1; letter-spacing: -0.05em; }
.metric span { color: var(--muted); font-size: 13px; }

.records {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.records-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px 20px; }
.records-heading h2 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.records-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 950px; }
th, td { padding: 15px 16px; border-bottom: 1px solid #e8edec; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f7f9f8; font-size: 12px; font-weight: 750; letter-spacing: 0.025em; }
td { color: #33403e; font-size: 14px; }
tbody tr:hover { background: #f8faf9; }
tbody tr:last-child td { border-bottom: 0; }
.time-cell, .ip-cell { font-variant-numeric: tabular-nums; }
.ip-cell { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }

.status-badge { display: inline-block; min-width: 58px; padding: 5px 9px; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 750; }
.status-yes { color: #075f57; background: var(--accent-soft); }
.status-no { color: #596462; background: #edf1f0; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 18px 24px; border-top: 1px solid var(--line); }
.pagination span { min-width: 96px; color: var(--muted); text-align: center; font-size: 14px; }

.state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 76px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.state-message strong { font-size: 18px; }
.state-message span { color: var(--muted); }
.error-message { margin: 0 24px 24px; padding: 22px; border: 1px solid #e7bcbc; border-radius: 10px; color: #792727; background: var(--danger-soft); }

.loading-table { display: grid; gap: 14px; padding: 28px 26px 34px; border-top: 1px solid var(--line); }
.loading-table span { display: block; height: 28px; border-radius: 8px; background: #e9eeed; }
.loading-table span:nth-child(2) { width: 92%; }
.loading-table span:nth-child(3) { width: 97%; }
.loading-table span:nth-child(4) { width: 89%; }
.loading-table span:nth-child(5) { width: 95%; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding-bottom: 42px; }
  .brand-name { margin-bottom: 24px; }
  .login-intro h1 { max-width: 14ch; font-size: 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .login-page { padding: 0; place-items: stretch; }
  .login-shell { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .login-intro, .login-panel { padding: 32px 24px; }
  .login-panel { justify-content: flex-start; }
  .topbar { min-height: 64px; padding: 10px 16px; }
  .topbar-brand > span:last-child { display: none; }
  .topbar-actions { gap: 4px; }
  .button-secondary, .button-quiet { padding: 0 11px; }
  .dashboard-shell { width: calc(100% - 28px); padding: 34px 0 56px; }
  .page-heading { margin-bottom: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 150px; padding: 18px; }
  .metric strong { font-size: 38px; }
  .records-heading { padding: 20px; }
  .pagination { justify-content: space-between; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
