:root {
  --bg: #f4efe6;
  --surface: rgba(255, 251, 245, 0.88);
  --surface-strong: #fff8ef;
  --ink: #1f1b18;
  --muted: #685c54;
  --line: rgba(80, 60, 40, 0.12);
  --accent: #c65d2e;
  --accent-soft: #f4c9a7;
  --olive: #5f6b3f;
  --danger: #9c3d2b;
  --shadow: 0 18px 40px rgba(60, 38, 15, 0.08);
  --space-1: 12px;
  --space-2: 18px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --code-bg: #1d1b1a;
  --code-border: rgba(198, 93, 46, 0.22);
  --code-ink: #f8f0e4;
  --code-accent: #ffb580;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(198, 93, 46, 0.12), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(95, 107, 63, 0.12), transparent 22rem),
    linear-gradient(180deg, #f8f3eb 0%, #efe5d6 100%);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 239, 0.78);
  backdrop-filter: blur(16px);
  display: grid;
  align-content: start;
  gap: 0;
}

.brand {
  display: grid;
  gap: 8px;
}

.brand h1,
.hero h2,
.section-head h2,
.card h3 {
  font-family: "STSong", "Songti SC", serif;
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
}

.brand-copy,
.hero-copy,
.progress-copy,
.card p,
.card li,
.timeline-item p {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow,
.card-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav {
  display: grid;
  gap: 10px;
  margin: 26px 0;
}

.nav-label {
  margin: 0 0 4px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link,
.tab-button,
.accordion-trigger,
.quiz-option {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: 180ms ease;
}

.nav-link {
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.96rem;
}

.nav-link:hover,
.nav-link.is-active {
  background: linear-gradient(180deg, #fff6ea 0%, #fff1e2 100%);
  border-color: rgba(198, 93, 46, 0.35);
  transform: translateX(4px);
}

.sidebar-summary {
  display: grid;
  gap: 12px;
  margin: 22px 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 251, 245, 0.72);
  box-shadow: var(--shadow);
}

.sidebar-summary article {
  display: grid;
  gap: 2px;
}

.sidebar-summary strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.sidebar-summary span {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.progress-card,
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.progress-card {
  padding: 18px;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(95, 107, 63, 0.12);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--olive), var(--accent));
  border-radius: inherit;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.content {
  padding: var(--space-4);
  max-width: 1320px;
}

.panel {
  display: none;
  animation: fadeUp 240ms ease;
}

.panel.is-active {
  display: grid;
  gap: var(--space-3);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-2);
  padding: 28px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.95), rgba(243, 228, 211, 0.9));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.hero-lead {
  margin-top: var(--space-2);
  max-width: 44rem;
  font-size: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-self: end;
}

.hero-stats article {
  padding: 18px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
  color: var(--accent);
}

.grid {
  display: grid;
  gap: var(--space-2);
  margin-top: 0;
}

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

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: var(--space-3);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.card > *:first-child {
  margin-top: 0;
}

.card > *:last-child {
  margin-bottom: 0;
}

.card h3 {
  margin: 0 0 var(--space-1);
}

.card h4 {
  margin: 0 0 10px;
}

.card p,
.card ul,
.card ol,
.card pre {
  margin-bottom: 0;
}

.card ul,
.card ol {
  padding-left: 20px;
}

.card p + p,
.card p + ul,
.card ul + p,
.card ul + ul,
.card p + ol,
.card ol + p,
.card ul + .detail-note,
.card p + .detail-grid,
.card p + .timeline,
.card p + pre,
.card ul + pre,
.card pre + p,
.card p + .case-links,
.card p + .quiz-options {
  margin-top: var(--space-2);
}

.warm {
  background: linear-gradient(160deg, rgba(255, 247, 233, 0.95), rgba(244, 201, 167, 0.45));
}

.danger {
  background: linear-gradient(160deg, rgba(255, 245, 241, 0.95), rgba(156, 61, 43, 0.08));
}

.timeline {
  display: grid;
  gap: var(--space-2);
}

.timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-item span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff3e3;
  color: var(--accent);
  font-weight: 700;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-2);
  margin-bottom: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 2rem;
}

