:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #111d1a;
  --muted: #51635c;
  --line: #d9e4df;
  --primary: #0b8a64;
  --primary-ink: #e8fff7;
  --accent: #ff8f3f;
  --shadow: 0 12px 30px rgba(11, 41, 33, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", sans-serif;
}

body {
  position: relative;
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
}

.bg-a {
  width: 360px;
  height: 360px;
  background: rgba(11, 138, 100, 0.18);
  top: -90px;
  left: -80px;
}

.bg-b {
  width: 320px;
  height: 320px;
  background: rgba(255, 143, 63, 0.16);
  right: -90px;
  top: 260px;
}

.hero {
  position: relative;
  z-index: 1;
  padding: 52px 20px 28px;
}

.hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  background: linear-gradient(130deg, #11392e 0%, #0b8a64 62%, #1a6d55 100%);
  color: #f6fff9;
  border-radius: 24px;
  padding: 38px 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.55s ease-out both;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 12px;
  opacity: 0.92;
}

h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
}

.subtitle {
  margin-top: 14px;
  max-width: 820px;
  font-size: 16px;
  line-height: 1.7;
  color: #dcfff3;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

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

.btn-primary {
  background: #f8fff9;
  color: #0a4e39;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.42);
  color: #f6fff9;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 20px 50px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
}

.toc {
  position: sticky;
  top: 14px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(9, 37, 29, 0.04);
}

.toc h2 {
  margin: 0 0 10px;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding-left: 8px;
}

.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 700;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 15px rgba(9, 37, 29, 0.04);
  animation: fadeUp 0.46s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.03s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.09s; }
.card:nth-child(5) { animation-delay: 0.12s; }

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.card h2 {
  margin: 0 0 8px;
  font-family: "Manrope", sans-serif;
  font-size: 22px;
}

.card h3 {
  margin: 16px 0 8px;
  font-size: 17px;
}

.card p,
.card li {
  color: #2e3f39;
  line-height: 1.7;
}

.task-check {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.task-check input {
  accent-color: var(--primary);
}

.code-wrap {
  position: relative;
  margin-top: 10px;
}

pre {
  margin: 0;
  background: #101a16;
  color: #f2fff8;
  border-radius: 14px;
  border: 1px solid #253b34;
  padding: 14px 14px 14px 16px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #2d1809;
  font-weight: 800;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.copy-btn.done {
  background: #56d59a;
  color: #05311e;
}

.copy-src {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

code {
  background: #ecf6f2;
  border: 1px solid #d4e6df;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.95em;
}

pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #627771;
  font-size: 13px;
  padding: 16px 20px 30px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero-inner {
    padding: 30px 20px;
    border-radius: 18px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

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

  .copy-btn {
    top: 8px;
    right: 8px;
    padding: 6px 9px;
  }
}
