:root {
  --ink: #1d2026;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #f7f8fb;
  --panel: #ffffff;
  --magenta: #d91f62;
  --teal: #0e8f96;
  --amber: #d78a18;
  --dark: #26313d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(38, 49, 61, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--magenta);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-nav a,
.button {
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}

.quick-nav a:hover,
.button:hover {
  border-color: var(--magenta);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 148px);
  padding: clamp(36px, 6vw, 84px) clamp(18px, 5vw, 72px) 32px;
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 48%, #eef5f6 48%, #eef5f6 100%);
}

.eyebrow,
.stage {
  margin: 0 0 10px;
  color: var(--magenta);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  max-width: 760px;
  font-size: clamp(38px, 5.5vw, 64px);
}

h2 {
  font-size: clamp(26px, 3vw, 42px);
}

h3 {
  font-size: 20px;
}

.lead {
  max-width: 680px;
  color: #3f4856;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.button.primary {
  color: #fff;
  border-color: var(--dark);
  background: var(--dark);
}

.button.secondary {
  color: var(--dark);
}

.hero-shot {
  margin: 0;
}

.hero-shot img,
.hero-video {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 80px rgba(38, 49, 61, 0.18);
}

.hero-video {
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-shot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.band {
  padding: 32px clamp(18px, 5vw, 72px);
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band.compact {
  padding: 44px;
}

.section-head {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-head p:last-child {
  color: var(--muted);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.flow article,
.lesson,
.chapter,
.check-grid label,
.reference-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow article {
  padding: 22px;
}

.flow span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.flow p {
  color: var(--muted);
}

.flow a {
  color: var(--magenta);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 42px clamp(18px, 4vw, 48px) 72px;
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toc strong {
  margin-bottom: 8px;
}

.toc a {
  padding: 8px 10px;
  color: #3f4856;
  border-left: 3px solid transparent;
}

.toc a:hover {
  color: var(--magenta);
  border-left-color: var(--magenta);
  background: #fff4f8;
}

.content {
  display: grid;
  gap: 24px;
}

.chapter {
  padding: 36px;
  color: #fff;
  background: var(--dark);
}

.chapter.subchapter {
  background: #173f43;
}

.chapter .eyebrow,
.chapter p {
  color: #dbe8ea;
}

.lesson {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
}

.lesson-copy p {
  color: #3f4856;
}

.goal {
  margin: 14px 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  background: #eefafa;
  color: #274850;
  font-weight: 700;
}

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

ol {
  padding-left: 22px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

li + li {
  margin-top: 8px;
}

code {
  padding: 2px 6px;
  background: #eef1f5;
  border: 1px solid #d7dde7;
  border-radius: 4px;
}

.note,
.warning {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
}

.note {
  border: 1px solid rgba(14, 143, 150, 0.3);
  background: #eefafa;
}

.warning {
  border: 1px solid rgba(215, 138, 24, 0.42);
  background: #fff7ea;
}

.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.shortcuts span {
  padding: 7px 10px;
  background: #eef1f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.image-card {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.image-card:hover {
  border-color: var(--magenta);
  box-shadow: 0 14px 34px rgba(38, 49, 61, 0.12);
}

.image-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.duo,
.gallery-three {
  display: grid;
  gap: 12px;
}

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

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

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.check-grid label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
}

.check-grid input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--teal);
}

.source {
  padding: 36px 0;
}

.reference-card {
  padding: 28px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 15px;
}

th,
td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #17212b;
  background: #eef1f5;
  font-weight: 800;
}

.mini-table {
  margin-top: 16px;
}

.compact-shot {
  margin-top: 18px;
  max-width: 760px;
}

.source h3 {
  margin: 28px 0 12px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.thumb {
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: zoom-in;
  text-align: left;
}

.thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #edf0f5;
}

.thumb span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.viewer {
  width: min(1160px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 18px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.viewer::backdrop {
  background: rgba(12, 18, 24, 0.72);
}

.viewer img {
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #fff;
}

.viewer p {
  margin: 12px 44px 0 0;
  color: var(--muted);
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--dark);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

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

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  }

  .hero-shot {
    max-width: 760px;
  }

  .toc {
    position: static;
    max-height: none;
  }

  .flow,
  .check-grid,
  .thumb-grid,
  .step-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .quick-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .quick-nav a {
    padding: 6px 8px;
    text-align: center;
    font-size: 13px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 20px 18px;
    background: #fff;
  }

  .hero-shot img,
  .hero-video {
    max-height: 160px;
    object-fit: cover;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 17px;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .band {
    padding: 32px 20px;
  }

  .duo,
  .gallery-three,
  .flow,
  .check-grid,
  .thumb-grid,
  .step-columns {
    grid-template-columns: 1fr;
  }

  .lesson,
  .chapter,
  .band.compact,
  .reference-card {
    padding: 20px;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 10px;
  }
}
