/* Page, fixed 1440×900 stage, office window chrome (shared by WPS and Microsoft Office) and transport.
   No CSS animations or transitions anywhere: every moving value is written by render(t). */
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:#f3f4f6;color:#262626;font-family:-apple-system,'PingFang SC','Microsoft YaHei','Helvetica Neue',sans-serif;overflow-x:hidden}
.page{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px}
body.embed .page{padding:0;gap:0;background:transparent}
body.embed{background:transparent}
body.embed .transport{display:none}
body.embed .stage-fit{box-shadow:none}

.stage-fit{position:relative;flex:none;overflow:hidden;border-radius:14px;box-shadow:0 1px 2px #0000000f,0 12px 40px #0000001a}
.stage{position:absolute;left:0;top:0;width:1440px;height:900px;transform-origin:0 0;background:#fff;overflow:hidden;display:flex;flex-direction:column}

/* Title bar with traffic lights */
.win-top{height:44px;flex:none;display:flex;align-items:flex-end;gap:14px;padding:0 16px;background:#eceef1;font-size:12px;color:#5b6168}
.traffic{display:flex;gap:7px;align-self:center}
.traffic i{width:11px;height:11px;border-radius:50%;background:#ff5f57}
.traffic i:nth-child(2){background:#febc2e}.traffic i:nth-child(3){background:#28c840}
.ribbon{height:40px;flex:none;display:flex;align-items:center;gap:30px;padding:0 20px;font-size:12px;color:#5b6168;border-bottom:1px solid #e8eaed;background:#fff}
.rb-div{width:1px;height:14px;background:#dcdfe3}
.rb-kimi{color:#1783ff;font-weight:500}

/* Workspace: the camera zooms .cam inside this fixed clip. */
.workspace{position:relative;height:816px;flex:none;overflow:hidden;background:#f7f8fa}
.cam{position:absolute;inset:0;transform-origin:0 0}
.doc{position:absolute;left:16px;top:12px;width:944px;height:792px;display:flex;flex-direction:column;background:#fff;border:1px solid #e6e8eb;border-radius:10px;overflow:hidden}
.sidebar{position:absolute;left:972px;top:12px;width:452px;height:792px}

.format-bar{height:40px;flex:none;display:flex;align-items:center;gap:18px;padding:0 18px;font-size:12px;color:#5b6168;border-bottom:1px solid #eceef1;background:#fafbfc}
.format-bar i{width:1px;height:14px;background:#dcdfe3}
.format-bar .fb-font{min-width:64px;padding:3px 8px;border:1px solid #e3e5e8;border-radius:4px;background:#fff}
.format-bar .fb-end{margin-left:auto;font-size:10px;color:#9aa0a6}
.panes{position:relative;flex:1;min-height:0}
.pane{position:absolute;inset:0;overflow:hidden}
.doc-status{height:26px;flex:none;display:flex;justify-content:space-between;align-items:center;padding:0 14px;font-size:10px;color:#80868b;border-top:1px solid #eceef1;background:#fafbfc}

/* Transport (outside the stage, not scaled) */
.transport{display:flex;align-items:center;gap:10px;width:min(100%,960px);padding:8px 12px;border-radius:12px;background:#fff;box-shadow:0 1px 3px #0000001a;font-size:12px;color:#444}
.transport button{flex:none;min-width:34px;height:30px;padding:0 10px;border:1px solid #e3e5e8;border-radius:8px;background:#fff;color:#333;font:inherit;cursor:pointer}
.transport button.on{background:#eef5ff;border-color:#b9d6ff;color:#1766c7}
.scrub{position:relative;flex:1;min-width:60px}
.scrub input{width:100%;margin:0;accent-color:#1783ff}
.marks{position:absolute;left:0;right:0;top:-14px;height:12px;font-size:10px;color:#8a9097;pointer-events:none}
.marks span{position:absolute;transform:translateX(-2px);white-space:nowrap;pointer-events:auto;cursor:pointer}
#timecode{flex:none;font-variant-numeric:tabular-nums;min-width:82px;text-align:right}
#chapter-label{flex:none;min-width:84px;color:#262626;font-weight:500}
@media(max-width:700px){.transport{flex-wrap:wrap;gap:6px}.scrub{order:-1;flex-basis:100%;margin-top:12px}.transport button{padding:0 8px}}
/* User pointer (pointer.js) and chapter covers (cover.js). */
.pointer{position:absolute;left:0;top:0;z-index:30;width:20px;height:24px;pointer-events:none;transform-origin:2px 1.5px;filter:drop-shadow(0 1px 1.5px #00000040)}
.pointer svg{display:block;width:20px;height:24px}
/* Cover ground, the same for the opening overview and every chapter card. From Figma QSlqzTnh5hiC4mWnLEYdgM
   node 12938-590211: a flat pastel with the `ascii-2x` halftone laid over it at SOFT_LIGHT. cover-grain.webp (lossless) IS that
   asset, cropped to the stage's 16:10, halved, then MIRROR-tiled 2x2 back up to 1440x900 so it sits 1:1 on the
   canvas (at the asset's own scale the glyphs read as ASCII art rather than grain). The opening is Kimi's own blue,
   not the Excel chapter's green; it is slightly warmer/deeper than the Word ground so the two never read alike. */
.cover{position:absolute;inset:0;z-index:40;pointer-events:none}
.cover[data-kind=intro]{--cv-ground:#d7e4ff}
.cover[data-kind=excel]{--cv-ground:#d4f4cf}
.cover[data-kind=word]{--cv-ground:#d3eeff}
.cover[data-kind=ppt]{--cv-ground:#ffe1cc}
/* The opening's ground and grain, a layer of its own (isolated, so the grain stays soft light on the ground while
   the layer fades): in front for the overview, fading out into chapter 1's card. Cards have no ground here (lift.js). */
.cv-intro{position:absolute;inset:0;background:var(--cv-ground);isolation:isolate}
.cv-intro:after{content:'';position:absolute;inset:0;background:url(../assets/cover-grain.webp) center/cover no-repeat;mix-blend-mode:soft-light}
.cv-group{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:92px}
.cv-icons{position:relative;width:132px;height:132px}
.cv-icon{position:absolute;left:0;top:0;width:132px;height:132px;opacity:0}
.cv-icon .tile{display:block;width:132px;height:132px}
.cv-icon .brand{display:block;width:176px;height:176px;margin:-22px;object-fit:contain}
/* Per-brand boxes so both marks read the same optical size (visible ~140x97 WPS, ~119x112 Office), centred on the 132px slot. */
.cv-icon[data-brand="wps"] .brand{width:184px;height:135px;margin:-1.5px -26px}
.cv-icon[data-brand="microsoft-office"] .brand{width:148px;height:148px;margin:-8px}
.cv-line{font:600 56px/78px -apple-system,'SF Pro Display','PingFang SC','Microsoft YaHei','Helvetica Neue',sans-serif;color:#1f2329;letter-spacing:1px;white-space:nowrap;opacity:0}
/* Chapter card, after 歸藏's CodePilot film: its opening lockup (mark + bold wordmark, a line of grey copy
   beneath) on the film's pastel ground. One sans family throughout, the page's own
   stack. */
.cv-card{position:absolute;inset:0;z-index:1;overflow:hidden;font-family:-apple-system,'SF Pro Display','PingFang SC','Microsoft YaHei','Helvetica Neue',sans-serif;color:#1f2329}
.cv-lock{position:absolute;left:84px;top:262px;display:flex;flex-direction:column;align-items:flex-start;gap:26px}
.cv-mark{width:96px;height:96px;flex:none;transform-origin:0 50%}
.cv-tile .tile{display:block;width:96px;height:96px}
.cv-word{position:relative;display:flex;height:112px;align-items:center;margin-left:-6px;opacity:0}
.cv-word span{font-weight:600;font-size:104px;line-height:1;letter-spacing:-2px;white-space:nowrap;padding-bottom:6px}
.cv-sub{position:absolute;left:84px;top:528px;text-align:left;font-size:32px;line-height:46px;font-weight:400;letter-spacing:2px;
  color:rgba(31,35,41,.62);opacity:0;--wipe:0%;
  -webkit-mask-image:linear-gradient(90deg,#000 calc(var(--wipe) - 15%),transparent var(--wipe));mask-image:linear-gradient(90deg,#000 calc(var(--wipe) - 15%),transparent var(--wipe))}
/* Chapter cards, window half (lift.js): the chapter's ground and grain under the WPS window, which is lifted
   off the stage while cover.js's lockup sits on the left. Same ground as the covers. */
.win{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;background:#fff;overflow:hidden;transform-origin:0 50%}
.lift{position:absolute;inset:0;background:var(--cv-ground);pointer-events:none}
.lift[data-kind=excel]{--cv-ground:#d4f4cf}
.lift[data-kind=word]{--cv-ground:#d3eeff}
.lift[data-kind=ppt]{--cv-ground:#ffe1cc}
.lift:after{content:'';position:absolute;inset:0;background:url(../assets/cover-grain.webp) center/cover no-repeat;mix-blend-mode:soft-light}

body:not([data-ready="1"]) .page{visibility:hidden}
/* Until the film's first frame is ready, the embedded document shows the opening's ground (the first frame's
   colour), so the page never shows an empty box while the film loads. */
body.embed:not([data-ready="1"]){background:#d7e4ff;border-radius:14px}
html[data-theme=dark] body.embed:not([data-ready="1"]){background:#17213a}
html:not(:lang(zh-CN)):not(:lang(zh-hans)):not(:lang(zh-hant)) .cv-word{max-width:380px;margin-left:0}
/* Non-Chinese names use Excel / Word / PowerPoint: one line, sized so PowerPoint clears the window at x=500. */
html:not(:lang(zh-CN)):not(:lang(zh-hans)):not(:lang(zh-hant)) .cv-word span{font-size:72px;line-height:1;letter-spacing:-1.5px;white-space:nowrap}
html:not(:lang(zh-CN)):not(:lang(zh-hans)):not(:lang(zh-hant)) .cv-sub{max-width:380px;letter-spacing:0;font-size:30px;line-height:1.4}

/* App windows: each file is its own window, as in Microsoft Office: the title bar shows that file, the ribbon is
   that app's, and the selected ribbon tab carries the app's colour. */
.win{--acc:#107c41}
.win[data-kind="word"]{--acc:#185abd}
.win[data-kind="ppt"]{--acc:#c43e1c}
.win-top{position:relative;height:40px;align-items:center;justify-content:center;background:#eceef1}
.win-top .traffic{position:absolute;left:16px;top:50%;transform:translateY(-50%)}
.win-qat{position:absolute;left:94px;top:50%;transform:translateY(-50%);display:flex;gap:14px;color:#5b6168}
.win-qat svg,.win-search svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linejoin:round;stroke-linecap:round}
.win-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:#2b2f33}
.win-title .tile{display:block;width:16px;height:16px}
.win-search{position:absolute;right:16px;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:6px;width:220px;height:24px;padding:0 10px;border-radius:6px;background:#e1e4e8;color:#80868b;font-size:12px}
.ribbon{height:44px;gap:0;padding:0 12px}
.ribbon>[data-copy="file"]{padding:0 12px}
.rb-tabs{display:flex;height:100%;align-items:stretch}
.rb-tabs span{position:relative;display:flex;align-items:center;padding:0 12px;color:#3c4043}
.rb-tabs span.on{color:var(--acc);font-weight:600}
.rb-tabs span.on::after{content:'';position:absolute;left:12px;right:12px;bottom:0;height:3px;border-radius:2px 2px 0 0;background:var(--acc)}
.ribbon .rb-kimi{margin-left:auto;padding:0 12px}


/* Stage Manager: the window in front fills the stage right of the folded app tabs (lift.js). Window and
   tabs are one piece on the page: the stage has no ground of its own. */
.stage{background:transparent}
.stage-fit{box-shadow:none}
body{background:#fff}
.win{inset:auto;left:0;top:0;width:1440px;height:var(--win-h,900px);transform-origin:0 0}
.workspace{height:var(--ws-h,816px)}
.doc,.sidebar{height:calc(var(--ws-h,816px) - 24px)}
.lift,.cover{border-radius:14px}
.strip{position:absolute;left:0;top:0;width:200px;height:900px;z-index:0;pointer-events:none}
.sm-app{--app:#107c41;position:absolute;padding:0;border:0;background:none;cursor:pointer;pointer-events:auto}
.sm-app[data-kind="word"]{--app:#185abd}
.sm-app[data-kind="ppt"]{--app:#c43e1c}
/* The tab: the app's window folded about its left edge (transform from lift.js), shaded towards the fold. */
.sm-card{position:absolute;left:0;top:0;width:100%;height:100%;transform-origin:0 0;border-radius:7px;
  box-shadow:0 0 0 1px var(--shot-ring,rgba(0,0,0,.1)),0 8px 22px rgba(0,0,0,.16)}
.sm-shot{position:absolute;inset:0;display:block;width:100%;height:100%;border-radius:inherit}
.sm-fold{position:absolute;inset:0;border-radius:inherit;background:linear-gradient(90deg,transparent 8%,rgba(0,0,0,.14) 30%)}
/* Icons above everything in the strip, including a window flying back into its tab (lift.js, .sm-clone z-index 1). */
.sm-icon{position:absolute;left:-8px;bottom:-10px;width:28px;height:28px;z-index:2}
.sm-icon .tile{display:block;width:28px;height:28px;filter:drop-shadow(0 2px 4px rgba(0,0,0,.2))}
/* Hover only says "clickable": nothing moves. */
.sm-app:hover .sm-card,.sm-app.wait .sm-card{box-shadow:0 0 0 2px var(--shot-hover,rgba(0,0,0,.35)),0 8px 22px rgba(0,0,0,.2)}
.sm-app:hover .sm-fold{background:linear-gradient(90deg,transparent 8%,rgba(0,0,0,.06) 30%)}
/* The app being played: ringed in its colour, with a light halo; --on (lift.js) fades it between tabs on a switch. */
.sm-ring{position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:var(--on,0);
  box-shadow:0 0 0 2.5px var(--app),0 0 0 7px color-mix(in srgb,var(--app) 20%,transparent)}
.sm-app:focus-visible{outline:none}
.sm-app:focus-visible .sm-card{box-shadow:0 0 0 2.5px var(--shot-hover,rgba(0,0,0,.35))}
.win,.sm-ghost{--win-ring:rgba(0,0,0,.06)}
.sm-clone{z-index:1;pointer-events:none;contain:strict;will-change:transform,opacity}
.sm-ghost{position:absolute;left:0;top:0;z-index:2;width:1440px;transform-origin:0 0;pointer-events:none;display:none;overflow:hidden}
.sm-ghost img{position:absolute;inset:0;width:100%;height:100%}
/* A user's switch: what the clicked tab showed, over the opening window (lift.js). */
.sm-overlay{position:absolute;left:0;top:0;width:100%;height:100%;z-index:50;pointer-events:none;transform:none}
