/*
 * Onshape 色系 · reveal.js 主题（第一套）
 * 画布 1920×1080 · 12 栏网格（栏宽 96 / 栏距 48 / 边距 120）· 全部左对齐
 * 用法：reveal.css 之后引入本文件，Reveal.initialize({ width:1920, height:1080, margin:0, center:false })
 */
@import url(./fonts/fonts.css);

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 品牌色 */
  --c-primary: #1B5FAA;
  --c-primary-strong: #094174;
  --c-primary-soft: #90CEF1;
  --c-primary-tint: #DEF1FB;
  --c-highlight: #FFC107;
  /* 中性色 */
  --c-text: #333333;
  --c-text-2: #5C6670;
  --c-muted: #949BA0;
  --c-line: #E3E6E9;
  --c-surface: #F4F6F8;
  --c-bg: #FFFFFF;
  /* 语义色：描边 / 底色 / 文字 */
  --c-info-line: #B2DDF6;    --c-info-bg: #DEF1FB;    --c-info-text: #094174;
  --c-success-line: #A2DB7D; --c-success-bg: #DDF6CC; --c-success-text: #028502;
  --c-warn-line: #FCDA7F;    --c-warn-bg: #FFF8E6;    --c-warn-text: #8A5A00;
  --c-error-line: #DD979B;   --c-error-bg: #F9EBEC;   --c-error-text: #BD3039;
  /* 数据色 */
  --c-data-1: #1B5FAA; --c-data-2: #FFC107; --c-data-3: #21918C; --c-data-4: #90CEF1;

  /* 字体 */
  --f-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-mono: "Azeret Mono", "Noto Sans SC", Consolas, Menlo, monospace;   /* 0 为无点无斜线的圆角 0 */
  --f-num: "Inter", "Noto Sans SC", sans-serif;                          /* 页码、章节号、序号：Inter 等宽数字 */

  /* 字号（1920 画布） */
  --fs-cover: 120px;
  --fs-h2: 72px;
  --fs-h3: 48px;
  --fs-body: 40px;
  --fs-caption: 32px;
  --fs-code: 32px;
  --fs-chrome: 24px;

  /* 网格与间距 */
  --margin-x: 120px;
  --band-top: 72px;
  --col: 96px;
  --gutter: 48px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;

  /* reveal.js 自带变量 */
  --r-background: var(--c-bg);
  --r-background-color: var(--c-bg);
  --r-main-font: var(--f-sans);
  --r-main-font-size: var(--fs-body);
  --r-main-color: var(--c-text);
  --r-block-margin: 0;
  --r-heading-margin: 0;
  --r-heading-font: var(--f-sans);
  --r-heading-color: var(--c-text);
  --r-heading-line-height: 1.2;
  --r-heading-letter-spacing: 0;
  --r-heading-text-transform: none;
  --r-heading-text-shadow: none;
  --r-heading-font-weight: 700;
  --r-code-font: var(--f-mono);
  --r-link-color: var(--c-primary);
  --r-link-color-dark: var(--c-primary-strong);
  --r-link-color-hover: var(--c-primary-strong);
  --r-selection-background-color: var(--c-primary-tint);
  --r-selection-color: var(--c-text);
  --r-overlay-element-bg-color: 244, 246, 248;
  --r-overlay-element-fg-color: 51, 51, 51;

  /* VS Code Dark Modern + Dark+（代码面板专用，不受全局色系约束） */
  --vs-bg: #1F1F1F;
  --vs-tabs-bg: #181818;
  --vs-border: #2B2B2B;
  --vs-fg: #CCCCCC;
  --vs-tab-fg: #9D9D9D;
  --vs-tab-active-fg: #FFFFFF;
  --vs-tab-accent: var(--c-primary);
  --vs-ln: #6E7681;
  --vs-ln-active: #CCCCCC;
  --vs-keyword: #569CD6;
  --vs-control: #C586C0;
  --vs-string: #CE9178;
  --vs-function: #DCDCAA;
  --vs-variable: #9CDCFE;
  --vs-type: #4EC9B0;
  --vs-number: #B5CEA8;
  --vs-comment: #6A9955;
  --vs-constant: #4FC1FF;
  --vs-regexp: #D16969;
  --vs-operator: #D4D4D4;
}

