/* 面向对象编程 C# 课程站：白底、大字、一个强调色；动效全部交给 main.js 里的 GSAP。 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #f5f5f3;
  --ink: #141414;
  --sub: #6b6b6b;
  --faint: #86868a;
  --line: #e6e6e2;
  --accent: #5b3fd1;
  --ok: #18804a;
  --bad: #c2362b;
  --r: 20px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Cascadia Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 19px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.nw { white-space: nowrap; }
code { font-family: var(--mono); font-size: .9em; background: var(--soft); padding: .1em .35em; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }

/* 导航 */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.nav-in { width: min(1180px, 100% - 48px); margin-inline: auto; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.mark { display: flex; align-items: center; }
.mark img { height: 40px; width: auto; display: block; }
.nav nav { display: flex; gap: 28px; font-size: 15px; color: var(--sub); }
.nav nav a:hover { color: var(--ink); }

/* 通用 */
.eyebrow { margin: 0 0 14px; font-size: 16px; color: var(--sub); }
.lede { text-wrap: balance; margin: 22px auto 0; max-width: 34em; font-size: clamp(20px, 2.1vw, 26px); line-height: 1.55; color: var(--sub); }
.btn { display: inline-block; padding: 12px 26px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; transition: background .2s; }
.btn:hover { background: #4a30b8; }
.link { color: var(--accent); font-size: 18px; }
.link:hover { text-decoration: underline; }
.sec-h { margin-bottom: 40px; }
.sec-h h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.15; }
.sec-h p { text-wrap: balance; margin: 12px 0 0; max-width: 40em; color: var(--sub); font-size: 19px; }

/* 首页：开场 */
.hero { padding: clamp(80px, 12vh, 140px) 0 56px; text-align: center; }
.hero h1 { font-size: clamp(30px, 7.4vw, 96px); line-height: 1.05; letter-spacing: -.025em; }
.hero h1 span { display: block; color: var(--accent); }
.cta { margin: 36px 0 0; display: flex; gap: 28px; justify-content: center; align-items: center; flex-wrap: wrap; }
.stage { padding: 0 24px; }
.stage-fig { margin: 0 auto; max-width: 1400px; border-radius: 28px; overflow: hidden; background: #0d1b33; transform-origin: 50% 0; box-shadow: 0 30px 80px -40px rgba(10, 20, 50, .45); }
.stage-fig img { width: 100%; height: auto; }

/* 首页：数字 */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 110px 0 30px; text-align: center; }
.fact b { display: block; font-size: clamp(48px, 6vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fact span { display: block; margin-top: 12px; color: #444; font-size: 19px; }

/* 首页：一段话随滚动亮起 */
.statement { padding: 110px 0 120px; }
.say { margin: 0; max-width: 23em; font-size: clamp(28px, 3.6vw, 48px); line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }
.say-src { margin: 26px 0 0; color: var(--faint); font-size: 16px; }

/* 首页：章节 */
.chapters { padding-bottom: 60px; }
.part { margin-bottom: 72px; }
.part-h { display: flex; align-items: baseline; gap: 14px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.part-h h3 { font-size: 26px; }
.part-h h3 span { display: block; color: var(--sub); font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.part-h em { margin-left: auto; font-style: normal; color: var(--faint); font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 24px; }
.card { display: block; }
.card-img { position: relative; display: block; aspect-ratio: 1920 / 950; border-radius: 14px; overflow: hidden; background: #0d1b33; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-img img { transform: scale(1.04); }
.seen { position: absolute; top: 10px; right: 10px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ok); font-size: 13px; font-weight: 600; }
.card-t { display: grid; grid-template-columns: auto minmax(0, 1fr); margin-top: 14px; font-size: 18px; font-weight: 600; line-height: 1.4; }
.card-t b { margin-right: 10px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.card-m { display: block; margin-top: 2px; color: var(--sub); font-size: 15px; font-variant-numeric: tabular-nums; }

/* 首页：底部两栏 */
.band { background: var(--soft); padding: 100px 0; }
.band-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.band h2 { font-size: clamp(30px, 3.4vw, 44px); }
.band p { margin: 14px 0 18px; color: var(--sub); max-width: 28em; }

/* 子页标题 */
.phead, .chead { padding: clamp(70px, 10vh, 120px) 0 50px; text-align: center; }
.phead h1, .chead h1 { font-size: clamp(44px, 6.4vw, 88px); line-height: 1.1; letter-spacing: -.02em; }

/* 键值条 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 90px; }
.kv div { background: var(--soft); padding: 26px 28px; }
.kv span { display: block; color: var(--sub); font-size: 15px; }
.kv b { display: block; margin-top: 6px; font-size: 22px; font-weight: 600; }

/* 授课计划 */
.prose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; margin-bottom: 110px; }
.prose h2 { font-size: 28px; margin-bottom: 14px; }
.prose p { margin: 0 0 14px; color: #333; }
.weeks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wk { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 320px); gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.wk-n b { display: block; font-size: 19px; }
.wk-n span { color: var(--sub); font-size: 15px; }
.wk-c h3 { font-size: 22px; font-weight: 600; }
.items { margin: 8px 0 0; color: var(--sub); font-size: 17px; }
.items span { display: inline-block; }
.items span:not(:last-child)::after { content: "·"; margin: 0 .7em; color: var(--faint); }
.wk-v { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.wk-v a { font-size: 16px; padding: 6px 14px; border-radius: 999px; background: var(--soft); transition: background .2s; }
.wk-v a:hover { background: #ebe8f8; color: var(--accent); }
.wk-v a b { margin-right: 8px; color: var(--faint); font-weight: 600; }
.wk-v .none { color: var(--faint); font-size: 15px; padding-top: 6px; }
.wk.off h3 { color: var(--sub); }
.aside { margin: 44px 0 120px; }
.aside p { margin: 0 0 14px; color: var(--sub); font-size: 17px; }

/* 课后作业 */
.hw { list-style: none; margin: 0 0 120px; padding: 0; border-top: 1px solid var(--line); }
.hw li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.hw-n { font-size: 22px; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hw-t { margin: 0 0 6px; color: var(--sub); font-size: 15px; }
.hw li p:not(.hw-t) { margin: 0; font-size: 20px; }

/* 章节页 */
.chead .lede { font-size: clamp(18px, 1.8vw, 22px); max-width: 38em; }
.player-wrap { padding: 0 24px; }
.player { position: relative; margin: 0 auto; max-width: 1240px; border-radius: 22px; overflow: hidden; background: #0d1b33; box-shadow: 0 30px 80px -40px rgba(10, 20, 50, .5); }
.player video { width: 100%; aspect-ratio: 16 / 9; background: #0d1b33; }
.player-miss { position: absolute; inset: auto 0 0; margin: 0; padding: 12px; text-align: center; color: #fff; background: rgba(0, 0, 0, .6); font-size: 16px; }
.meta { display: flex; gap: 28px; justify-content: center; margin: 22px 0 0; color: var(--sub); font-size: 16px; }
.meta a { color: var(--accent); }
.goals { max-width: 1080px; padding: 100px 0 40px; }
.goals h2 { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 22px; }
.goals ul { margin: 0; padding: 0; list-style: none; }
.goals li { position: relative; padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); font-size: 20px; }
.goals li::before { content: ""; position: absolute; left: 4px; top: 27px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.quiz { max-width: 1080px; padding: 80px 0 40px; }
.quiz ol { list-style: none; margin: 0; padding: 0; }
.q { margin-bottom: 44px; }
.q-t { margin: 0 0 16px; font-size: 21px; font-weight: 600; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.q-t code, .opt code { white-space: normal; overflow-wrap: break-word; }
.goals code { overflow-wrap: break-word; }
.opt span { min-width: 0; }
.q-t .q-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--sub); font-size: 15px; display: grid; place-items: center; margin-top: 2px; }
.opts { display: grid; gap: 10px; padding-left: 44px; }
.opt { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; font: inherit; font-size: 18px; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 13px 18px; cursor: pointer; transition: border-color .2s, background .2s; }
.opt:hover:not(:disabled) { border-color: #c9c2ee; background: #faf9ff; }
.opt b { color: var(--faint); font-weight: 600; }
.opt:disabled { cursor: default; }
.opt.is-ok { border-color: var(--ok); background: #f0f8f3; }
.opt.is-ok b { color: var(--ok); }
.opt.is-bad { border-color: var(--bad); background: #fcf1f0; }
.opt.is-bad b { color: var(--bad); }
.q-fb { margin: 12px 0 0 44px; font-size: 18px; color: #444; }
.q-fb:empty { display: none; }
.q-fb strong { color: var(--ink); }
.score { margin: 0; padding: 24px 28px; border-radius: var(--r); background: var(--soft); font-size: 19px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.score button { font: inherit; font-size: 17px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.pn { max-width: 1080px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 80px 0 110px; }
.pn a { display: block; padding: 26px 30px; border-radius: var(--r); background: var(--soft); font-size: 22px; font-weight: 600; transition: background .2s; }
.pn a:hover { background: #eeece8; }
.pn a[rel="next"] { text-align: right; }
.pn small { display: block; color: var(--sub); font-size: 15px; font-weight: 400; margin-bottom: 4px; }

/* 讲义 */
.goals ul, .quiz ol, .score { max-width: 860px; }
.doc { width: min(1080px, 100% - 48px); padding: 100px 0 20px; }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 48px; }
.doc-toc a { font-size: 15px; padding: 6px 14px; border-radius: 999px; background: var(--soft); transition: background .2s; }
.doc-toc a:hover { background: #ebe8f8; color: var(--accent); }
.doc-toc b { margin-right: 6px; color: var(--faint); font-weight: 600; }
.doc-body > p, .doc-body > ul, .doc-body > ol, .doc-body > h4 { max-width: 44em; }
.doc-body p { margin: 0 0 18px; }
.doc-body ul, .doc-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.doc-body li { margin: 6px 0; }
.doc-body strong { font-weight: 650; }
.doc-body h3 { display: flex; align-items: center; gap: 14px; font-size: clamp(24px, 2.4vw, 30px); margin: 72px 0 20px; scroll-margin-top: 80px; }
.doc-body h3:first-child { margin-top: 0; }
.doc-body h3 span { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; display: grid; place-items: center; }
.doc-body h4 { font-size: 20px; margin: 40px 0 12px; }
.code { margin: 8px 0 22px; border: 1px solid var(--line); border-radius: 16px; background: #fafaf8; overflow: hidden; }
.code figcaption, .run figcaption { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; font-size: 14px; color: var(--sub); border-bottom: 1px solid var(--line); }
.copy { font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 2px 0; cursor: pointer; }
.code-scroll { overflow-x: auto; }
.code table { border-collapse: collapse; width: 100%; }
.code td { vertical-align: top; padding: 0 12px; }
.code tr:first-child td { padding-top: 12px; }
.code tr:last-child td { padding-bottom: 12px; }
.code .ln { width: 1%; text-align: right; color: var(--faint); font: 13px/28px var(--mono); user-select: none; padding-right: 4px; }
.code .src { width: 1%; white-space: pre; font: 16px/28px var(--mono); }
.code .src code { background: none; padding: 0; border-radius: 0; font: 16px/28px var(--mono); color: var(--ink); }
.code .note { min-width: 16em; padding-left: 24px; font: 16px/28px var(--mono); }
.code .note code { background: none; padding: 0; border-radius: 0; font: 16px/28px var(--mono); color: #2e7d32; }
.code .note .sl { color: #2e7d32; }
.code tr:hover td { background: #f1effa; }
.code tr.blank:hover td { background: none; }
.t-kw { color: #5b3fd1; }
.t-type { color: #0b7285; }
.t-str { color: #b54708; }
.t-num { color: #1f7a3a; }
.t-com { color: #8a8a86; }
.run { margin: 8px 0 26px; border-radius: 16px; overflow: hidden; background: #17191e; }
.run figcaption { color: #9a9ca3; border-bottom-color: #2a2d34; }
.run pre { margin: 0; padding: 14px 18px; color: #ececec; font: 15px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.run.error pre { color: #ff9b8f; }
.run.warn { background: #fdf6e3; }
.run.warn figcaption { color: #8a6d1f; border-bottom-color: #f0e2b6; }
.run.warn pre { color: #6b5414; }
.run.file { background: var(--soft); }
.run.file figcaption { color: var(--sub); border-bottom-color: var(--line); }
.run.file pre { color: var(--ink); }
@media (max-width: 720px) {
  .doc { width: calc(100% - 32px); padding-top: 72px; }
  .code tr { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); }
  .code td { padding: 0 10px; }
  .code tr:first-child td, .code tr:last-child td { padding-top: 0; padding-bottom: 0; }
  .code table { padding: 8px 0; display: block; }
  .code tbody { display: block; }
  .code .src { width: auto; grid-column: 2; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 22px; }
  .code .src code { font-size: 13px; line-height: 22px; }
  .code .ln { line-height: 22px; font-size: 12px; }
  .code .note { width: auto; grid-column: 2; min-width: 0; padding: 0 10px 8px; }
  .code .note code { font-size: 13px; line-height: 22px; white-space: pre-wrap; }
  .code tr.blank { display: none; }
}

.full { margin: -10px 0 22px; }
.full summary { cursor: pointer; display: inline-block; font-size: 15px; color: var(--accent); padding: 4px 0; list-style: none; }
.full summary::-webkit-details-marker { display: none; }
.full summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .2s; }
.full[open] summary::before { transform: rotate(90deg); }
.full .code { margin-top: 8px; }

/* 页脚 */
.foot { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--sub); font-size: 14px; }
.foot-in p { margin: 4px 0; }

/* 窄屏 */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wk { grid-template-columns: 130px minmax(0, 1fr); }
  .wk-v { grid-column: 2; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .wrap, .nav-in { width: calc(100% - 32px); }
  .nav nav { gap: 16px; font-size: 14px; }
  .mark img { height: 28px; }
  .stage, .player-wrap { padding: 0 16px; }
  .stage-fig { border-radius: 16px; }
  .player { border-radius: 14px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; padding-top: 72px; }
  .statement { padding: 72px 0 80px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .card-t { font-size: 16px; }
  .band-in, .prose { grid-template-columns: minmax(0, 1fr); }
  .wk { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wk-v { grid-column: auto; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv div { padding: 20px; }
  .kv b { font-size: 18px; }
  .hw li { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .hw-n { font-size: 22px; }
  .hw li p:not(.hw-t) { font-size: 18px; }
  .opts, .q-fb { padding-left: 0; margin-left: 0; }
  .meta { flex-direction: column; gap: 4px; align-items: center; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn a[rel="next"] { text-align: left; }
}
/* 页脚备案号 */
.foot .beian { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; }
.foot .beian a { display: inline-flex; align-items: center; gap: 5px; color: var(--sub); }
.foot .beian a:hover { color: var(--ink); }
.foot .beian img { width: 14px; height: auto; }
