:root {
  color-scheme: light;
  --ink: #1b1f23;
  --muted: #65717d;
  --line: #d9e1e7;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --accent: #126c66;
  --accent-dark: #0b4b46;
  --warn: #b42318;
  --gold: #b38b2e;
  --shadow: 0 24px 80px rgba(27, 31, 35, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(18, 108, 102, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 108, 102, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: "Aptos", "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(960px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 48px);
}

.hidden {
  display: none !important;
}

.masthead {
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.05;
  font-weight: 800;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 0;
}

.login-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 108, 102, 0.16);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

button.secondary {
  color: var(--accent-dark);
  background: rgba(18, 108, 102, 0.1);
}

button.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--warn);
  font-weight: 700;
}

.dashboard-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-line {
  min-height: 24px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 700;
}

.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  margin-bottom: 24px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  font-size: clamp(40px, 10vw, 72px);
  line-height: 0.9;
  color: var(--accent-dark);
}

.latest {
  padding-top: 4px;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

dl div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  min-width: 0;
  background: #fff;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

dd {
  margin: 0;
  min-height: 24px;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.global-error {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  padding: 14px 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--warn);
  box-shadow: 0 16px 48px rgba(180, 35, 24, 0.28);
  font-weight: 700;
}

@media (max-width: 640px) {
  .password-row,
  .dashboard-header,
  .metric,
  dl {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    display: grid;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button,
  .password-row button {
    width: 100%;
  }
}

