/* Video-lecture pages (Lecture 10, ...). Builds on tutorial.css. */
html { scroll-behavior: smooth; }
.hero .btn-play { background: #fff; color: var(--dark); font-weight: 500; border-color: #fff; }
.hero .btn-play:hover, .hero .btn-play:focus { background: #ffe9e4; color: var(--dark); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- hero + theatre: the player overlaps the bottom of the hero ---------- */
.hero.hero-v { padding: 26px 0 150px; }
.hero.hero-v h1 { margin-bottom: 4px; }
.hero.hero-v p.lead { margin-bottom: 10px; }
.hero.hero-v .badge-row a { color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); border-radius: 14px; display: inline-block; margin: 3px 6px 3px 0; font-size: 13px; font-weight: 500;
	padding: 3px 11px; text-decoration: none; transition: background .2s; }
.hero.hero-v .badge-row a:hover { background: rgba(255,255,255,.3); }
.theater { margin-top: -128px; position: relative; }
.theater-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
.theater .now-bar { padding-top: 10px; }

/* chapters panel: same height as the player column, scrolls inside */
.chapters { position: relative; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.16); min-height: 320px; }
.chapters .ch-in { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); }
.ch-head b { font-size: 16px; font-weight: 500; }
.ch-head span { font-size: 12px; color: var(--mute); }
.ch-list { flex: 1; overflow-y: auto; padding: 6px; position: relative; scroll-behavior: smooth; }
.ch-row { display: flex; gap: 10px; padding: 6px; border-radius: 8px; color: #333; text-decoration: none; transition: background .2s; }
.ch-row:hover, .ch-row:focus { background: var(--soft2); text-decoration: none; color: #333; }
.ch-row .th { flex: 0 0 100px; aspect-ratio: 16 / 9; border-radius: 5px; background: #222 center / cover no-repeat; position: relative; overflow: hidden; }
.ch-row .th .dur { position: absolute; right: 4px; bottom: 5px; background: rgba(0,0,0,.75); color: #fff; font-size: 11px; padding: 0 5px; border-radius: 3px; }
.ch-row .th .pb { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--red); }
.ch-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ch-row .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.ch-row .t { font-size: 14px; line-height: 1.3; }
.ch.active > .ch-row { background: var(--soft); }
.ch.active > .ch-row .k { color: var(--red); }
.ch.active > .ch-row .t { color: var(--dark); font-weight: 500; }
.ch-slides { display: none; margin: 0 4px 6px 22px; border-left: 2px solid #f0d6d0; animation: foldin .35s ease; }
.ch.open .ch-slides { display: block; }
.ch-slides a { display: flex; gap: 8px; font-size: 12.5px; padding: 2px 8px; line-height: 1.45; color: #555; text-decoration: none; border-radius: 0 4px 4px 0; transition: background .2s; }
.ch-slides a:hover { background: var(--soft2); color: #222; }
.ch-slides a .t2 { color: #aaa; min-width: 34px; font-variant-numeric: tabular-nums; }
.ch-slides a .ti { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-slides a.cur { background: var(--soft); color: var(--dark); box-shadow: inset 3px 0 0 var(--red); }
.ch-slides a.cur .t2 { color: var(--red); }
@media (max-width: 991px) {
	.theater-grid { grid-template-columns: minmax(0, 1fr); }
	.chapters .ch-in { position: static; }
	.ch-list { max-height: 420px; }
}

/* ---------- player ---------- */
.stage { background: #111; border-radius: 10px; overflow: hidden; position: relative; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.stage video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #111; transition: opacity .35s ease; }
.stage.switching video { opacity: 0; }
.now-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 2px 4px; }
.now-bar .where { flex: 1 1 320px; min-width: 0; }
.now-bar .where .p { color: var(--red); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.now-bar .where .s { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .25s; }
.now-bar .ctrl .btn { margin-left: 4px; }
.now-bar .ctrl .btn.on { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- transcript ---------- */
.transcript { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; background: #fff; scroll-behavior: smooth; }
.transcript .slide-h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); padding: 10px 10px 2px; }
.transcript p { margin: 0; padding: 5px 10px; border-radius: 6px; cursor: pointer; line-height: 1.55; transition: background .3s, color .3s; }
.transcript p:hover { background: var(--soft2); }
.transcript p .zh { display: block; color: #8a6d3b; font-size: 14px; }
.transcript p.cur { background: var(--soft); color: var(--dark); }
.transcript.en .zh, .transcript.zh .en { display: none; }
.transcript.zh p .zh { color: inherit; font-size: inherit; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font-size: 13px; color: #444; }
.seg button.on { background: var(--red); color: #fff; }

/* progress in the side TOC */
.toc .part-link { position: relative; }
.toc .part-link .pbar { display: block; height: 2px; background: var(--line); margin-top: 3px; border-radius: 1px; overflow: hidden; }
.toc .part-link .pbar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .5s linear; }

@media (prefers-reduced-motion: reduce) { .reveal, .reveal.in { opacity: 1; transform: none; transition: none; } .stage video { transition: none; } }

/* ---------- "up next" corner toast (replaces the full-screen card) ---------- */
.upnext { position: absolute; right: 14px; top: 14px; width: 290px; background: rgba(255,255,255,.97); color: #222; border-radius: 10px;
	box-shadow: 0 8px 26px rgba(0,0,0,.28); padding: 12px 14px 12px; opacity: 0; transform: translateX(24px); pointer-events: none;
	transition: opacity .45s ease, transform .45s ease; z-index: 3; }
.upnext.show { opacity: 1; transform: none; pointer-events: auto; }
.upnext .un-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 500; }
.upnext .un-t { font-size: 15px; line-height: 1.35; margin: 3px 22px 8px 0; }
.upnext .un-bar { height: 3px; background: #eee; border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.upnext .un-bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s linear; }
.upnext .un-row { display: flex; gap: 8px; flex-wrap: wrap; }
.upnext .un-btn { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 3px 12px; font-size: 13px; color: #333; text-decoration: none; }
.upnext .un-btn:hover { border-color: var(--red); color: var(--red); }
.upnext .un-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; color: #999; }
.upnext .un-x:hover { color: #333; }
@media (max-width: 600px) { .upnext { width: auto; left: 10px; right: 10px; } }

/* ---------- lecture map: the core logic as a vertical storyline ---------- */
.question { font-size: 19px; font-style: italic; color: var(--dark); border-left: 4px solid var(--red); padding: 6px 14px; margin: 10px 0 16px; background: var(--soft); border-radius: 4px; }
.story { list-style: none; padding-left: 0; position: relative; margin: 6px 0 10px; }
.story:before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--red), #e8b8ae); }
.story > li { position: relative; padding: 0 0 18px 52px; }
.story > li .dot { position: absolute; left: 4px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--red);
	color: var(--red); font-weight: 600; font-size: 13px; text-align: center; line-height: 24px; }
.story > li h4 { margin: 2px 0 4px; font-size: 17px; }
.story > li p { margin: 0 0 4px; color: #444; font-size: 15px; }
.story > li .go a { display: inline-block; font-size: 12.5px; background: #f3f3f3; border-radius: 12px; padding: 1px 9px; margin: 3px 4px 0 0; color: #333; text-decoration: none; transition: background .2s, color .2s; }
.story > li .go a:hover { background: var(--red); color: #fff; }

/* ---------- concept index ---------- */
.cindex { columns: 3 230px; column-gap: 26px; }
.cindex .grp { break-inside: avoid; margin-bottom: 14px; }
.cindex .grp .h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--red); font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 4px; }
.cindex a { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: #333; padding: 2px 0; text-decoration: none; }
.cindex a:hover { color: var(--red); }
.cindex a span { color: #aaa; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- foldable panels ---------- */
details.fold { border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 12px 0; }
details.fold > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:before { content: "\25B8"; color: var(--red); transition: transform .25s; display: inline-block; }
details.fold[open] > summary:before { transform: rotate(90deg); }
details.fold > summary .muted { font-size: 13px; margin-left: auto; }
details.fold > .inner { padding: 0 16px 14px; animation: foldin .35s ease; }
@keyframes foldin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- tutorials, trends, quotes ---------- */
.tut { border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 10px; padding: 14px 18px; background: #fff; display: flex; flex-direction: column; }
.tut .k { color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.tut h4 { margin: 4px 0 6px; }
.tut ul { padding-left: 18px; margin: 4px 0 8px; font-size: 14.5px; color: #444; }
.tut .meta { font-size: 12.5px; color: var(--mute); margin-top: auto; padding-top: 6px; }
.tut .meta img { vertical-align: middle; margin-right: 6px; }
.trend { border-radius: 10px; padding: 14px 16px; background: linear-gradient(180deg, #fff, #fbf6f5); border: 1px solid #f0dcd7; }
.trend .ic { font-size: 22px; }
.trend h4 { margin: 4px 0 6px; font-size: 16px; }
.trend p { font-size: 14px; color: #444; margin: 0; }
.trend .src { font-size: 12px; color: var(--mute); margin-top: 6px; }
.quote { border-left: 4px solid var(--red); padding: 8px 16px; margin: 0; background: #fff; }
.quote p { font-size: 17px; font-style: italic; color: #333; margin: 0 0 4px; }
.quote footer { font-size: 13px; color: var(--mute); }
.quote .why { font-size: 13.5px; color: #555; margin-top: 4px; font-style: normal; }
.grid > .tut, .grid > .trend, .grid > .quote { flex: 1 1 260px; margin: 0; min-width: 0; }
.grid.two > .quote { flex-basis: 340px; }

/* lecture map: five acts */
	clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; transition: background .2s, color .2s; }
.story > li.act { padding: 6px 0 14px 52px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; scroll-margin-top: 20px; }
.story > li.act:not(:first-child) { margin-top: 8px; }
.story > li.act .act-n { position: absolute; left: 0; top: 2px; width: 36px; height: 26px; border-radius: 13px; background: var(--red); color: #fff;
	font-weight: 600; font-size: 13px; text-align: center; line-height: 26px; }
.story > li.act .act-name { font-size: 20px; color: var(--red); margin-right: 10px; }
.story > li.act .act-sub { color: #555; font-size: 15px; }

.ch-tg { flex: 0 0 22px; align-self: center; text-align: center; color: #bbb; font-size: 13px; border-radius: 50%; line-height: 22px; transition: transform .25s, color .2s, background .2s; }
.ch-tg:hover { color: var(--red); background: #fff; }
.ch.open .ch-tg { transform: rotate(180deg); color: var(--red); }

/* wider page */
@media (min-width: 1200px) { body.wide .container { width: auto; max-width: 1500px; padding-left: 32px; padding-right: 32px; } }

/* lecture map: five act cards */
.acts { display: grid; grid-template-columns: 1fr 1.25fr 1.2fr 1.2fr 1fr; gap: 14px; margin: 12px 0 14px; }
.act-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 8px; padding: 10px 12px; background: #fff; }
.act-card:not(:last-child):after { content: "\203A"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--red); font-size: 22px; line-height: 1; }
.act-card .ac-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.act-card .act-n { display: inline-block; min-width: 30px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-weight: 600; font-size: 12px; text-align: center; line-height: 22px; padding: 0 6px; }
.act-card .ac-h b { font-size: 16px; font-weight: 500; color: var(--dark); }
@media (max-width: 991px) { .acts { grid-template-columns: 1fr 1fr; } .act-card:after { display: none; } }
@media (max-width: 560px) { .acts { grid-template-columns: 1fr; } }
.map-lead { font-size: 15.5px; color: #333; max-width: 980px; }
.act-card .ac-gain { font-size: 13.5px; color: #666; line-height: 1.4; margin-bottom: 8px; min-height: 38px; }
.act-card .ac-ch { border-top: 1px dashed var(--line); padding-top: 6px; }
.act-card .ac-ch a { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #222; padding: 4px 4px; border-radius: 5px; text-decoration: none; transition: background .2s, color .2s; }
.act-card .ac-ch a:hover { background: var(--soft); color: var(--red); }
.act-card .ac-ch .cn, .story > li .dot { font-variant-numeric: tabular-nums; }
.act-card .ac-ch .cn { flex: 0 0 22px; height: 22px; border-radius: 5px; background: var(--soft); color: var(--red); font-size: 12px; font-weight: 600; text-align: center; line-height: 22px; }
.act-card .ac-ch a:hover .cn { background: var(--red); color: #fff; }
.story > li h4 a { color: var(--ink); text-decoration: none; cursor: pointer; }
.story > li h4 a:hover { color: var(--red); }
.story > li .nextq { font-size: 14px; color: #777; font-style: italic; margin: 2px 0 2px; }
