:root {
  color-scheme: light;
  --bg: #f7f3ef;
  --surface: #fffdfb;
  --surface-soft: #fff6f1;
  --ink: #221c1f;
  --muted: #7d7070;
  --line: #eadbd4;
  --hot: #ee5b72;
  --coral: #f27c5f;
  --green: #2f8d63;
  --amber: #a86a16;
  --red: #b7423b;
  --shadow: 0 22px 60px rgba(59, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, #fff8f2 0, #f7f3ef 54%, #f4eee9 100%);
}

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

p {
  color: var(--muted);
  line-height: 1.58;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--hot), var(--coral));
  box-shadow: 0 12px 28px rgba(238, 91, 114, 0.22);
  cursor: pointer;
}

button.ghost {
  color: var(--hot);
  border: 1px solid rgba(238, 91, 114, 0.24);
  background: #fff;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

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

input:focus,
select:focus {
  border-color: rgba(238, 91, 114, 0.62);
  box-shadow: 0 0 0 4px rgba(238, 91, 114, 0.12);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(234, 219, 212, 0.92);
  border-radius: 30px;
  background: rgba(255, 253, 251, 0.94);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.login-form input,
.login-form button {
  min-height: 54px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  font-size: 23px;
  line-height: 1.1;
}

.brand p {
  margin-top: 5px;
  font-size: 14px;
}

.brand-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--hot), #ff9b74);
  box-shadow: 0 12px 26px rgba(238, 91, 114, 0.28);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(234, 219, 212, 0.8);
  background: rgba(255, 253, 251, 0.82);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  color: var(--hot);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
  grid-template-areas:
    "status platforms"
    "details details";
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.status-card,
.platform-section,
.detail-panel {
  border: 1px solid rgba(234, 219, 212, 0.9);
  border-radius: 28px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow);
}

.status-card {
  grid-area: status;
  display: grid;
  align-content: space-between;
  min-height: 520px;
  padding: 30px;
  overflow: hidden;
}

.status-copy h2 {
  margin-top: 10px;
  font-size: 48px;
  line-height: 1;
}

.status-copy p {
  margin-top: 12px;
  max-width: 420px;
}

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

.power-switch {
  display: grid;
  justify-items: start;
  gap: 14px;
  margin: 32px 0 22px;
  cursor: pointer;
}

.power-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 148px;
  height: 78px;
  border-radius: 999px;
  background: #eadfd9;
  box-shadow: inset 0 3px 12px rgba(34, 28, 31, 0.08);
}

.switch-thumb {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(34, 28, 31, 0.18);
  transition: transform 180ms ease;
}

.power-switch input:checked + .switch-track {
  background: linear-gradient(135deg, var(--hot), var(--coral));
}

.power-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(70px);
}

.power-switch strong {
  font-size: 22px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-row div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.metric-row strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.metric-row span,
.next-run {
  color: var(--muted);
  font-size: 13px;
}

.next-run {
  margin-top: 14px;
}

.platform-section {
  grid-area: platforms;
  padding: 26px;
}

.section-heading h2 {
  margin-top: 7px;
  font-size: 30px;
}

.section-heading p {
  margin-top: 8px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.platform-card {
  display: grid;
  min-height: 340px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #fff8f5);
}

.platform-card.connected {
  border-color: rgba(47, 141, 99, 0.32);
  background: linear-gradient(180deg, #fff, #f3fbf6);
}

.platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--hot);
  background: #fff0f3;
  font-weight: 760;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #d8cac3;
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 141, 99, 0.12);
}

.platform-card h3 {
  align-self: end;
  margin-top: 28px;
  font-size: 28px;
}

.platform-card p {
  margin-top: 10px;
}

.platform-state {
  align-self: end;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.platform-actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.detail-grid {
  grid-area: details;
  display: grid;
  gap: 12px;
}

.detail-panel {
  padding: 18px 20px;
}

.detail-panel > summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.detail-panel > summary::marker,
.manual-draft summary::marker {
  color: var(--hot);
}

.detail-panel[open] > summary {
  margin-bottom: 16px;
}

.privacy-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.manual-draft {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(238, 91, 114, 0.36);
  border-radius: 18px;
  background: var(--surface-soft);
}

.manual-draft summary {
  cursor: pointer;
  color: var(--hot);
  font-weight: 760;
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.list,
.logs {
  display: grid;
  gap: 10px;
}

.item,
.log,
.empty-state {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.item-title {
  font-weight: 760;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--hot);
  background: #fff0f3;
}

.pill.success {
  color: var(--green);
  background: #eaf7ef;
}

.pill.failed {
  color: var(--red);
  background: #fdebea;
}

.pill.pending,
.pill.running {
  color: var(--amber);
  background: #fff4dc;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 92px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 250, 247, 0.8);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 18px 44px rgba(34, 28, 31, 0.25);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "platforms"
      "details";
  }

  .status-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .app-header {
    padding: 12px 14px;
  }

  .brand p {
    display: none;
  }

  .app-shell {
    padding: 14px;
  }

  .status-copy h2 {
    font-size: 38px;
  }

  .platform-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }
}
