:root {
  color-scheme: light;
  --bg: #f3efe7;
  --surface: rgba(255, 250, 242, 0.88);
  --surface-strong: #fffdf9;
  --surface-border: rgba(112, 93, 72, 0.12);
  --text: #2f261d;
  --text-soft: #665646;
  --accent: #1e5c50;
  --accent-strong: #14473d;
  --accent-soft: rgba(30, 92, 80, 0.12);
  --warn: #a65a18;
  --warn-soft: rgba(166, 90, 24, 0.14);
  --ok: #2f7a47;
  --ok-soft: rgba(47, 122, 71, 0.14);
  --danger: #8f3028;
  --danger-soft: rgba(143, 48, 40, 0.14);
  --shadow: 0 18px 40px rgba(70, 47, 25, 0.08);
  --radius-xl: 24px;
  --radius-md: 14px;
  --font-ui: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 32%),
    linear-gradient(160deg, #f6f2ea 0%, #efe7dc 42%, #f7f4ed 100%);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  padding: 24px;
}

.page-shell-auth {
  display: grid;
  place-items: center;
}

.auth-card,
.dashboard-shell {
  width: min(1100px, 100%);
}

.auth-card {
  display: grid;
  gap: 20px;
  max-width: 520px;
}

.auth-header,
.auth-panel,
.panel,
.task-card,
.empty-state {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.eyebrow,
.panel-eyebrow,
.section-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--text-soft);
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.06;
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.14;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.35;
}

.lede,
.muted-note {
  color: var(--text-soft);
  line-height: 1.6;
}

.muted-note {
  font-size: 0.94rem;
}

.auth-form,
.auth-stage,
.auth-reset-form,
.command-form,
.task-card,
.task-section,
.task-list,
.dashboard-shell,
.topbar,
.hero-grid,
.summary-grid,
.panel-heading,
.task-card-header,
.topbar-actions {
  display: grid;
}

.auth-form,
.command-form,
.task-list,
.task-card,
.task-section,
.dashboard-shell {
  gap: 16px;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.topbar-actions {
  gap: 10px;
  justify-items: end;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel-heading,
.task-card-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 0.92rem;
  color: var(--text-soft);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(70, 47, 25, 0.12);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(30, 92, 80, 0.45);
  box-shadow: 0 0 0 4px rgba(30, 92, 80, 0.12);
}

textarea {
  resize: vertical;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2f7b6e 100%);
  color: white;
  box-shadow: 0 14px 26px rgba(20, 71, 61, 0.18);
}

.button-secondary {
  background: white;
  color: var(--text);
  border: 1px solid rgba(70, 47, 25, 0.12);
}

.button-wide {
  width: 100%;
}

.button-link {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.auth-state,
.chip,
.status-pill,
.example-chip,
.tab-button,
.task-meta,
.inline-actions,
.command-examples {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-state,
.task-meta {
  color: var(--text-soft);
}

.auth-stage,
.auth-reset-form {
  gap: 16px;
}

.auth-callout {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(70, 47, 25, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(166, 90, 24, 0.12);
}

.status-dot.is-online {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(47, 122, 71, 0.12);
}

.status-dot.is-warning {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(166, 90, 24, 0.12);
}

.chip,
.status-pill,
.example-chip,
.tab-button {
  padding: 8px 12px;
  background: white;
  border: 1px solid rgba(70, 47, 25, 0.08);
  border-radius: 999px;
  font-size: 0.88rem;
}

.task-tabs {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tab-button {
  cursor: pointer;
}

.tab-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(30, 92, 80, 0.18);
}

.chip-accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chip-success {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip-warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.status-pending {
  background: rgba(30, 92, 80, 0.1);
  color: var(--accent-strong);
}

.status-pill.status-in_progress {
  background: rgba(34, 97, 169, 0.12);
  color: #24568b;
}

.status-pill.status-waiting_review,
.status-pill.status-blocked {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.status-completed {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.status-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-meta,
.inline-actions,
.command-examples {
  flex-wrap: wrap;
}

.task-checklist,
.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-checklist li,
.event-list li {
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
}

.task-checklist li {
  padding-left: 18px;
}

.task-checklist li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

.empty-state {
  text-align: center;
}

.auth-alert {
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 14px;
  padding: 12px 14px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  padding: 14px;
  border: 1px solid rgba(70, 47, 25, 0.08);
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
}

@media (max-width: 840px) {
  .page-shell {
    padding: 14px;
  }

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

  .topbar-actions {
    justify-items: start;
  }

  .auth-header,
  .auth-panel,
  .panel,
  .task-card,
  .empty-state {
    padding: 18px;
    border-radius: 20px;
  }
}
