.tutorial-page {
  --paper: #f4eedf;
  --ink: #16130f;
  --agent-blue: #39c8ff;
  --agent-lime: #b9ff6a;
  --agent-red: #d94a34;
  --panel: rgba(255, 250, 232, 0.76);
  background:
    radial-gradient(circle at 16% 8%, rgba(217, 74, 52, 0.18), transparent 22rem),
    radial-gradient(circle at 84% 12%, rgba(57, 200, 255, 0.22), transparent 24rem),
    radial-gradient(circle at 70% 82%, rgba(185, 255, 106, 0.18), transparent 22rem),
    linear-gradient(135deg, #f8f0df, #eee1c8 52%, #d9ccb4);
}

.tutorial-glow {
  position: fixed;
  inset: 0;
  width: 100dvw;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(217, 74, 52, 0.18) 42% 43%, transparent 43% 100%),
    linear-gradient(115deg, transparent 0 55%, rgba(57, 200, 255, 0.18) 55% 56%, transparent 56% 100%);
}

.tutorial-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100vw - 40px));
  margin: 76px auto 0;
}

.tutorial-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(390px, 1.12fr);
  align-items: center;
  gap: 40px;
  min-height: 76vh;
  margin-top: 26px;
}

.tutorial-title {
  margin: 0 0 22px;
  font-family: var(--display-zh);
  font-size: clamp(62px, 8.5vw, 124px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.tutorial-lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.82;
}

.lesson-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.lesson-strip a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid rgba(21, 19, 15, 0.24);
  background: rgba(255, 250, 232, 0.7);
  box-shadow: 4px 4px 0 rgba(21, 19, 15, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.exploded-agent {
  position: relative;
  min-height: 430px;
  border: 1px solid rgba(21, 19, 15, 0.24);
  background: linear-gradient(145deg, rgba(16, 22, 15, 0.95), rgba(26, 37, 25, 0.92));
  box-shadow: var(--shadow), 12px 12px 0 var(--agent-red);
  overflow: hidden;
}

.exploded-agent svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.exploded-agent path {
  fill: none;
  stroke: rgba(185, 255, 106, 0.32);
  stroke-width: 2;
  stroke-dasharray: 8 9;
}

.agent-core,
.part {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 255, 211, 0.22);
  color: #e8ffd3;
}

.agent-core {
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(185, 255, 106, 0.24), rgba(16, 22, 15, 0.9));
  box-shadow: 0 0 50px rgba(185, 255, 106, 0.32);
  font-size: 22px;
  font-weight: 600;
}

