:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #132238;
  --muted: #5d6d84;
  --accent: #2f6fed;
  --accent-soft: rgba(47, 111, 237, 0.14);
  --success: #0f9d58;
  --warning: #d97706;
  --danger: #c2410c;
  --border: #dbe3ef;
  --shadow: 0 20px 50px rgba(16, 37, 69, 0.08);
}

* { box-sizing: border-box; }
html {
  background: linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  color: var(--text);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 28px 18px 56px;
  display: grid;
  gap: 20px;
}

.hero, .panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(47, 111, 237, 0.05), rgba(47, 111, 237, 0)),
    var(--panel);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: #ecf3ff;
  color: #2659c9;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
h1 { margin-top: 14px; font-size: clamp(2rem, 4vw, 3.35rem); }
h2 { font-size: 1.1rem; }
.lead, .muted { color: var(--muted); }
.lead { margin: 12px 0 14px; font-size: 1.05rem; max-width: 62ch; }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.hero-tags span,
.health {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7faff;
  color: var(--muted);
}
.health {
  width: fit-content;
  background: #eef5ff;
  color: #214da8;
  font-weight: 600;
}

.panel {
  padding: 24px;
  background: var(--panel);
}

.stack { display: grid; gap: 18px; margin-top: 16px; }
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}
input, select, button, .primary, .ghost {
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
}
input, select {
  width: 100%;
  padding: 13px 15px;
  background: #fbfdff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
input::placeholder { color: #9aa8bb; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
button, .primary, .ghost {
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
button:hover, .primary:hover, .ghost:hover { transform: translateY(-1px); }
button:focus-visible, .primary:focus-visible, .ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #ffffff;
  font-weight: 700;
}
.ghost {
  background: #f8fbff;
  color: var(--text);
  border: 1px solid var(--border);
}
.ghost:hover { background: #eef5ff; }
.message {
  margin-top: 12px;
  min-height: 1.2em;
  color: var(--danger);
}
.message[data-state='success'] { color: var(--success); }
.message[data-state='info'] { color: var(--muted); }
.task-box.empty, .empty-note { color: var(--muted); }
.task-box {
  display: grid;
  gap: 18px;
}
.task-box.state-failed { border-left: 4px solid var(--danger); }
.task-box.state-running,
.task-box.state-starting,
.task-box.state-queued { border-left: 4px solid var(--accent); }
.task-box.state-issued,
.task-box.state-downloaded { border-left: 4px solid var(--success); }
.summary-grid, .kv-grid, .dns-grid {
  display: grid;
  gap: 12px;
}
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.summary-grid > div, .kv-grid > div, .dns-card, .download-box {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.summary-grid span, .kv-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}
.task-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.challenge-list {
  display: grid;
  gap: 14px;
}
.challenge {
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: grid;
  gap: 16px;
}
.challenge header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff4fb;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}
.badge.verified { color: var(--success); background: rgba(15, 157, 88, 0.12); border-color: rgba(15, 157, 88, 0.18); }
.badge.waiting { color: var(--warning); background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.18); }
.mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; word-break: break-word; }
.selectable { user-select: text; }
.steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}
.steps li + li { margin-top: 8px; }
.prefix-list { display: grid; gap: 10px; }
.prefix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.download-box {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #f7fbff, #eef5ff);
}
.download-box a.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 180px;
}
.challenge .muted { word-break: break-word; }
.empty-note { padding: 14px 0; }
@media (max-width: 720px) {
  .shell { padding: 16px 14px 28px; }
  .hero, .panel { border-radius: 20px; }
  .hero, .panel { padding: 18px; }
  .prefix-row, .row-head, .challenge header, .task-actions, .actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .task-actions .ghost, .task-actions .primary, .actions .ghost, .actions .primary, button {
    width: 100%;
  }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
