:root {
  --ink: #17211f;
  --ink-soft: #53615c;
  --paper: #f5f2ea;
  --paper-deep: #ebe5d8;
  --line: #d8d0c2;
  --coral: #d9684c;
  --coral-soft: #f1c8ba;
  --teal: #2f7d76;
  --yellow: #e4b84f;
  --white: #fffdf8;
  --shadow: 0 18px 48px rgba(23, 33, 31, .12);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { min-width: 320px; }
button { font: inherit; color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 174px minmax(0, 1fr) 248px; }
.rail { position: sticky; top: 0; height: 100vh; background: var(--ink); color: var(--white); padding: 24px 18px 18px; display: flex; flex-direction: column; align-items: center; gap: 15px; overflow: hidden; }
.rail-brand { width: 100%; display: grid; justify-items: center; gap: 9px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.14); order: 1; margin-top: 0; }
.brand-star { color: var(--yellow); font-size: 60px; line-height: .82; text-shadow: 0 0 24px rgba(228,184,79,.22); }
.brand-logo { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; background: var(--white); }
.brand-title { text-align: center; color: #f4f1e8; font-size: 17px; font-weight: 800; line-height: 1.45; letter-spacing: .08em; }
.rail-label { writing-mode: vertical-rl; font-size: 11px; letter-spacing: .2em; color: #cad0c8; margin-top: 6px; order: 1; }
.progress-track { width: 2px; height: 180px; background: rgba(255,255,255,.18); position: relative; margin-top: 10px; }
.progress-track { order: 2; }
.progress-track span { position: absolute; inset: 0 0 auto; width: 100%; height: var(--progress, 12%); background: var(--coral); transition: height .35s ease, width .35s ease; }
.step-count { font-size: 11px; display: flex; gap: 4px; color: var(--yellow); order: 3; }
.step-count .muted { color: rgba(255,255,255,.35); }
.rail-button, .icon-button { border: 0; background: transparent; cursor: pointer; }
.rail-button { color: #dbe0d8; font-size: 19px; padding: 7px; order: 6; margin-top: auto; }
.stage { position: relative; min-width: 0; min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 22px clamp(20px, 4vw, 64px) 26px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { color: var(--teal); font-size: 11px; letter-spacing: .16em; font-weight: 700; }
.top-actions { display: flex; gap: 7px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-soft); background: rgba(255,253,248,.65); }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--coral); color: var(--coral); outline: none; }
.scene { width: min(1180px, 100%); margin: 0 auto; padding: clamp(30px, 6vh, 72px) 0 32px; display: flex; align-items: center; }
.scene-inner { width: 100%; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.kicker { color: var(--coral); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin-bottom: 14px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(38px, 6vw, 86px); line-height: .98; letter-spacing: -.045em; max-width: 900px; margin-bottom: 24px; }
h2 { font-size: clamp(30px, 4vw, 58px); line-height: 1.04; letter-spacing: -.035em; max-width: 840px; margin-bottom: 18px; }
h3 { font-size: 20px; line-height: 1.2; margin-bottom: 8px; }
.lead { font-size: clamp(17px, 2vw, 22px); line-height: 1.65; color: var(--ink-soft); max-width: 700px; }
.fine { color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.accent { color: var(--coral); }
.quote { border-left: 4px solid var(--coral); padding: 12px 0 12px 20px; font-size: clamp(21px, 3vw, 34px); line-height: 1.3; max-width: 760px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 6vw, 100px); align-items: end; }
.opening-art { display: grid; gap: 16px; align-self: start; }
.opening-art .image-frame img { height: 260px; }
.intro-page { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: left; }
.intro-page h2 { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }
.intro-visual { width: min(100%, 980px); display: flex; justify-content: center; margin-top: 8px; }
.intro-visual img { display: block; width: 100%; height: auto; max-height: 66vh; object-fit: contain; }
.intro-visual .video-frame { width: 100%; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.intro-visual .video-frame video { width: 100%; max-height: 66vh; object-fit: contain; background: transparent; }
.intro-visual .video-expand { bottom: 48px; }
.hero-note { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-soft); line-height: 1.6; }
.video-frame { position: relative; background: #101514; box-shadow: var(--shadow); border: 1px solid #25302c; overflow: hidden; }
.video-frame video { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #101514; }
.video-frame video:fullscreen { width: 100vw; height: 100vh; max-height: none; object-fit: contain; background: #101514; }
.video-expand { position: absolute; right: 12px; bottom: 48px; z-index: 2; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); background: rgba(16,21,20,.78); color: #fffdf8; cursor: pointer; opacity: .82; font-size: 22px; line-height: 1; transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.video-expand:hover, .video-expand:focus-visible { opacity: 1; transform: translateY(-2px); background: rgba(217,104,76,.95); outline: 2px solid rgba(255,253,248,.9); outline-offset: 2px; }
.video-expand:active { transform: translateY(0); }
.image-frame { margin: 0; background: #101514; border: 1px solid #25302c; box-shadow: var(--shadow); overflow: hidden; }
.image-frame img { display: block; width: 100%; height: min(54vh, 430px); object-fit: contain; background: #101514; }
.image-frame figcaption { padding: 12px 14px; background: #1c2925; color: #e6ebe2; font-size: 12px; }
.media-caption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: #1c2925; color: #e6ebe2; font-size: 12px; }
.media-caption span:last-child { color: var(--yellow); }
.media-placeholder { min-height: min(54vh, 430px); background: #1c2925; color: #e6ebe2; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 32px; border: 1px dashed #547066; box-shadow: var(--shadow); }
.media-placeholder > div { display: grid; gap: 6px; }
.media-placeholder strong { color: var(--yellow); font-size: 19px; }
.media-placeholder span { color: #c4d0c8; font-size: 14px; }
.media-placeholder small { color: #8fa198; max-width: 360px; line-height: 1.5; }
.placeholder-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--yellow); color: var(--yellow); font-size: 22px; margin: 0 auto; }
.explanation { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 22px 24px 20px; margin: 22px 0 20px; max-width: 920px; }
.explanation-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 11px; }
.explanation-head span { color: var(--teal); font-size: 11px; letter-spacing: .13em; font-weight: 800; text-transform: uppercase; }
.explanation-head strong { font-size: 18px; }
.explanation p { margin-bottom: 11px; line-height: 1.7; color: var(--ink-soft); }
.script-label { color: var(--coral); font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 10px; }
.script-copy { max-width: 920px; }
.script-copy p { color: var(--ink); font-size: clamp(16px, 1.7vw, 20px); line-height: 1.72; margin: 0 0 10px; }
.explanation ul { margin: 0; padding-left: 19px; color: var(--ink); line-height: 1.75; }
.explanation li::marker { color: var(--coral); }
.lesson-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .42fr); gap: 24px; align-items: start; }
.lesson-top .explanation { margin-top: 0; }
.lesson-copy-full { width: 100%; }
.lesson-illustration .image-frame img { height: 250px; }
.lesson-illustration .image-frame figcaption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview-page h2 { max-width: 900px; }
.career-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.career-card { border: 1px solid var(--line); background: var(--white); text-align: left; padding: 0 0 18px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.career-card:hover, .career-card:focus-visible { transform: translateY(-4px); border-color: var(--coral); box-shadow: var(--shadow); outline: none; }
.career-card .image-frame { border: 0; box-shadow: none; }
.career-card .image-frame img { height: 180px; }
.career-card .image-frame figcaption { display: none; }
.career-tag, .career-card h3, .career-card p, .career-link { margin-left: 18px; margin-right: 18px; }
.career-tag { display: inline-block; margin-top: 16px; color: var(--coral); font-size: 12px; font-weight: 800; }
.career-card h3 { margin-top: 9px; margin-bottom: 8px; font-size: 19px; line-height: 1.3; }
.career-card p { color: var(--ink-soft); line-height: 1.6; font-size: 14px; }
.career-link { display: block; margin-top: 14px; color: var(--teal); font-size: 13px; font-weight: 800; }
.profile-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 24px; }
.profile-badge { border: 1px solid var(--coral); color: var(--coral); padding: 10px 14px; font-weight: 800; white-space: nowrap; }
.profile-card { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.profile-portrait .image-frame img { height: 310px; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-role { background: var(--white); border: 1px solid var(--line); padding: 18px; display: grid; gap: 8px; align-content: start; }
.profile-role span, .before-panel > span, .after-panel > span { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.profile-role strong { font-size: 17px; line-height: 1.45; }
.profile-role.highlight { background: var(--ink); border-color: var(--ink); color: var(--white); }
.profile-role.highlight span { color: var(--yellow); }
.before-after { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 24px; border: 1px solid var(--line); overflow: hidden; }
.before-panel, .after-panel { min-height: 150px; padding: 22px 24px; }
.before-panel { background: var(--paper-deep); }
.after-panel { background: var(--white); border-left: 1px solid var(--line); }
.before-panel strong, .after-panel strong { display: block; margin: 12px 0 8px; font-size: 19px; }
.before-panel p, .after-panel p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.profile-slider { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; height: 100%; margin: 0; transform: translateX(-50%); writing-mode: vertical-lr; accent-color: var(--coral); cursor: ew-resize; opacity: .95; }
.slider-label { grid-column: 1 / -1; text-align: center; padding: 10px; color: var(--coral); font-size: 12px; border-top: 1px solid var(--line); background: rgba(255,253,248,.8); }
.below-note { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 14px; color: var(--ink-soft); font-size: 13px; }
.below-note strong { color: var(--coral); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.panel { background: var(--white); border: 1px solid var(--line); padding: 24px; min-height: 160px; }
.panel.dark { background: var(--ink); color: var(--white); border-color: var(--ink); }
.panel.dark p, .panel.dark .fine { color: #c3cdc4; }
.panel-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); font-weight: 800; margin-bottom: 14px; }
.dark .panel-label { color: var(--yellow); }
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 30px; }
.flow-item { background: var(--white); border: 1px solid var(--line); padding: 17px 13px; min-height: 112px; position: relative; }
.flow-item:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 43px; color: var(--coral); z-index: 1; font-size: 18px; }
.flow-num { color: var(--coral); font-weight: 800; font-size: 12px; margin-bottom: 12px; }
.flow-title { font-weight: 700; font-size: 15px; }
.flow-desc { font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin-top: 6px; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.map-card { background: var(--white); border: 1px solid var(--line); padding: 21px; min-height: 190px; }
.map-card:nth-child(2) { border-top: 4px solid var(--teal); }
.map-card:nth-child(3) { border-top: 4px solid var(--coral); }
.map-card:nth-child(4) { border-top: 4px solid var(--yellow); }
.map-card:nth-child(1) { border-top: 4px solid var(--ink); }
.map-index { font-size: 12px; color: var(--ink-soft); margin-bottom: 22px; }
.map-card p { color: var(--ink-soft); line-height: 1.6; font-size: 14px; }
.case-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 26px; }
.case-tag { border: 1px solid var(--coral); color: var(--coral); padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.case-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: stretch; }
.case-copy { display: grid; gap: 12px; align-content: stretch; }
.case-copy .panel { min-height: auto; }
.case-media { position: sticky; top: 20px; }
.case-media .video-frame video { max-height: 54vh; }
.case-media .image-frame img { height: min(54vh, 430px); }
.case-copy .panel-label { font-size: 22px; line-height: 1.25; letter-spacing: 0; margin-bottom: 16px; }
.case-copy .panel { display: flex; flex-direction: column; justify-content: flex-start; }
.case-copy .panel.dark { justify-content: center; }
.case-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.case-step { background: var(--paper-deep); padding: 13px; min-height: 94px; }
.case-step strong { display: block; font-size: 12px; color: var(--coral); margin-bottom: 8px; }
.case-step span { font-size: 13px; line-height: 1.45; }
.closing { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 30px; display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.controls { position: absolute; top: 86px; right: 28px; z-index: 3; width: auto; margin: 0; display: flex; justify-content: flex-end; align-items: stretch; gap: 10px; }
.control-button { border: 2px solid var(--coral); width: 118px; flex: 0 0 118px; height: 48px; min-height: 48px; padding: 0 18px; cursor: pointer; background: transparent; color: var(--coral); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; vertical-align: middle; }
.control-button span { white-space: nowrap; }
.control-button.primary { background: var(--coral); border-color: var(--coral); color: var(--white); font-weight: 800; }
.control-button:disabled { opacity: .35; cursor: default; }
.control-button:not(:disabled):hover { transform: translateY(-1px); }
.control-hint { font-size: 12px; color: var(--ink-soft); text-align: center; }
.control-button.attention { animation: buttonAttention 1.1s ease both; }
@keyframes buttonAttention { 0% { box-shadow: 0 0 0 0 rgba(217,104,76,0); } 35% { box-shadow: 0 0 0 7px rgba(217,104,76,.18); transform: translateY(-2px); } 100% { box-shadow: 0 0 0 0 rgba(217,104,76,0); transform: translateY(0); } }
.chapter-sidebar { position: sticky; top: 0; height: 100vh; min-width: 0; background: #eee9df; border-left: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; overflow: hidden; }
.chapter-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 5px 15px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 800; }
.chapter-side-head span:last-child { color: var(--coral); font-size: 11px; letter-spacing: .08em; }
.chapter-list-inline { display: grid; gap: 5px; overflow: auto; padding: 14px 0; }
.chapter-item { border: 1px solid transparent; background: transparent; text-align: left; padding: 12px 10px; cursor: pointer; display: grid; grid-template-columns: 27px 1fr; gap: 8px; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.chapter-item:hover, .chapter-item.active { border-color: var(--line); background: var(--white); }
.chapter-item.active { border-left: 3px solid var(--coral); transform: translateX(-3px); box-shadow: 0 4px 13px rgba(23,33,31,.06); }
.chapter-item.active span:first-child { animation: chapterPulse 1.5s ease-in-out infinite; }
@keyframes chapterPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.chapter-item.done span:first-child { color: var(--teal); }
.chapter-item span:first-child { color: var(--coral); font-size: 11px; font-weight: 800; padding-top: 2px; }
.chapter-item span:last-child { font-size: 13px; line-height: 1.38; }
.chapter-drawer { display: none; position: fixed; inset: 0 0 0 auto; width: min(390px, 92vw); background: var(--white); z-index: 10; padding: 24px; transform: translateX(100%); transition: transform .25s ease; box-shadow: -20px 0 50px rgba(23,33,31,.18); }
.chapter-drawer.open { transform: translateX(0); }
.drawer-scrim { position: fixed; inset: 0; z-index: 9; background: rgba(23,33,31,.32); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.chapter-list { display: grid; gap: 6px; margin-top: 18px; }
.chapter-item { border: 1px solid transparent; background: transparent; text-align: left; padding: 14px 12px; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.chapter-item:hover, .chapter-item.active { border-color: var(--line); background: var(--paper); }
.chapter-item span:first-child { color: var(--coral); font-size: 12px; font-weight: 800; }
.chapter-item span:last-child { font-size: 14px; line-height: 1.4; }

@media (max-width: 850px) {
  .app-shell { display: block; }
  .rail { position: sticky; z-index: 8; top: 0; width: 100%; height: 68px; padding: 9px 14px; display: grid; grid-template-columns: minmax(0, 1fr) 88px auto auto; gap: 12px; align-items: center; overflow: visible; }
  .rail-brand { order: 1; margin: 0; padding: 0; border: 0; display: flex; justify-content: flex-start; gap: 9px; min-width: 0; }
  .brand-star { display: none; }
  .brand-logo { width: 43px; height: 43px; border-radius: 8px; flex: 0 0 auto; }
  .brand-title { display: block; text-align: left; font-size: 13px; line-height: 1.28; letter-spacing: .04em; white-space: nowrap; }
  .rail-label { display: none; }
  .progress-track { order: 2; width: 88px; height: 3px; margin: 0; }
  .progress-track span { width: var(--progress, 12%); height: 100%; transition: width .35s ease; }
  .step-count { order: 3; font-size: 10px; white-space: nowrap; }
  .rail-button { order: 4; margin-top: 0; font-size: 21px; padding: 6px; }
  .stage { min-height: calc(100vh - 68px); padding: 15px 20px 20px; }
  .controls { position: static; width: 100%; margin: 0 auto; justify-content: space-between; align-items: stretch; border-top: 1px solid var(--line); padding-top: 14px; }
  .control-button { width: 118px; flex-basis: 118px; min-width: 50px; }
  .chapter-sidebar { display: none; }
  .chapter-drawer { display: block; }
  .hero-grid, .case-grid { grid-template-columns: 1fr; }
  .lesson-top { grid-template-columns: 1fr; }
  .lesson-illustration { order: -1; }
  .profile-heading { display: block; }
  .profile-badge { display: inline-block; margin-top: 10px; }
  .profile-card { grid-template-columns: 1fr; }
  .profile-facts { grid-template-columns: 1fr; }
  .career-grid { grid-template-columns: 1fr; }
  .case-media { position: static; order: -1; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr; }
  .flow-item { min-height: auto; }
  .flow-item:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -18px; }
}

@media (max-width: 560px) {
  .rail { grid-template-columns: minmax(0, 1fr) 60px auto auto; gap: 8px; padding-inline: 10px; }
  .progress-track { width: 60px; }
  .brand-title { font-size: 12px; }
  .topbar { align-items: flex-start; }
  .eyebrow { display: none; }
  .top-actions { margin-left: auto; }
  h1 { font-size: 43px; }
  h2 { font-size: 34px; }
  .scene { padding-top: 34px; }
  .split, .map-grid, .case-steps { grid-template-columns: 1fr; }
  .case-head, .closing { display: block; }
  .case-tag { display: inline-block; margin-top: 10px; }
  .controls { position: sticky; bottom: 0; background: rgba(245,242,234,.96); padding-bottom: max(5px, env(safe-area-inset-bottom)); }
  .control-button span { display: none; }
  .control-button { width: 46px; flex-basis: 46px; min-width: 46px; padding: 0 12px; }
  .video-expand { right: 8px; bottom: 46px; width: 38px; height: 38px; font-size: 20px; }
}
