:root {
  --bg: #eaf8ff;
  --bg-strong: #d7f0ff;
  --panel: #ffffff;
  --panel-soft: #f5fbff;
  --text: #163040;
  --muted: #597284;
  --line: #b9dff2;
  --primary: #0978b8;
  --primary-dark: #065f94;
  --accent: #16b6d8;
  --done: #18a878;
  --shadow: 0 18px 50px rgba(20, 87, 122, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(215, 240, 255, 0.75)),
    radial-gradient(circle at top right, rgba(22, 182, 216, 0.26), transparent 34%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(185, 223, 242, 0.8);
  background: rgba(234, 248, 255, 0.9);
  backdrop-filter: blur(16px);
}

.topbar h1,
.hero h2,
.lesson h2,
.reference h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(24px, 4vw, 40px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.install-button,
.actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(22, 182, 216, 0.24), 0 10px 22px rgba(9, 120, 184, 0.22);
  animation: bluePulse 2s ease-in-out infinite;
}

.install-button:disabled,
.actions button:disabled {
  color: var(--muted);
  background: #d7e9f4;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

/* 用 box-shadow 做藍色光暈：陰影逐漸放大，亮度也同步提高。 */
@keyframes bluePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 182, 216, 0.18), 0 10px 22px rgba(9, 120, 184, 0.22);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(22, 182, 216, 0.48), 0 14px 30px rgba(9, 120, 184, 0.34);
  }

  100% {
    box-shadow: 0 0 0 22px rgba(22, 182, 216, 0), 0 10px 22px rgba(9, 120, 184, 0.22);
  }
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(185, 223, 242, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(225, 247, 255, 0.86)),
    repeating-linear-gradient(90deg, rgba(9, 120, 184, 0.05) 0 1px, transparent 1px 42px);
  box-shadow: var(--shadow);
}

.hero h2 {
  max-width: 820px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.12;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.status-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.status-panel span {
  color: var(--muted);
}

.status-panel strong {
  font-size: 46px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #d3eaf5;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.steps {
  display: grid;
  gap: 10px;
  align-content: start;
}

.step-button {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.step-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.step-button span {
  color: var(--muted);
  font-size: 13px;
}

.step-button.active {
  border-color: var(--primary);
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(9, 120, 184, 0.16);
}

.step-button.done strong::after {
  content: " 已完成";
  color: var(--done);
  font-size: 12px;
}

.lesson,
.reference {
  border: 1px solid rgba(185, 223, 242, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.lesson {
  padding: clamp(18px, 4vw, 30px);
}

.lesson-head p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.lesson-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-top: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-soft);
}

.card h3 {
  margin: 0 0 12px;
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.75;
}

.card ul {
  margin: 0;
  padding-left: 22px;
}

pre {
  margin: 0;
  overflow-x: auto;
  border-radius: 8px;
  padding: 16px;
  color: #dff8ff;
  background: #12364b;
}

code {
  white-space: pre;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}

.reference {
  margin-top: 24px;
  padding: clamp(18px, 4vw, 30px);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.checklist label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

@media (max-width: 860px) {
  .hero,
  .workspace,
  .lesson-grid,
  .checklist {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .layout {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

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

  .actions {
    justify-content: stretch;
  }

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