:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #15171c;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #111827;
  --accent-2: #0f766e;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 18px 60px rgba(20, 25, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(20, 25, 35, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 25, 35, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--text);
}

.shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.identity {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.identity img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.identity button {
  width: auto;
  padding: 8px 12px;
  min-height: 36px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.status-band {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.metric,
.rule,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric,
.rule {
  border-radius: 8px;
  padding: 22px;
}

.metric-label,
.rule span,
label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 56px;
  line-height: 1;
}

.metric-sub {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.rule {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rule strong {
  font-size: 24px;
  letter-spacing: 0;
}

.panel {
  border-radius: 8px;
  padding: 28px;
}

#loginPanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

#loginPanel[hidden],
#appPanel[hidden] {
  display: none;
}

#loginPanel p {
  color: var(--muted);
}

.primary-link,
button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: block;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c9d1df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.result {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.result.success {
  color: var(--success);
}

.result.error {
  color: var(--danger);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 980px);
    padding-top: 28px;
  }

  .topbar,
  #loginPanel {
    flex-direction: column;
    align-items: stretch;
  }

  .identity {
    justify-content: flex-start;
  }

  .status-band {
    grid-template-columns: 1fr;
  }

  .rule strong {
    font-size: 20px;
  }

  .primary-link,
  button {
    width: 100%;
  }
}
