:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --panel: #ffffff;
  --text: #1f2523;
  --muted: #66706c;
  --line: #d9dfda;
  --green: #176f52;
  --blue: #285f8f;
  --red: #a8433b;
  --shadow: 0 12px 32px rgba(30, 39, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar {
  min-height: 82px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.layout {
  width: min(1120px, calc(100vw - 28px));
  margin: 18px auto 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.hero {
  grid-column: span 2;
  min-height: 360px;
  padding: 26px 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 26px;
  align-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-copy {
  display: grid;
  gap: 15px;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.smart-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.smart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.smart-card h3 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.smart-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.status-steps {
  display: grid;
  gap: 8px;
}

.status-row {
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(110px, 0.65fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-row strong {
  font-size: 14px;
}

.status-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-row.ok {
  border-color: #b9d8c8;
  background: #f3faf5;
}

.status-row.warn {
  border-color: #dfd1a5;
  background: #fffaf0;
}

.status-row.bad {
  border-color: #e2b7b2;
  background: #fff0ef;
}

.status-row.checking {
  border-color: #b9cada;
  background: #f1f7fb;
}

.hero-actions,
.live-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.terminal-install {
  max-width: 760px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111816;
  color: #dbe8e2;
}

.terminal-install span {
  grid-column: 1 / -1;
  color: #99aaa3;
  font-size: 12px;
  font-weight: 760;
}

.terminal-install code {
  overflow-x: auto;
  color: #f1f8f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}

.copy-command {
  min-height: 32px;
  padding: 0 10px;
  border-color: #51645d;
  background: #26332f;
  color: #f1f8f5;
  font-size: 13px;
}

.button,
button {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #356c84;
  border-radius: 6px;
  background: #24566c;
  color: #fff;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  border-color: var(--line);
  background: #f7f9f7;
  color: var(--text);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--blue);
}

.button.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-pill,
.badge,
.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.ok,
.mini-status.ok {
  color: var(--green);
  border-color: #b9d8c8;
  background: #edf7f1;
}

.mini-status.checking {
  color: var(--blue);
  border-color: #b9cada;
  background: #eff7fb;
}

.mini-status.warn {
  color: #7d5d17;
  border-color: #dfd1a5;
  background: #fff8e6;
}

.status-pill.bad,
.mini-status.bad {
  color: var(--red);
  border-color: #e2b7b2;
  background: #fff0ef;
}

.muted,
small {
  color: var(--muted);
}

.flow-card {
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.flow-card li {
  min-height: 70px;
  padding: 13px 14px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-card strong {
  font-size: 15px;
}

.flow-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.panel {
  padding: 18px;
}

.span-2 {
  grid-column: span 2;
}

.section-head {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-head h2 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.25;
}

.device-list,
.recent-list {
  display: grid;
  gap: 10px;
}

.device-card,
.recent-task,
.empty-state {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.device-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
}

.device-card p,
.device-card small {
  grid-column: span 2;
}

.device-card p {
  color: var(--muted);
  font-size: 14px;
}

.stack-form,
.task-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.task-form {
  grid-template-columns: minmax(180px, 0.75fr) minmax(180px, 0.75fr) minmax(0, 1.5fr) auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cfd7d2;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.wide {
  min-width: 0;
}

.live-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.live-actions span {
  color: var(--muted);
  font-size: 14px;
}

.output {
  min-height: 220px;
  max-height: 360px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101513;
  color: #e9f1ec;
  font-size: 13px;
  line-height: 1.55;
}

.recent-list {
  margin-top: 12px;
}

.recent-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}

.recent-task small {
  grid-column: span 2;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout,
  .hero {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel,
  .span-2 {
    grid-column: span 1;
  }

  .hero {
    min-height: auto;
    padding: 22px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .stack-form,
  .task-form {
    grid-template-columns: 1fr;
  }

  .status-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
