:root {
  color-scheme: light;
  --paper: #f7faff;
  --surface: #ffffff;
  --navy: #173654;
  --ink: #24415e;
  --blue: #1e63e9;
  --blue-soft: #eaf2ff;
  --muted: #647c95;
  --line: #d6e2ee;
  --shadow: 0 16px 50px rgba(28, 67, 105, .12);
  --doc-scale: 1;
  font-family: "Hiragino Sans GB", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overflow: hidden; background: var(--paper); color: var(--navy); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
a { color: var(--blue); }
.app-shell { height: 100dvh; display: flex; flex-direction: column; }
.app-header { flex: 0 0 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 0 25px; background: rgba(247,250,255,.96); border-bottom: 1px solid var(--line); z-index: 10; }
.identity { display: flex; align-items: center; gap: 12px; white-space: nowrap; min-width: 0; }
.identity-mark { width: 5px; height: 26px; background: var(--blue); display: block; flex: 0 0 auto; }
.identity-title { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.view-nav { display: flex; align-items: center; gap: 3px; }
.view-tab, .quiet-button, .icon-button, .context-button, .docs-reading-actions button, .docs-reading-actions a { border: 0; background: transparent; color: var(--ink); }
.view-tab { position: relative; padding: 17px 18px 16px; font-size: 15px; white-space: nowrap; }
.view-tab::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: transparent; }
.view-tab:hover { color: var(--blue); }
.view-tab.is-active { color: var(--blue); font-weight: 700; }
.view-tab.is-active::after { background: var(--blue); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.quiet-button { padding: 8px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.quiet-button:hover, .icon-button:hover { background: var(--blue-soft); color: var(--blue); }
#app-main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none !important; }

/* The deck remains visually identical to the confirmed PowerPoint. */
.slide-view { background: #e8f0fb; display: grid; place-items: center; padding: 18px 24px 58px; }
.slide-canvas { width: min(100%, calc((100dvh - 136px) * 16 / 9)); aspect-ratio: 16 / 9; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.slide-canvas img { width: 100%; height: 100%; display: block; object-fit: contain; }
.slide-edge { position: absolute; top: 0; bottom: 58px; width: 8%; border: 0; background: transparent; opacity: 0; }
.slide-edge:hover { opacity: 1; }
.slide-edge-prev { left: 0; cursor: w-resize; }
.slide-edge-next { right: 0; cursor: e-resize; }
.slide-footer { position: absolute; left: 0; right: 0; bottom: 0; height: 58px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(247,250,255,.97); border-top: 1px solid var(--line); }
.slide-meta { min-width: 0; display: flex; align-items: center; gap: 13px; font-size: 14px; color: var(--muted); white-space: nowrap; }
#slide-count { color: var(--blue); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.meta-divider { width: 1px; height: 16px; background: var(--line); }
#slide-title { overflow: hidden; text-overflow: ellipsis; }
.slide-controls { display: flex; gap: 5px; align-items: center; }
.context-button { margin-right: 8px; color: var(--blue); padding: 9px 12px; font-size: 13px; font-weight: 650; }
.context-button:hover { text-decoration: underline; }
.icon-button { height: 36px; min-width: 38px; border-radius: 6px; font-size: 22px; line-height: 1; }
.progress-track { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: transparent; }
.progress-track span { display: block; height: 100%; width: 6.25%; background: var(--blue); transition: width .2s ease; }

/* The original webpage is a local, unmodified copy. */
.original-view { background: #e8f0fb; }
.original-view iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.original-actions { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.original-actions button, .original-actions a { pointer-events: auto; display: inline-flex; align-items: center; min-height: 36px; border: 1px solid rgba(30,99,233,.25); border-radius: 7px; padding: 6px 12px; color: var(--navy); background: rgba(255,255,255,.93); box-shadow: 0 4px 18px rgba(22,53,84,.14); font-size: 13px; font-weight: 650; text-decoration: none; }
.original-actions button:hover, .original-actions a:hover { color: var(--blue); border-color: var(--blue); }

/* Document view gives long source Markdown a readable, navigable surface. */
.docs-view { display: grid; grid-template-columns: 242px minmax(0,1fr) 235px; background: #fff; }
.docs-list { border-right: 1px solid var(--line); background: var(--paper); padding: 32px 18px; overflow-y: auto; }
.aside-label { display: block; margin: 0 0 19px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.document-choice { display: block; width: 100%; border: 0; background: transparent; padding: 13px 12px; margin: 2px 0; text-align: left; color: var(--ink); border-left: 3px solid transparent; border-radius: 0 5px 5px 0; font-size: 14px; line-height: 1.45; }
.document-choice:hover { background: #edf4ff; }
.document-choice.is-active { background: #e8f1ff; border-left-color: var(--blue); color: var(--navy); font-weight: 750; }
.document-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.back-to-slides { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 9px 12px; color: var(--ink); margin-top: 30px; font-size: 13px; }
.back-to-slides:hover { color: var(--blue); border-color: var(--blue); }
.docs-reading { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 38px clamp(32px, 5vw, 90px) 110px; scroll-behavior: smooth; }
.docs-reading-top { max-width: 920px; margin: 0 auto 25px; display: flex; justify-content: space-between; align-items: end; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 23px; }
.document-kicker { color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .1em; margin: 0 0 9px; }
.docs-reading-top h1 { margin: 0; font-size: clamp(26px, 2.1vw, 34px); line-height: 1.32; letter-spacing: -.02em; }
.docs-reading-actions { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.docs-reading-actions button, .docs-reading-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 8px; border-radius: 5px; font-size: 12px; text-decoration: none; }
.docs-reading-actions button:hover, .docs-reading-actions a:hover { background: var(--blue-soft); }
#document-status { max-width: 920px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.toc-panel { border-left: 1px solid var(--line); background: #fbfdff; padding: 35px 17px 50px; overflow-y: auto; }
.toc-panel label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; display: block; margin-bottom: 11px; }
.toc-panel input { width: 100%; border: 1px solid var(--line); background: white; border-radius: 6px; padding: 9px 10px; color: var(--ink); font-size: 13px; margin-bottom: 17px; }
.toc-link { display: block; width: 100%; border: 0; background: transparent; color: var(--muted); text-align: left; padding: 8px 9px; border-left: 2px solid transparent; line-height: 1.45; font-size: 12px; }
.toc-link:hover, .toc-link.is-active { color: var(--blue); border-left-color: var(--blue); background: #eef5ff; }
.toc-link.level-3 { padding-left: 19px; }
.toc-link[hidden] { display: none; }

.markdown-body { max-width: 920px; margin: 0 auto; color: var(--ink); font-size: calc(16px * var(--doc-scale)); line-height: 1.85; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--navy); line-height: 1.36; scroll-margin-top: 26px; letter-spacing: -.012em; }
.markdown-body h1 { font-size: 1.85em; margin: 1.7em 0 .7em; }
.markdown-body h2 { font-size: 1.48em; margin: 2.2em 0 .8em; padding-bottom: .32em; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 1.18em; margin: 1.8em 0 .55em; }
.markdown-body h4 { font-size: 1.04em; margin: 1.45em 0 .5em; }
.markdown-body p { margin: .65em 0 1.05em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.7em; margin: .6em 0 1.1em; }
.markdown-body li { padding-left: .15em; margin: .22em 0; }
.markdown-body li > p { margin: .1em 0 .4em; }
.markdown-body blockquote { margin: 1.35em 0; border-left: 4px solid #70a0f4; background: #f3f7ff; padding: .35em 1.2em; color: #365675; }
.markdown-body blockquote > :last-child { margin-bottom: .5em; }
.markdown-body a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.markdown-body strong { color: #153759; font-weight: 750; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.markdown-body code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; background: #eef3fa; padding: .14em .35em; border-radius: 4px; }
.markdown-body pre { overflow: auto; margin: 1.35em 0; padding: 18px 20px; border: 1px solid #dce7f3; border-radius: 7px; background: #f5f8fc; line-height: 1.6; font-size: .9em; }
.markdown-body pre code { background: transparent; padding: 0; border-radius: 0; font-size: 1em; white-space: pre; }
.markdown-body .table-scroll { overflow-x: auto; margin: 1.2em 0 1.7em; border: 1px solid var(--line); border-radius: 6px; }
.markdown-body table { border-collapse: collapse; width: 100%; min-width: 550px; font-size: .92em; line-height: 1.6; }
.markdown-body th, .markdown-body td { padding: 10px 13px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.markdown-body tr > :last-child { border-right: 0; }
.markdown-body tbody tr:last-child td { border-bottom: 0; }
.markdown-body th { background: #eef5ff; color: var(--navy); text-align: left; font-weight: 700; }
.markdown-body tbody tr:nth-child(even) { background: #fbfdff; }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: 1.25em auto; }
.markdown-body input[type="checkbox"] { accent-color: var(--blue); }

.laser { position: fixed; z-index: 60; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); background: #f02e2e; box-shadow: 0 0 0 4px rgba(240,46,46,.16), 0 0 24px rgba(240,46,46,.65); pointer-events: none; opacity: 0; transition: opacity .12s; }
body.laser-on .laser { opacity: 1; }
.spotlight { position: fixed; z-index: 59; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle 180px at var(--pointer-x, 50%) var(--pointer-y, 50%), transparent 0 155px, rgba(6,22,41,.83) 230px); transition: opacity .15s; }
body.spotlight-on .spotlight { opacity: 1; }
.drawing-layer { position: fixed; inset: 0; z-index: 61; width: 100vw; height: 100dvh; pointer-events: none; touch-action: none; }
body.drawing-on .drawing-layer { pointer-events: auto; cursor: crosshair; }
.tool-hint { position: fixed; z-index: 70; left: 50%; bottom: 75px; transform: translateX(-50%); background: rgba(23,54,84,.94); color: white; padding: 8px 14px; border-radius: 6px; font-size: 13px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.tool-hint.is-visible { opacity: 1; }

.overview-dialog { position: fixed; inset: 5vh 6vw; width: 88vw; max-width: 1450px; max-height: 90vh; margin: auto; border: 1px solid var(--line); border-radius: 10px; padding: 24px; color: var(--navy); background: var(--paper); box-shadow: 0 30px 90px rgba(10,37,65,.28); }
.overview-dialog::backdrop { background: rgba(9,28,49,.64); }
.overview-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.overview-head h2 { margin: 0; font-size: 26px; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; max-height: calc(90vh - 110px); overflow-y: auto; }
.overview-item { display: block; border: 2px solid transparent; background: #fff; text-align: left; padding: 0 0 9px; border-radius: 6px; overflow: hidden; color: var(--navy); }
.overview-item:hover, .overview-item.is-current { border-color: var(--blue); }
.overview-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.overview-item span { display: block; padding: 8px 10px 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.chrome-hidden .app-header, body.chrome-hidden .slide-footer { display: none; }
body.chrome-hidden .slide-view { padding: 0; }
body.chrome-hidden .slide-canvas { width: min(100vw, 177.77778dvh); box-shadow: none; }
body.chrome-hidden .slide-edge { bottom: 0; }
body.chrome-hidden .original-actions { opacity: 0; transition: opacity .2s; }
body.chrome-hidden .original-view:hover .original-actions { opacity: 1; }
body.chrome-hidden .docs-view { top: 0; }

@media (max-width: 1150px) {
  .docs-view { grid-template-columns: 205px minmax(0,1fr); }
  .toc-panel { display: none; }
  .identity-title { max-width: 210px; }
}
@media (max-width: 740px) {
  .app-header { padding: 0 10px; grid-template-columns: auto 1fr; gap: 5px; }
  .identity-title, .header-actions { display: none; }
  .view-nav { justify-content: center; }
  .view-tab { padding-left: 10px; padding-right: 10px; font-size: 13px; }
  .slide-view { padding: 12px 4px 58px; }
  .slide-footer { padding: 0 12px; }
  #slide-title, .meta-divider { display: none; }
  .docs-view { display: block; overflow-y: auto; }
  .docs-list { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .docs-list .aside-label, .back-to-slides { display: none; }
  #document-list { display: flex; }
  .document-choice { width: max-content; min-width: 105px; white-space: nowrap; padding: 7px 10px; font-size: 12px; }
  .document-choice small { display: none; }
  .docs-reading { height: calc(100% - 52px); padding: 20px 16px 80px; }
  .docs-reading-top { display: block; }
  .docs-reading-actions { margin-top: 12px; }
  .overview-dialog { width: 96vw; inset: 2vh 2vw; padding: 12px; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