/* ---------- 2. 基础排版 ---------- */
.reveal-viewport { background: var(--c-bg); }
.reveal {
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  color: var(--c-text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
.reveal .slides { text-align: left; }
.reveal .slides > section,
.reveal .slides > section > section {
  box-sizing: border-box;
  width: 1920px;
  height: 1080px;
  line-height: 1.5;
}
/* 只清掉没有版式的 section（如垂直堆叠的外层）的内边距；带 l-* 的页面由版式规则决定，
   否则 slides > section > section 的权重会压过版式，细节页丢掉网格边距 */
.reveal .slides > section:not([class*="l-"]),
.reveal .slides > section > section:not([class*="l-"]) { padding: 0; }
.reveal ::selection { background: var(--c-primary-tint); color: var(--c-text); }
.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  margin: 0; color: var(--c-text); font-family: var(--f-sans);
  font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: none; text-shadow: none;
}
.reveal h2 { font-size: var(--fs-h2); }
.reveal h3 { font-size: var(--fs-h3); line-height: 1.25; }
.reveal p { margin: 0; line-height: 1.5; }
.reveal p + p { margin-top: var(--s4); }
.reveal strong { font-weight: 700; }
.reveal em { font-style: normal; color: var(--c-primary); }
.reveal a { color: var(--c-primary); text-decoration: none; border-bottom: 2px solid var(--c-primary-soft); }
.reveal ul, .reveal ol { display: block; margin: 0; padding: 0; list-style: none; }
.reveal ul > li, .reveal ol > li { position: relative; padding-left: 40px; line-height: 1.5; }
.reveal ul > li + li, .reveal ol > li + li { margin-top: var(--s3); }
.reveal ul > li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em;
  width: 12px; height: 12px; background: var(--c-primary);
}
.reveal ol { counter-reset: ol; }
.reveal ol > li { counter-increment: ol; padding-left: 64px; }
.reveal ol > li::before {
  content: counter(ol, decimal-leading-zero); position: absolute; left: 0; top: 0.12em;
  font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.8em; color: var(--c-primary);
}
.reveal code { font-family: var(--f-mono); }
.reveal :not(pre) > code {
  font-size: 0.9em; padding: 2px 10px; border-radius: 6px;
  background: var(--c-surface); color: var(--c-text);
}
.reveal img, .reveal video, .reveal iframe { max-width: none; max-height: none; margin: 0; }

/* ---------- 3. 页面骨架：每个 section 都是 12 栏网格 ---------- */
.reveal section[class*="l-"] {
  display: grid !important;
  grid-template-columns: repeat(12, var(--col));
  column-gap: var(--gutter);
  align-content: start;
  padding: calc(var(--band-top) + 48px) var(--margin-x) 96px;
}
.reveal section[class*="l-"] > * { grid-column: 1 / -1; }
/* 绝对定位的元素不参与网格 */
.reveal section[class*="l-"] > .statusbar,
.reveal section[class*="l-"] > .media { grid-column: auto !important; grid-row: auto !important; }

/* 页标题：结论句 + 主题蓝短线 */
/* 同时覆盖主线页（slides > section）和细节页（slides > section > section） */
.reveal section[class*="l-"] > h2 { grid-column: 1 / span 11; }
.reveal section[class*="l-"] > h2::after {
  content: ""; display: block; width: 64px; height: 6px;
  margin-top: var(--s4); background: var(--c-primary);
}
.reveal section[class*="l-"] > h2 + * { margin-top: var(--s6); }

/* ---------- 4. 十二种版式 ---------- */

/* 1 封面 / 结尾 */
.reveal section.l-cover { align-content: center; padding-top: 0; padding-bottom: 0; }
.reveal section.l-cover::before {           /* 装饰：右侧主题蓝色块 + 浅蓝细条 */
  content: ""; position: absolute; top: 0; right: 0; width: 384px; height: 100%;
  background: linear-gradient(90deg, var(--c-primary-soft) 0 16px, var(--c-primary-tint) 16px);
}
.reveal section.l-cover h1 { grid-column: 1 / span 9; font-size: var(--fs-cover); line-height: 1.15; }
.reveal section.l-cover h1::after {
  content: ""; display: block; width: 96px; height: 8px; margin-top: var(--s5); background: var(--c-primary);
}
.reveal section.l-cover p { grid-column: 1 / span 9; margin-top: var(--s5); font-size: var(--fs-h3); color: var(--c-text-2); }