.part {
  min-width: 96px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.055);
  font-weight: 600;
}
.part-goal { left: 34px; top: 42px; color: #ffc3b7; }
.part-model { left: 50%; top: 24px; transform: translateX(-50%); }
.part-context { right: 30px; top: 50px; color: var(--agent-blue); }
.part-tools { left: 30px; bottom: 48px; color: var(--agent-lime); }
.part-memory { left: 50%; bottom: 26px; transform: translateX(-50%); color: #f2d16b; }
.part-eval { right: 26px; bottom: 46px; color: #fff8e5; }

.lesson-card,
.anatomy-section,
.loop-section,
.memory-section,
.failure-section,
.build-section,
.checklist-section,
.tutorial-cta {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 28px;
  align-items: start;
}

.lesson-card > *,
.anatomy-section > *,
.loop-section > *,
.memory-section > *,
.failure-section > *,
.build-section > *,
.checklist-section > *,
.tutorial-cta > * {
  min-width: 0;
}

.tutorial-page h2 {
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.14;
  letter-spacing: -0.018em;
}

.lesson-copy p,
.tutorial-cta p {
  color: var(--muted);
  line-height: 1.78;
  font-size: 17px;
}

.compare-board,
.anatomy-stack,
.swimlane,
.memory-shelves,
.build-roadmap,
.checklist-grid {
  display: grid;
  gap: 14px;
}

.compare-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compare-board article,
.anatomy-stack div,
.memory-shelves article,
.build-roadmap li,
.checklist-grid label,
.loop-step,
.lane-box {
  border: 1px solid rgba(21, 19, 15, 0.24);
  background: var(--panel);
  box-shadow: 7px 7px 0 rgba(21, 19, 15, 0.08);
  backdrop-filter: blur(14px);
}
.compare-board article {
  min-height: 210px;
  padding: 22px;
}
.compare-board strong,
.anatomy-stack b,
.memory-shelves b,
.build-roadmap b {
  display: block;
  margin-bottom: 14px;
  font-family: var(--display-zh);
  font-size: 26px;
  letter-spacing: -0.04em;
}
.compare-board span,
.anatomy-stack span,
.memory-shelves span,
.build-roadmap span,
.checklist-grid label {
  color: var(--muted);
  line-height: 1.72;
}
.compare-board .is-agent {
  background: rgba(185, 255, 106, 0.18);
  box-shadow: 7px 7px 0 rgba(185, 255, 106, 0.26);
}

.anatomy-stack div {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  min-height: 70px;
  padding: 16px 18px;
}
.anatomy-stack div:nth-child(odd) { background: rgba(57, 200, 255, 0.12); }
.anatomy-stack div:last-child { background: rgba(217, 74, 52, 0.12); }

.loop-diagram {
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(21, 19, 15, 0.22);
  background: rgba(255, 250, 232, 0.5);
}
.loop-diagram svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.loop-path {
  fill: none;
  stroke: rgba(21, 19, 15, 0.28);
  stroke-width: 3;
}
.arrow {
  fill: none;
  stroke: var(--agent-red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.loop-step {
  position: absolute;
  z-index: 1;
  width: 150px;
  padding: 16px;
}
.loop-step b { display: block; margin-bottom: 8px; color: #7e2116; }
.loop-step span { color: var(--muted); }
.observe { left: 46px; top: 50px; }
.plan { right: 46px; top: 50px; }
.act { right: 46px; bottom: 44px; }
.verify { left: 46px; bottom: 44px; }

.swimlane {
  grid-template-columns: 120px 1fr;
  align-items: stretch;
}
.lane-label {
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 19, 15, 0.24);
  background: rgba(16, 22, 15, 0.92);
  color: #e8ffd3;
  font-weight: 600;
}
.lane-box {
  padding: 18px;
  color: var(--muted);
}
.lane-box.accent { background: rgba(57, 200, 255, 0.13); color: var(--ink); }
.lane-box.success { background: rgba(185, 255, 106, 0.18); color: var(--ink); }

.memory-shelves {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.memory-shelves article { min-height: 170px; padding: 22px; }

.risk-radar {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  width: 100%;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid rgba(21, 19, 15, 0.28);
  background:
    radial-gradient(circle, rgba(185, 255, 106, 0.18) 0 16%, transparent 17%),
    radial-gradient(circle, transparent 0 34%, rgba(21, 19, 15, 0.08) 35% 36%, transparent 37%),
    radial-gradient(circle, transparent 0 60%, rgba(21, 19, 15, 0.08) 61% 62%, transparent 63%),
    conic-gradient(from -90deg, rgba(217, 74, 52, 0.2), rgba(57, 200, 255, 0.18), rgba(185, 255, 106, 0.18), rgba(217, 74, 52, 0.2));
}
.risk-radar b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #7e2116;
}
.risk-radar span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  padding: 8px 10px;
  border: 1px solid rgba(21, 19, 15, 0.22);
  background: rgba(255, 250, 232, 0.8);
  font-size: 13px;
  white-space: nowrap;
}

.build-roadmap {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.build-roadmap li {
  display: grid;
  grid-template-columns: 52px 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  counter-increment: step;
}
.build-roadmap li::before {
  content: counter(step, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--agent-red);
  color: #fff8e5;
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 600;
}

.checklist-section {
  grid-template-columns: 0.7fr 1.3fr;
}
.checklist-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.checklist-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 14px;
  color: var(--ink);
}
.checklist-grid input { accent-color: var(--agent-red); }

.tutorial-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 70px;
  padding: 30px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 15, 0.94);
  color: #fff8e5;
  box-shadow: var(--shadow), 10px 10px 0 var(--agent-red);
}
.tutorial-cta p { color: rgba(255, 248, 229, 0.72); }
.tutorial-cta h2 {
  color: #fff8e5;
  max-width: none;
  font-size: clamp(42px, 5.5vw, 74px);
  white-space: nowrap;
}
.tutorial-cta .button { justify-self: end; }

@media (max-width: 980px) {
  .tutorial-hero,
  .lesson-card,
  .anatomy-section,
  .loop-section,
  .memory-section,
  .failure-section,
  .build-section,
  .checklist-section,
  .tutorial-cta {
    grid-template-columns: 1fr;
  }
  .exploded-agent { min-height: 390px; }
  .compare-board { grid-template-columns: 1fr; }
  .tutorial-cta .button { justify-self: start; }
}

@media (max-width: 760px) {
  .tutorial-shell {
    width: calc(100dvw - 28px);
    max-width: calc(100dvw - 28px);
    margin: 56px auto 0;
  }
  .tutorial-hero { min-height: auto; gap: 26px; }
  .tutorial-title { font-size: clamp(48px, 15vw, 68px); line-height: 1.06; }
  .tutorial-page h2 {
    font-size: clamp(32px, 9.5vw, 46px);
    line-height: 1.18;
    text-wrap: balance;
  }
  .lesson-strip a { flex: 1 1 calc(50% - 8px); text-align: center; }
  .exploded-agent { min-height: 360px; box-shadow: var(--shadow), 8px 8px 0 var(--agent-red); }
  .part { min-width: 80px; padding: 10px 12px; font-size: 12px; }
  .agent-core { width: 106px; height: 106px; }
  .anatomy-stack div,
  .build-roadmap li,
  .swimlane { grid-template-columns: 1fr; }
  .memory-shelves,
  .checklist-grid { grid-template-columns: 1fr; }
  .loop-diagram { min-height: 430px; }
  .loop-step { width: calc(50% - 34px); padding: 14px; }
  .observe { left: 18px; top: 36px; }
  .plan { right: 18px; top: 36px; }
  .act { right: 18px; bottom: 36px; }
  .verify { left: 18px; bottom: 36px; }
  .risk-radar span { font-size: 11px; }
  .tutorial-cta {
    grid-template-columns: 1fr;
  }
  .tutorial-cta h2 {
    white-space: normal;
  }
}
