/* 影像工作台。点阵和节点均由 CSS 绘制，图片只用于最终输出帧。 */
.intro {
  min-height: 100vh;
  min-height: 100dvh;
  background: #101011;
  --panel-line: #39393c;
  --secondary: #a7a5a1;
}
.desk-header {
  position: fixed; z-index: 5; inset: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  height: 72px; padding-inline: var(--gutter);
  background: #111112; border-bottom: 1px solid #2c2c2e;
}
.desk-brand, .skip, .tool, .node-heading, .node-heading h1,
.prompt-label, .controls, .meter, .generate { display: flex; align-items: center; }
.desk-brand { gap: 12px; }
.desk-brand b { font-family: var(--f-cn); font-size: clamp(20px, 1.55vw, 24px); font-weight: 650; line-height: 1.2; letter-spacing: .06em; white-space: nowrap; }
.desk-brand span { padding-left: 14px; border-left: 1px solid #454548; font-size: 14px; color: #c0beb9; }
.pilot { width: 7px; height: 7px; border-radius: 50%; background: var(--rec); }
.skip { gap: 12px; padding: 7px 14px; border: 1px solid #454547; border-radius: 3px; font-size: 14px; }
.skip:hover, .skip:focus-visible { border-color: var(--paper); }
@media (max-width: 360px) {
  .desk-brand { gap: 8px; }
  .desk-brand span { padding-left: 8px; }
  .skip { gap: 6px; padding-inline: 9px; }
}
.canvas {
  min-height: 100vh; min-height: 100dvh; position: relative;
  display: grid; place-items: center; padding: 90px 24px 30px;
  background-image: radial-gradient(ellipse at center, transparent 24%, #101011c7 95%),
                    radial-gradient(circle, #454548 0.8px, transparent 1px);
  background-size: 100% 100%, 20px 20px;
}
.tools {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 7px; transition: opacity .18s, transform .22s;
}
.tool {
  gap: 12px; white-space: nowrap; padding: 12px 20px; border: 1px solid #444448;
  background: #1b1b1d; border-radius: 4px; font-size: 15px; font-weight: 550;
}
.image-icon, .film-icon { display: inline-block; position: relative; width: 17px; height: 14px; border: 1px solid currentColor; border-radius: 2px; overflow: hidden; }
.image-icon::before { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: currentColor; top: 2px; right: 3px; }
.image-icon::after { content: ''; position: absolute; width: 12px; height: 12px; left: 0; top: 8px; border: 1px solid currentColor; transform: rotate(45deg); }
.film-icon::after { content: ''; position: absolute; inset: 2px; border-block: 2px dotted currentColor; }
.intro.selecting .selected-tool { border-color: var(--rec); background: #30221f; transform: scale(.97); }
.intro.editing .tools { opacity: 0; transform: translate(-50%,-54%); }
.node { width: min(670px, 100%); opacity: 0; transform: translateY(9px); transition: opacity .28s, transform .32s var(--ease); }
.editing .node { opacity: 1; transform: none; }
.node-heading { justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.node-heading h1 { gap: 9px; font-size: 17px; font-weight: 600; }
.node-heading .mono { color: var(--secondary); }
.monitor {
  position: relative; isolation: isolate; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid #444448; border-radius: 4px;
  background: radial-gradient(ellipse at center, #242426, #18181a 75%);
}
.reticle { position: absolute; inset: 21% 27%; color: #59595b; }
.reticle i { position: absolute; width: 12px; height: 12px; border: 0 solid currentColor; }
.reticle i:nth-child(1) { left: 0; top: 0; border-width: 1px 0 0 1px; }
.reticle i:nth-child(2) { right: 0; top: 0; border-width: 1px 1px 0 0; }
.reticle i:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.reticle i:nth-child(4) { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.reticle b { position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; transform: translate(-50%,-50%); border: 1px solid currentColor; border-radius: 50%; }
.reticle b::before, .reticle b::after { content: ''; position: absolute; background: currentColor; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.reticle b::before { width: 36px; height: 1px; }
.reticle b::after { height: 36px; width: 1px; }
.first-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.prompt-card { margin-top: 18px; border: 1px solid var(--panel-line); padding: 17px 22px 14px; background: #202022; border-radius: 4px; box-shadow: 0 10px 30px #0003; }
.prompt-label { gap: 10px; font-size: 13px; color: var(--secondary); }
.prompt-label .mono { color: #d1cfc8; }
.typed-line { min-height: 3.2em; font-size: clamp(18px, 1.45vw, 20px); line-height: 1.6; margin: 10px 0 14px; font-weight: 500; }
.typed-line i { display: inline-block; width: 2px; height: .92em; margin-left: 2px; background: var(--rec); vertical-align: -.06em; }
.controls { justify-content: space-between; gap: 16px; }
.meter { margin-left: auto; gap: 9px; color: var(--secondary); }
.progress-track { width: 66px; height: 2px; background: #414143; }
.progress-track i { display: block; height: 100%; background: var(--rec); transform-origin: left; transform: scaleX(var(--progress, 0)); }
.generate { gap: 8px; padding: 4px 17px; border-radius: 3px; background: #38383a; color: #b3b2ae; font-size: 14px; transition: background .18s, transform .12s; }
.generate b { font-size: 17px; }
.ready .generate { background: var(--rec); color: #160c09; }
.pressed .generate { transform: scale(.94); }
/* 噪点先盖住画框，随后淡出，显露视频首帧。 */
.monitor::after {
  content: ''; position: absolute; inset: -10px; pointer-events: none; opacity: 0;
  background: #444 url('../assets/img/intro-grain.png') repeat;
}
.pressed .monitor::after { animation: grain-resolve .64s linear both; }
.pressed .first-frame { animation: develop-frame .62s ease-out both; }
@keyframes grain-resolve {
  0% { opacity: .92; } 20% { opacity: .72; transform: translate(-4px,3px); }
  46% { opacity: .36; transform: translate(3px,-2px); } 100% { opacity: 0; }
}
@keyframes develop-frame {
  0% { opacity: .08; filter: blur(9px) grayscale(.8); }
  72%, 100% { opacity: 1; filter: none; }
}
.generate:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.generate:active { transform: scale(.94); }
.pressed .typed-line i { visibility: hidden; }
.transition-still { position: fixed; z-index: 6; pointer-events: none; opacity: 0; inset: 0; background: #111 url('../assets/img/hero-first.jpg') center / cover; }
/* 扩展到全屏时接上主页已有的遮罩，避免转场最后一帧突然变暗。 */
.transition-still::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  transition: opacity .62s ease-in;
  background: linear-gradient(180deg,rgba(10,10,11,.55),rgba(10,10,11,.15) 30%,rgba(10,10,11,.35) 55%,var(--ink)),
              linear-gradient(90deg,rgba(10,10,11,.75),rgba(10,10,11,.2) 60%,transparent);
}
.expanding .transition-still::after { opacity: 1; }
@media (max-width: 640px) {
  .desk-header { height: 57px; }
  .canvas { padding: 76px 18px 25px; }
  .prompt-card { padding: 14px 15px; }
  .typed-line { min-height: 6.4em; }
  .tool { padding: 10px 15px; }
}
@media (max-height: 760px) and (min-width: 641px) {
  .node { width: min(670px, 100%, max(400px, calc((100dvh - 305px) * 1.77))); }
  .desk-header { height: 50px; }
  .canvas { padding-block: 62px 10px; }
}