.search {
  width: min(360px, 100%);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.module-card.is-hidden,
.deploy-card.is-hidden {
  display: none;
}

.module-card {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.module-card:hover,
.module-card.is-active {
  transform: translateY(-4px);
  border-color: rgba(198, 93, 46, 0.32);
  background: #fff5ea;
}

.module-detail-stack {
  margin-top: 0;
}

.module-detail {
  display: none;
}

.module-detail.is-active {
  display: block;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.detail-grid h4 {
  font-size: 1rem;
}

.detail-note {
  margin-top: var(--space-2);
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(95, 107, 63, 0.08);
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap {
  margin-top: var(--space-2);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 248, 0.92);
}

.cheatsheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.cheatsheet-table th,
.cheatsheet-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(80, 60, 40, 0.08);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}

.cheatsheet-table th {
  position: sticky;
  top: 0;
  background: #fbf5ed;
  color: var(--ink);
  font-size: 0.92rem;
}

.cheatsheet-table td {
  color: var(--muted);
  font-size: 0.95rem;
}

.cheatsheet-table tbody tr:last-child td {
  border-bottom: 0;
}

.cheatsheet-table code {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #262220 0%, var(--code-bg) 100%);
  color: var(--code-ink);
  border: 1px solid var(--code-border);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: nowrap;
}

.detail-link-button {
  border: 1px solid rgba(198, 93, 46, 0.24);
  background: rgba(255, 245, 234, 0.92);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 180ms ease;
  white-space: nowrap;
}

.detail-link-button:hover {
  background: #fff1e2;
  border-color: rgba(198, 93, 46, 0.36);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(95, 107, 63, 0.1);
  color: var(--olive);
  font-size: 0.86rem;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.tab-button {
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.tab-button.is-active,
.tab-button:hover {
  background: #fff1e2;
  border-color: rgba(198, 93, 46, 0.35);
}

.accordion {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.accordion-item {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.accordion-trigger {
  width: 100%;
  border: 0;
  padding: 18px 20px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  background: transparent;
}

.accordion-content {
  display: none;
  padding: 0 20px 18px;
}

.accordion-item.is-open .accordion-content {
  display: block;
}

.quiz-list {
  display: grid;
  gap: var(--space-2);
}

.gallery-intro {
  margin-top: 0;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: 0;
}

.case-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}

.image-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  margin-bottom: 16px;
}

.image-button img {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 0;
}

.case-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.case-links a:hover {
  text-decoration: underline;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.quiz-option {
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.quiz-option:hover {
  background: #fff4e8;
}

.quiz-option.is-correct {
  background: rgba(95, 107, 63, 0.12);
  border-color: rgba(95, 107, 63, 0.35);
  color: var(--olive);
}

.quiz-option.is-wrong {
  background: rgba(156, 61, 43, 0.08);
  border-color: rgba(156, 61, 43, 0.25);
  color: var(--danger);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: rgba(17, 15, 12, 0.82);
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
}

.floating-next {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 14px 18px;
  border: 1px solid rgba(198, 93, 46, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.96) 0%, rgba(255, 241, 226, 0.96) 100%);
  box-shadow: 0 18px 38px rgba(60, 38, 15, 0.14);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.floating-next:hover {
  transform: translateY(-2px);
  border-color: rgba(198, 93, 46, 0.34);
  box-shadow: 0 22px 42px rgba(60, 38, 15, 0.18);
}

.floating-next-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.floating-next strong {
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: left;
}

pre {
  margin: var(--space-2) 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #262220 0%, var(--code-bg) 100%);
  border: 1px solid var(--code-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

code {
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
}

pre code {
  display: block;
  color: var(--code-ink);
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre;
}

pre code.language-bash::before {
  content: "bash";
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 181, 128, 0.12);
  color: var(--code-accent);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero,
  .two-up,
  .three-up,
  .module-grid,
  .case-gallery,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .content {
    padding: var(--space-2);
    max-width: none;
  }

  .sidebar-summary {
    margin: 18px 0 20px;
  }

  .floating-next {
    right: 18px;
    bottom: 18px;
    left: 18px;
    min-width: 0;
  }
}