/* 2 章节页：超大浅灰章节号贴右边缘 */
.reveal section.l-section { align-content: center; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.reveal section.l-section::before {
  content: attr(data-num); position: absolute; right: -40px; bottom: -150px;
  font: 700 720px/1 var(--f-sans); color: var(--c-surface); letter-spacing: -0.04em;
}
.reveal section.l-section .num {
  position: relative; font: 700 var(--fs-h3)/1 var(--f-num); font-variant-numeric: tabular-nums; color: var(--c-primary);
}
.reveal section.l-section h2 { position: relative; grid-column: 1 / span 8; margin-top: var(--s4); font-size: 96px; }
.reveal section.l-section h2::after { display: none; }
/* 章节页必须带一张图片或一段视频：贴右半屏，取代右下角的大章节号 */
.reveal section.l-section > .media {
  position: absolute; top: 0; right: 0; width: 960px; height: 1080px; object-fit: cover;
}
.reveal section.l-section:has(> .media)::before { display: none; }
.reveal section.l-section:has(> .media) h2 { grid-column: 1 / span 5; }
.reveal section.l-section > .credit {
  position: absolute; left: 0; bottom: 80px; width: 720px;
  font-size: 32px; line-height: 1.4; color: var(--c-text-2);
}

/* 3 标题 + 要点：正文最宽 8 栏 */
.reveal section.l-content > :not(h2) { grid-column: 1 / span 8; }

/* 4 双栏对比 */
.reveal section.l-two-col > .col { grid-column: 1 / span 6; grid-row: 2; }
.reveal section.l-two-col > .col ~ .col { grid-column: 7 / span 6; padding-left: var(--s5); border-left: 2px solid var(--c-line); }
.reveal section.l-two-col > .col h3 { margin-bottom: var(--s4); }
.reveal section.l-two-col > .col { margin-top: var(--s6); }
.reveal section.l-two-col > .note { grid-row: 3; margin-top: var(--s6); }

/* 5 半屏贴边图文：图片占画布一半，默认在右 */
.reveal section.l-split-image > .media {
  position: absolute; top: 0; right: 0; width: 960px; height: 1080px; object-fit: cover;
}
.reveal section.l-split-image > :not(.media) { grid-column: 1 / span 5; }
.reveal section.l-split-image.media-left > .media { right: auto; left: 0; }
.reveal section.l-split-image.media-left > :not(.media) { grid-column: 8 / span 5; }

/* 6 全屏图：文字在左下角，垫渐变遮罩 */
.reveal section.l-full-image { align-content: end; padding-bottom: 120px; }
.reveal section.l-full-image::before {
  content: ""; position: absolute; inset: 0;
  /* 底部压暗到文字区上方：浅色画面（地面、墙）上白字也要够对比 */
  background:
    linear-gradient(0deg, rgba(9, 22, 40, .92) 0%, rgba(9, 22, 40, .82) 30%, rgba(9, 22, 40, .55) 45%, rgba(9, 22, 40, 0) 65%),
    linear-gradient(90deg, rgba(9, 22, 40, .35) 0%, rgba(9, 22, 40, 0) 70%);
}
.reveal section.l-full-image > * { position: relative; grid-column: 1 / span 10; color: #FFFFFF; text-shadow: 0 2px 16px rgba(9, 22, 40, .6); }
.reveal section.l-full-image h2 { color: #FFFFFF; }
.reveal section.l-full-image h2::after { background: var(--c-highlight); }
.reveal section.l-full-image p { margin-top: var(--s4); font-size: var(--fs-body); color: rgba(255, 255, 255, .92); }

/* 视频点一下全屏播放：用 reveal.js 自带灯箱（data-preview-video） */
.reveal [data-preview-video] { cursor: zoom-in; }

/* 7 内嵌图 / 截图 */
.reveal section.l-figure figure { margin: 0; grid-column: 2 / span 10; }
.reveal section.l-figure figure img {
  display: block; width: 100%; max-height: 640px; object-fit: contain; object-position: left top;
  border: 1px solid var(--c-line); border-radius: 8px;
}
.reveal section.l-figure figure.chart img { border: 0; border-radius: 0; }
/* 图表也可以直接写内联 SVG（能用上主题字体），按画布 1:1 设计，宽度跟随 figure */
.reveal section.l-figure figure.chart svg { display: block; width: 100%; height: auto; max-height: 600px; overflow: visible; }
/* 两张图并排（如同一场地的两种视角），图注跨两栏 */
.reveal section.l-figure figure.pair { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); align-items: start; }
.reveal section.l-figure figure.pair figcaption { grid-column: 1 / -1; }
.reveal figcaption { margin-top: var(--s3); font-size: var(--fs-caption); color: var(--c-text-2); }

/* 8 代码页 / 9 说明 + 代码 / 10 说明 + 互动 */
.reveal section.l-code > .vscode { grid-column: 1 / -1; }
.reveal section.l-code-split > .text,
.reveal section.l-live > .text { grid-column: 1 / span 5; grid-row: 1; }
.reveal section.l-code-split > .vscode,
.reveal section.l-live > .window { grid-column: 6 / span 7; grid-row: 1; align-self: start; }
.reveal .text > h2 { font-size: 56px; }
.reveal .text > h2::after { content: ""; display: block; width: 64px; height: 6px; margin: var(--s4) 0 var(--s5); background: var(--c-primary); }

/* 11 卡片 / 步骤 */
.reveal .cards { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: var(--gutter); }
.reveal .card {
  border: 1px solid var(--c-line); border-radius: 8px; padding: var(--s4);
  font-size: var(--fs-caption); line-height: 1.5; color: var(--c-text);
}
.reveal .card h3 { margin-bottom: var(--s3); color: var(--c-text); }
.reveal .card.is-key { border: 2px solid var(--c-primary); padding: calc(var(--s4) - 1px); }
.reveal .steps { counter-reset: step; }
.reveal .steps .card { counter-increment: step; }
.reveal .steps .card::before {
  content: counter(step, decimal-leading-zero); display: block; margin-bottom: var(--s3);
  font: 600 var(--fs-h3)/1 var(--f-num); font-variant-numeric: tabular-nums; color: var(--c-primary);
}

/* 12 金句 / 大数字 */
.reveal section.l-statement { align-content: center; padding-top: 0; padding-bottom: 0; }
.reveal section.l-statement .big { grid-column: 1 / -1; font: 700 200px/1.05 var(--f-sans); letter-spacing: -0.02em; color: var(--c-text); }
.reveal section.l-statement .big em { color: var(--c-primary); }
.reveal section.l-statement .quote { grid-column: 1 / span 10; font-size: 88px; font-weight: 700; line-height: 1.3; }
.reveal section.l-statement p:not(.big):not(.quote) { grid-column: 1 / span 8; margin-top: var(--s5); font-size: var(--fs-h3); color: var(--c-text-2); }

/* ---------- 5. 组件 ---------- */

/* 提示块（语义色） */
.reveal .note {
  padding: var(--s3) var(--s4); border: 1px solid var(--c-info-line); border-radius: 8px;
  background: var(--c-info-bg); color: var(--c-info-text); font-size: var(--fs-caption);
}
.reveal .note.success { border-color: var(--c-success-line); background: var(--c-success-bg); color: var(--c-success-text); }
.reveal .note.warn    { border-color: var(--c-warn-line);    background: var(--c-warn-bg);    color: var(--c-warn-text); }
.reveal .note.error   { border-color: var(--c-error-line);   background: var(--c-error-bg);   color: var(--c-error-text); }
.reveal .text > .note { margin-top: var(--s5); }

/* 选中黄：每页最多一处 */
.reveal mark { background: var(--c-highlight); color: var(--c-text); padding: 0 6px; }

/* VS Code 代码面板 */
.reveal .vscode {
  position: relative; overflow: hidden; border-radius: 12px; background: var(--vs-bg);
  box-shadow: 0 0 0 1px var(--vs-border);
}
.reveal .vscode .tabs {
  display: flex; height: 64px; background: var(--vs-tabs-bg); border-bottom: 1px solid var(--vs-border);
  font: 400 var(--fs-chrome)/1 var(--f-sans);
}
.reveal .vscode .tab {
  display: flex; align-items: center; gap: 12px; padding: 0 var(--s4); color: var(--vs-tab-fg);
  border-right: 1px solid var(--vs-border);
}
.reveal .vscode .tab.active { background: var(--vs-bg); color: var(--vs-tab-active-fg); box-shadow: inset 0 2px 0 var(--vs-tab-accent); margin-bottom: -1px; }
.reveal .vscode .tab .lang { font: 700 18px/1 var(--f-mono); color: #3178C6; }
.reveal .vscode .tab .lang.py { color: #3572A5; } .reveal .vscode .tab .lang.sh { color: #89E051; }
.reveal .vscode pre {
  position: relative; margin: 0; padding: 0; width: auto; box-shadow: none; background: transparent;
  font: 400 var(--fs-code)/1.5 var(--f-mono); text-align: left;
}
.reveal .vscode pre code {
  display: block; padding: var(--s3) var(--s4) var(--s4); max-height: none; overflow: hidden;
  background: var(--vs-bg); color: var(--vs-fg); white-space: pre; tab-size: 2; font-size: inherit;
}
.reveal .vscode .hljs-ln { border-collapse: collapse; }
.reveal .vscode .hljs-ln td { padding: 0; border: 0; }
.reveal .vscode .hljs-ln-numbers {
  width: 1px; padding-right: var(--s4) !important; text-align: right; user-select: none;
  color: var(--vs-ln); vertical-align: top; opacity: 1;
}
.reveal .vscode .hljs-ln-n::before { content: attr(data-line-number); }
.reveal .vscode .hljs.has-highlights tr:not(.highlight-line) { opacity: .35; }
.reveal .vscode .hljs.has-highlights tr.highlight-line .hljs-ln-numbers { color: var(--vs-ln-active); }

/* 语法色：VS Code Dark+ */
.reveal .vscode .hljs { color: var(--vs-fg); background: transparent; }
.reveal .vscode .hljs-keyword, .reveal .vscode .hljs-literal,
.reveal .vscode .hljs-tag, .reveal .vscode .hljs-name, .reveal .vscode .hljs-selector-tag { color: var(--vs-keyword); }
.reveal .vscode .hljs-keyword.is-control { color: var(--vs-control); }
.reveal .vscode .hljs-string, .reveal .vscode .hljs-template-tag { color: var(--vs-string); }
.reveal .vscode .hljs-title.function_, .reveal .vscode .hljs-title.function, .reveal .vscode .hljs-function .hljs-title { color: var(--vs-function); }
.reveal .vscode .hljs-title.class_, .reveal .vscode .hljs-type, .reveal .vscode .hljs-built_in, .reveal .vscode .hljs-title { color: var(--vs-type); }
.reveal .vscode .hljs-title.function_ { color: var(--vs-function); }
.reveal .vscode .hljs-variable, .reveal .vscode .hljs-params, .reveal .vscode .hljs-attr,
.reveal .vscode .hljs-property, .reveal .vscode .hljs-attribute, .reveal .vscode .hljs-template-variable { color: var(--vs-variable); }
.reveal .vscode .hljs-variable.constant_, .reveal .vscode .hljs-symbol { color: var(--vs-constant); }
.reveal .vscode .hljs-number { color: var(--vs-number); }
.reveal .vscode .hljs-comment, .reveal .vscode .hljs-quote { color: var(--vs-comment); }
.reveal .vscode .hljs-regexp, .reveal .vscode .hljs-meta { color: var(--vs-regexp); }
.reveal .vscode .hljs-operator { color: var(--vs-operator); }
.reveal .vscode .hljs-subst { color: var(--vs-fg); }

/* 终端：同一种面板，标签栏显示 shell 名 */
.reveal .vscode.terminal pre code .prompt { color: var(--vs-constant); }
.reveal .vscode.terminal pre code .cmd { color: var(--vs-fg); }
.reveal .vscode.terminal pre code .out { color: #9D9D9D; }
.reveal .vscode.terminal pre code .ok { color: #89D185; }

/* 互动区：浏览器窗口框 */
.reveal .window { border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; background: #FFFFFF; }
.reveal .window .bar {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 var(--s3);
  background: var(--c-surface); border-bottom: 1px solid var(--c-line);
}
.reveal .window .bar i { width: 14px; height: 14px; border-radius: 50%; background: var(--c-line); }
.reveal .window .bar span {
  margin-left: var(--s2); padding: 6px 16px; border-radius: 6px; background: #FFFFFF;
  font: 400 20px/1 var(--f-mono); color: var(--c-text-2);
}
.reveal .window iframe, .reveal .window .fallback { display: block; width: 100%; height: 720px; border: 0; }
.reveal .window .fallback { display: none; object-fit: cover; }
html.print-pdf .reveal .window iframe, .reveal-print .reveal .window iframe { display: none; }
html.print-pdf .reveal .window .fallback, .reveal-print .reveal .window .fallback { display: block; }

/* ---------- 6. 状态栏与进度线 ---------- */
/* statusbar.js 会在每页右上角插入页码；以下版式不显示 */
.reveal section > .statusbar {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: var(--band-top);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 0 var(--margin-x); pointer-events: none;
  font: 400 var(--fs-chrome)/1 var(--f-num); font-variant-numeric: tabular-nums; color: var(--c-text-2);
}
.reveal section > .statusbar .tag {
  margin-right: var(--s2); padding: 6px 12px; border-radius: 6px;
  background: var(--c-primary-tint); color: var(--c-primary-strong);
}
.reveal section.l-split-image > .statusbar { right: 960px; }
.reveal section.l-split-image.media-left > .statusbar { left: 960px; right: 0; }
.reveal section.l-cover > .statusbar, .reveal section.l-section > .statusbar,
.reveal section.l-full-image > .statusbar, .reveal section.l-statement > .statusbar { display: none; }
.reveal .progress { height: 2px; background: transparent; color: var(--c-primary-soft); z-index: 31; }
.reveal .progress span { background: var(--c-primary); }
.reveal.chrome-off .progress { display: none; }
