:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #122033;
  --muted: #65748a;
  --line: #dde5ef;
  --line-strong: #c9d6e5;
  --blue: #2764d9;
  --green: #16a06b;
  --amber: #c77716;
  --red: #c74747;
  --shadow: 0 24px 70px rgba(18, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(39, 100, 217, 0.12), rgba(244, 247, 251, 0) 360px),
    radial-gradient(circle at 18% 12%, rgba(22, 160, 107, 0.12), transparent 28%),
    var(--bg);
}

button {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.status-panel {
  width: min(760px, 100%);
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(201, 214, 229, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
}

.signal-mark {
  display: inline-flex;
  gap: 7px;
  align-items: end;
  justify-content: center;
  height: 30px;
  margin-bottom: 18px;
}

.signal-mark span {
  display: block;
  width: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.signal-mark span:nth-child(1) {
  height: 12px;
  background: var(--green);
}

.signal-mark span:nth-child(2) {
  height: 20px;
}

.signal-mark span:nth-child(3) {
  height: 28px;
  background: var(--amber);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p:last-child {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}

.system-state {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.state-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.system-state strong {
  font-size: 1rem;
}

.state-pill {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.state-pill[data-status="checking"] {
  background: var(--amber);
}

.state-pill[data-status="ok"] {
  background: var(--green);
}

.state-pill[data-status="bad"] {
  background: var(--red);
}

.state-pill[data-status="paused"] {
  background: var(--blue);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.progress-track {
  height: 9px;
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf5;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 180ms ease;
}

.countdown-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: center;
}

.domain-section {
  margin-top: 16px;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.domain-list {
  display: grid;
  gap: 10px;
}

.domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 140px) auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.domain-row.is-best {
  border-color: rgba(22, 160, 107, 0.58);
  background: #f3fbf7;
}

.status-cell {
  display: flex;
  min-width: 0;
  gap: 13px;
  align-items: center;
}

.status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 6px rgba(101, 116, 138, 0.1);
}

.status-dot.checking {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(199, 119, 22, 0.13);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(22, 160, 107, 0.13);
}

.status-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(199, 71, 71, 0.12);
}

.domain-row h3,
.domain-row p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-row h3 {
  font-size: 1rem;
}

.domain-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-cell {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.metric-cell small {
  color: var(--muted);
  font-weight: 500;
}

.domain-row button,
.actions button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.domain-row button {
  padding: 0 14px;
  color: #fff;
  background: var(--ink);
}

.domain-row button:disabled,
.actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.ghost-button,
.primary-button {
  padding: 0 18px;
}

.ghost-button {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

@media (max-width: 640px) {
  .page-shell {
    align-items: start;
    padding: 14px;
  }

  .status-panel {
    padding: 22px;
  }

  .system-state,
  .section-heading,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .state-pill {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 74px;
  }

  .domain-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-cell {
    text-align: left;
  }

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