/* ============ 并行生成 + 吉祥物版 · 设计令牌 ============ */
:root {
  --ink: #eaf2ff;
  --sub: #8fa3c8;
  --dim: #6d81a8;
  --line: rgba(120, 170, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.06);
  --cyan: #38e0ff;
  --cyan-soft: #7fe3ff;
  --mint: #7ee8c8;
  --orange: #ff9a3d;
  --gold: #ffd166;
  --pink: #ff4fa3;
  --pink-soft: #ff9ac6;
  --green: #35e6a0;
  --green-soft: #7be8bf;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: #03060f;
  overflow-x: hidden;
}

/* ============ 持续动态背景 ============ */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-base { position: absolute; inset: 0; background: linear-gradient(160deg, #050a18 0%, #070f24 42%, #03060f 100%); }
.bg-orbs { position: absolute; inset: -10%; animation: nfHue 14s ease-in-out infinite; }
.orb { position: absolute; border-radius: 50%; }
.orb-a { top: -160px; left: -100px; width: 520px; height: 520px; background: radial-gradient(circle, rgba(56,224,255,.24), transparent 68%); filter: blur(20px); animation: nfOrbA 12s ease-in-out infinite; }
.orb-b { bottom: -180px; right: -60px; width: 560px; height: 560px; background: radial-gradient(circle, rgba(255,79,163,.16), transparent 70%); filter: blur(22px); animation: nfOrbB 15s ease-in-out infinite; }
.orb-c { top: 30%; right: 12%; width: 340px; height: 340px; background: radial-gradient(circle, rgba(96,140,255,.2), transparent 70%); filter: blur(18px); animation: nfOrbA 10s ease-in-out infinite reverse; }
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(120,170,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(120,170,255,.06) 1px, transparent 1px);
  background-size: 64px 64px; animation: nfGrid 6s linear infinite;
}
.bg-twinkles { position: absolute; inset: 0; }
.twinkle { position: absolute; width: 3px; height: 3px; border-radius: 50%; animation: nfTwinkle var(--dur, 3s) ease-in-out infinite; }

@keyframes nfOrbA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-36px) scale(1.08); } }
@keyframes nfOrbB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-34px,30px) scale(1.1); } }
@keyframes nfHue { 0%,100% { filter: hue-rotate(0deg) brightness(1); } 50% { filter: hue-rotate(22deg) brightness(1.08); } }
@keyframes nfGrid { 0% { background-position: 0 0; } 100% { background-position: 64px 64px; } }
@keyframes nfTwinkle { 0%,100% { opacity: .15; transform: scale(1); } 50% { opacity: .85; transform: scale(1.6); } }

/* ============ 布局 ============ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 372px minmax(0, 1fr); min-height: 100vh; max-width: 1760px; margin: 0 auto; }

/* ============ 左侧输入面板 ============ */
.panel {
  display: flex; flex-direction: column; padding: 34px 30px;
  background: rgba(9,16,32,.55);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-right: 1px solid rgba(120,170,255,.14);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-name { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.brand-desc { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--sub); }
.badge { align-self: flex-start; margin-top: 12px; padding: 5px 11px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 11px; color: var(--sub); line-height: 1.4; }

.section-label { margin-top: 18px; font-size: 11.5px; font-weight: 700; color: var(--dim); letter-spacing: 2px; }

.link-input {
  margin-top: 9px; display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-radius: 15px;
  background: rgba(255,255,255,.03); border: 1.5px solid rgba(120,170,255,.2);
  transition: border-color .15s, box-shadow .15s;
}
.link-input:focus-within { border-color: rgba(56,224,255,.6); box-shadow: 0 0 0 3px rgba(56,224,255,.08); }
.link-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: nfBreathe 2s ease-in-out infinite; }
.link-input input { flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--ink); font-family: inherit; }
.link-input input::placeholder { color: var(--dim); }

.link-actions { display: flex; align-items: center; gap: 12px; margin-top: 11px; flex-wrap: wrap; }
.link-btn { border: none; cursor: pointer; font-family: inherit; font-weight: 700; transition: transform .05s, opacity .15s; }
.link-btn:active { transform: translateY(1px); }
.link-btn.primary { padding: 9px 16px; border-radius: 12px; font-size: 13px; color: #04101f; background: linear-gradient(135deg, #38e0ff, #7ee8c8); box-shadow: 0 0 18px rgba(56,224,255,.28); }
.link-btn.ghost { padding: 0; background: none; color: #7fc8ff; font-size: 12.5px; font-weight: 600; }
.link-btn:disabled, .link-btn.busy { opacity: .55; cursor: not-allowed; }

/* 提取进度（保留原有功能） */
.extract-progress {
  position: relative; margin-top: 12px; padding: 12px 13px 11px; min-height: 106px; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.035); border: 1px solid rgba(120,170,255,.16); box-shadow: inset 0 0 22px rgba(56,224,255,.03);
}
.extract-progress[hidden] { display: none; }
.extract-progress.running { animation: nfExtractPulse 1.8s ease-in-out infinite; }
.extract-progress.running::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 0%, rgba(56,224,255,.08) 45%, transparent 70%); animation: nfExtractSweep 1.7s ease-in-out infinite; }
.extract-progress.done { border-color: rgba(53,230,160,.34); }
.extract-progress.error { border-color: rgba(255,79,99,.42); }
.extract-progress-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.extract-progress-title { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.extract-progress-text { margin: 4px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--sub); }
.extract-progress-percent { flex: none; font-size: 20px; font-weight: 800; line-height: 1; color: var(--cyan); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(56,224,255,.38); }
.extract-progress.error .extract-progress-percent { color: #ff7082; text-shadow: none; }
.extract-progress.done .extract-progress-percent { color: var(--green); text-shadow: 0 0 14px rgba(53,230,160,.34); }
.extract-progress-track { position: relative; z-index: 1; margin-top: 11px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.extract-progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #38e0ff, #ff9a3d, #7ee8c8); background-size: 220% 100%; box-shadow: 0 0 14px rgba(56,224,255,.45); transition: width .45s cubic-bezier(.22,.61,.36,1); animation: nfExtractFlow 1.4s linear infinite; }
.extract-progress.done .extract-progress-fill { background: linear-gradient(90deg, #35e6a0, #ffd166); animation: none; }
.extract-progress.error .extract-progress-fill { background: linear-gradient(90deg, #ff4f63, #ff9a3d); animation: none; }
.extract-progress-dots { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: 10px; }
.extract-progress-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); opacity: .35; animation: nfExtractDot 1s ease-in-out infinite; }
.extract-progress-dots span:nth-child(2) { animation-delay: .16s; }
.extract-progress-dots span:nth-child(3) { animation-delay: .32s; }
.extract-progress.done .extract-progress-dots span { background: var(--green); animation: none; opacity: .8; }
.extract-progress.error .extract-progress-dots span { background: #ff7082; animation: none; opacity: .8; }

/* 表单 */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.source-grid { margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.field > span { font-size: 11.5px; font-weight: 700; color: var(--dim); }
.opt-grid .field { margin-top: 0; }
.field-wide { grid-column: 1 / -1; }
.reference-field { margin-top: 15px; padding: 13px; border: 1px solid rgba(56,224,255,.22); border-radius: 14px; background: rgba(56,224,255,.035); }
.reference-field > span:first-child { color: var(--cyan-soft); }
.reference-field small { margin-left: 4px; color: var(--sub); font-size: 10.5px; font-weight: 600; }
.reference-field textarea { min-height: 86px; background: rgba(2,8,20,.45); }
.field-help { font-size: 10.5px !important; font-weight: 500 !important; line-height: 1.55; color: var(--sub) !important; }
input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--ink); font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
select option { background: #0b1428; color: var(--ink); }
textarea { resize: vertical; min-height: 64px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(56,224,255,.5); box-shadow: 0 0 0 3px rgba(56,224,255,.08); }
input::placeholder, textarea::placeholder { color: var(--dim); }

.editor-fold { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.editor-fold > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--sub); letter-spacing: 1px; list-style: none; }
.editor-fold > summary::-webkit-details-marker { display: none; }
.editor-fold > summary::before { content: "▸ "; color: var(--cyan); }
.editor-fold[open] > summary::before { content: "▾ "; }
.fold-hint { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--dim); }
.extracted-video {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(56,224,255,.22);
  border-radius: 14px;
  background: rgba(56,224,255,.035);
}
.extracted-video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--cyan-soft);
  font-size: 12px;
  font-weight: 750;
}
.extracted-video-head a { color: var(--cyan); font-size: 11px; text-decoration: none; }
.extracted-video video {
  display: block;
  width: 100%;
  max-height: 300px;
  margin-bottom: 10px;
  border: 1px solid rgba(127,200,255,.16);
  border-radius: 12px;
  background: #020714;
  object-fit: contain;
}
.extracted-video .field { margin-top: 0; }
.extracted-video small { color: var(--sub); font-size: 10px; }

/* 吉祥物 */
.panel-spacer { flex: 1; min-height: 90px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.mascot { position: relative; width: 66px; height: 66px; animation: nfDrift 5s ease-in-out infinite; }
.ms-glow { position: absolute; inset: -9px; border-radius: 22px; background: radial-gradient(circle, var(--accent), transparent 68%); filter: blur(8px); opacity: .55; }
.ms-antenna { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 2px; height: 12px; background: linear-gradient(180deg, var(--accent), rgba(120,170,255,.25)); }
.ms-tip { position: absolute; left: 50%; top: -16px; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: nfTwinkle 1.9s ease-in-out infinite; }
.ms-head { position: absolute; inset: 0; border-radius: 19px; background: linear-gradient(155deg, #1a2947, #0a1123); border: 1px solid rgba(120,170,255,.24); box-shadow: inset 0 2px 6px rgba(255,255,255,.07), inset 0 -8px 15px rgba(0,0,0,.45), 0 10px 22px rgba(0,8,24,.5); }
.ms-shine { position: absolute; left: 7px; right: 7px; top: 5px; height: 12px; border-radius: 11px; background: linear-gradient(180deg, rgba(255,255,255,.13), transparent); }
.ms-visor { position: absolute; left: 11px; right: 11px; top: 25px; height: 15px; border-radius: 7px; background: rgba(2,8,20,.9); border: 1px solid rgba(120,170,255,.16); overflow: hidden; }
.ms-eye { position: absolute; top: 50%; transform: translateY(-50%); width: 13px; height: 5px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 11px var(--accent); animation: nfVisor 1.5s ease-in-out infinite alternate; }
.ms-arm { position: absolute; border-radius: 2px; }
.ms-arm-l1 { left: 6px; bottom: 11px; width: 9px; height: 2px; background: rgba(120,170,255,.3); }
.ms-arm-l2 { left: 6px; bottom: 7px; width: 6px; height: 2px; background: rgba(120,170,255,.2); }
.ms-arm-r1 { right: 6px; bottom: 11px; width: 9px; height: 2px; background: rgba(120,170,255,.3); }
.ms-arm-r2 { right: 6px; bottom: 7px; width: 6px; height: 2px; background: rgba(120,170,255,.2); }

.cta { margin-top: 8px; width: 100%; padding: 15px; border: none; border-radius: 15px; cursor: pointer; font-size: 15px; font-weight: 800; color: #04101f; font-family: inherit; background: linear-gradient(135deg, #38e0ff, #7ee8c8); box-shadow: 0 0 30px rgba(56,224,255,.4); transition: opacity .15s, box-shadow .15s, transform .05s; }
.cta:active { transform: translateY(1px); }
.cta:disabled, .cta.busy { cursor: default; opacity: .85; background: linear-gradient(135deg, #4d5f86, #5d7099); box-shadow: none; }
.reset-btn { margin-top: 11px; border: none; background: none; cursor: pointer; font-size: 12.5px; color: var(--dim); font-weight: 600; font-family: inherit; }
.panel-foot { margin: 14px 0 0; font-size: 11px; line-height: 1.6; color: var(--dim); opacity: .7; }

/* ============ 右侧创作进度 ============ */
.stage { display: flex; flex-direction: column; padding: 26px 28px; min-width: 0; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.workspace-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-toggle, .case-toggle, .history-refresh { appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--ink); border-radius: 10px; padding: 8px 11px; font: 700 12px inherit; cursor: pointer; }
.history-toggle:hover, .case-toggle:hover, .history-refresh:hover { border-color: rgba(56,224,255,.42); background: rgba(56,224,255,.07); }
.history-toggle span, .case-toggle span { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; margin-left: 5px; border-radius: 6px; background: rgba(56,224,255,.12); color: var(--cyan-soft); }
.history-retention { font-size: 11px; color: var(--dim); }
.history-panel { margin: -4px 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,14,29,.88); }
.history-panel[hidden] { display: none; }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.history-head h2 { margin: 0; font-size: 16px; }
.history-head p { margin: 3px 0 0; font-size: 11px; color: var(--sub); }
.history-list { display: grid; gap: 7px; margin-top: 13px; }
.history-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 12px; border: 1px solid transparent; border-radius: 11px; background: rgba(255,255,255,.025); color: var(--ink); text-align: left; cursor: pointer; }
.history-item:hover { border-color: rgba(56,224,255,.3); background: rgba(56,224,255,.045); }
.history-item-main { min-width: 0; display: grid; gap: 2px; }
.history-item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.history-item-main small { color: var(--dim); font-size: 10.5px; }
.history-status { flex: none; font-size: 10.5px; color: var(--sub); }
.history-status.done { color: var(--green-soft); }
.history-status.ready { color: var(--cyan-soft); }
.history-status.error { color: #ff8c9b; }
.history-empty { padding: 18px 4px; color: var(--dim); font-size: 12px; text-align: center; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stage-head-left { min-width: 0; }
.stage-toprow { display: flex; align-items: center; gap: 10px; }
.stage-label { font-size: 11.5px; font-weight: 700; color: var(--dim); letter-spacing: 2px; white-space: nowrap; }

.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(255,79,163,.14); border: 1px solid rgba(255,79,163,.4); white-space: nowrap; }
.live-badge[hidden] { display: none; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5da2; box-shadow: 0 0 8px #ff5da2; animation: nfBlink 1s step-end infinite; }
.live-text { font: 700 10px ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--pink-soft); letter-spacing: 1px; font-variant-numeric: tabular-nums; }

.headline {
  display: inline-block; margin: 7px 0 0; font-size: 23px; font-weight: 800; line-height: 1.25;
  color: var(--ink);
}
.subline { margin: 5px 0 0; font-size: 12.5px; color: var(--sub); }

.overall-track { margin-top: 11px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.overall-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #38e0ff, #ff8a3d); box-shadow: 0 0 10px rgba(56,224,255,.5); transition: width .3s linear; }

/* macro 阶段容器 */
.macro { margin-top: 15px; flex: 1; min-height: 260px; }
.macro[hidden] { display: none; }
.card-pulse { animation: nfBorderPulse 1.8s ease-in-out infinite; }
.card-head { display: flex; align-items: center; gap: 9px; }
.cnum { width: 24px; height: 24px; flex: none; border-radius: 8px; background: rgba(56,224,255,.12); color: var(--cyan-soft); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.cname { flex: 1; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pill { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill-run { background: rgba(56,224,255,.16); color: var(--cyan-soft); }
.pill-done { background: rgba(53,230,160,.16); color: var(--green-soft); }

/* 阶段 1：读取内容 */
.macro-read { display: flex; gap: 15px; }
.read-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); overflow: hidden; }
.read-main .card-head { padding: 15px 16px 11px; }
.term {
  flex: 1; min-height: 0; margin: 0 15px 15px; border-radius: 12px;
  background: rgba(2,8,20,.72); border: 1px solid rgba(56,224,255,.16); padding: 12px 15px;
  font: 11.5px/1.95 ui-monospace, "SFMono-Regular", Menlo, monospace; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.term-row { display: flex; gap: 10px; white-space: nowrap; animation: nfRise .25s ease-out both; }
.term-row .t-time { color: #3d5a86; flex: none; }
.term-row .t-text { overflow: hidden; text-overflow: ellipsis; }
.term-caret { color: var(--cyan-soft); }
.term-caret i { display: inline-block; width: 8px; height: 14px; background: var(--cyan); vertical-align: -2px; animation: nfBlink 1s step-end infinite; }

.read-side { width: 200px; flex: none; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); padding: 14px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.src-label { font: 700 10px ui-monospace, monospace; color: var(--dim); letter-spacing: 1.5px; }
.src-preview { margin-top: 11px; flex: 1; border-radius: 12px; background: rgba(255,255,255,.04); position: relative; overflow: hidden; padding: 14px; }
.src-hero { width: 66%; height: 46px; border-radius: 9px; background: linear-gradient(135deg, #3d5edb, #38e0ff); margin-bottom: 12px; }
.src-line { height: 9px; border-radius: 5px; background: rgba(255,255,255,.14); margin-bottom: 9px; }
.src-line.w88 { width: 88%; background: rgba(255,255,255,.1); }
.src-line.w72 { width: 72%; background: rgba(255,255,255,.1); }
.src-line.w80 { width: 80%; background: rgba(255,255,255,.08); margin-bottom: 0; }
.src-scan { position: absolute; left: 0; right: 0; height: 34%; background: linear-gradient(180deg, transparent, rgba(56,224,255,.28)); animation: nfScanY 2.2s linear infinite; }

/* 阶段 2：整理要点 */
.macro-org { display: flex; flex-direction: column; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); padding: 16px 18px; overflow: hidden; }
.chip-count { font: 600 11px ui-monospace, monospace; color: var(--cyan-soft); }
.chip-cloud { margin-top: 16px; flex: 1; min-height: 0; display: flex; flex-wrap: wrap; gap: 11px; align-content: flex-start; overflow: hidden; }
.kw { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; animation: nfChipIn .4s cubic-bezier(.2,1.4,.4,1) both; }
.kw .kw-w { font: 600 10.5px ui-monospace, monospace; opacity: .6; }

/* 阶段 3+4：并行 */
.macro-gen { display: flex; gap: 15px; }
.gen-card { flex: 0.92; min-width: 0; display: flex; flex-direction: column; padding: 15px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); overflow: hidden; position: relative; }
.gen-card.wide { flex: 1.15; }
.write-text {
  margin-top: 12px; flex: 1; min-height: 0; overflow: hidden; padding: 12px 14px; border-radius: 12px;
  background: rgba(2,8,20,.5); border: 1px solid rgba(120,170,255,.14);
  font-size: 13px; line-height: 1.75; color: var(--ink); white-space: pre-wrap;
}
.write-text .type-last { display: inline-block; animation: nfPop .18s ease-out; }
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; background: var(--cyan); vertical-align: -2px; animation: nfBlink 1s step-end infinite; }
.outline { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.ol { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font: 700 10.5px sans-serif; transition: all .25s; color: #586a8c; background: rgba(255,255,255,.03); border: 1px solid rgba(120,170,255,.12); }
.ol.on { color: var(--green-soft); background: rgba(53,230,160,.1); border-color: rgba(53,230,160,.35); }
.write-meta { margin-top: 10px; font: 600 10.5px ui-monospace, monospace; display: flex; gap: 14px; }
.m-cyan { color: var(--cyan-soft); }
.m-gold { color: var(--gold); }
.m-dim { color: var(--dim); }

.img-status { margin-top: 11px; font: 600 10.5px ui-monospace, monospace; display: flex; gap: 12px; flex-wrap: wrap; }
.img-pipe { margin-top: 8px; position: relative; height: 5px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.img-pipe-band { position: absolute; top: 0; bottom: 0; width: 42%; border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(56,224,255,.75), transparent); animation: nfPipe 1.8s linear infinite; }
.img-tiles { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tile { position: relative; aspect-ratio: 3/4; border-radius: 9px; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-noise { position: absolute; inset: 0; backdrop-filter: blur(6px); background-image: radial-gradient(rgba(255,255,255,.38) 1px, transparent 1px); background-size: 5px 5px; animation: nfNoise .5s linear infinite; transition: opacity .22s; }
.tile-sweep { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%); animation: nfSweep 1.1s ease-in-out infinite; }
.tile-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; text-align: center; font: 700 9px ui-monospace, monospace; color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55)); }
.term-sm { margin: 10px 0 0; border-radius: 11px; padding: 8px 11px; font: 10.5px/1.7 ui-monospace, monospace; }

.gen-foot { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.gen-bar { height: 5px; flex: 1; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.gen-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #38e0ff, #ff9a3d); transition: width .12s linear; }
.gen-fill.done { background: linear-gradient(90deg, #35e6a0, #ffd166); }
.gen-num { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 800; color: var(--orange); }
.gen-num.done { color: var(--gold); }
.gen-num small { font-size: 11px; }

/* 底部技术流水条 */
.stream { margin-top: 11px; flex: none; height: 24px; border-radius: 8px; overflow: hidden; position: relative; background: rgba(2,8,20,.6); border: 1px solid rgba(120,170,255,.12); }
.stream[hidden] { display: none; }
.stream-text { position: absolute; white-space: nowrap; font: 9.5px/24px ui-monospace, monospace; color: rgba(127,227,255,.55); animation: nfStream 16s linear infinite; }
.stream-mask { position: absolute; inset: 0; background: linear-gradient(90deg, #04101f, transparent 8%, transparent 92%, #04101f); pointer-events: none; }

/* ============ 宽版结果工作台 ============ */
.result-wrap { margin-top: 20px; }
.result-wrap[hidden] { display: none; }
.result-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 17px; }
.result-eyebrow { color: var(--cyan-soft); font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; }
.result-heading h2 { margin: 3px 0 0; font-size: 21px; line-height: 1.35; }
.prov-note { font-size: 11.5px; color: var(--sub); text-align: right; }
.prov-note.fallback { color: var(--gold); font-weight: 700; }
.image-notice { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,209,102,.26); background: rgba(255,209,102,.055); color: #f5d987; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.image-notice[hidden] { display: none; }
.variant-wall { display: flex; flex-direction: column; }
.result-row { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) 142px; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); animation: nfRise .35s ease-out both; }
.result-row:first-child { border-top: 1px solid var(--line); }
.result-cover { position: relative; width: 100%; aspect-ratio: 3 / 4; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid rgba(120,170,255,.16); background: #091225; color: inherit; text-align: left; cursor: zoom-in; }
.result-cover:disabled { cursor: default; }
.result-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-version, .result-image-state { position: absolute; left: 9px; padding: 4px 7px; border-radius: 7px; background: rgba(2,8,20,.82); backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; }
.result-version { bottom: 9px; color: #fff; letter-spacing: .5px; }
.result-image-state { top: 9px; right: 9px; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-copy { min-width: 0; align-self: start; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 10.5px; color: var(--dim); }
.result-meta span:first-child { color: var(--cyan-soft); font-weight: 700; }
.result-copy h3 { margin: 8px 0 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.35; letter-spacing: -.3px; }
.result-body-text { position: relative; margin-top: 13px; max-width: 72ch; color: #c9d6ec; font-size: 14px; line-height: 1.85; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.result-row.expanded .result-body-text { display: block; overflow: visible; }
.result-tags { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 14px; }
.result-tags span { color: #7faeff; font-size: 11.5px; }
.result-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 16px; max-width: 620px; }
.result-scenes figure, .result-scene-preview { margin: 0; padding: 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 9px; border: 1px solid var(--line); background: #07101c; cursor: zoom-in; }
.result-scenes img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-actions { align-self: start; display: grid; gap: 7px; position: sticky; top: 18px; }
.result-actions button { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.035); color: var(--ink); font: 700 11.5px inherit; cursor: pointer; }
.result-actions button:hover { border-color: rgba(56,224,255,.42); background: rgba(56,224,255,.075); }
.result-actions .result-primary { background: var(--cyan); border-color: var(--cyan); color: #04101f; }
.result-actions .result-expand { color: var(--cyan-soft); }

.api-fold { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.api-fold summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--sub); }
.api-box { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 12px; border-radius: 12px; background: rgba(3,8,20,.7); border: 1px solid var(--line); color: #cfe0ff; font-size: 12px; line-height: 1.5; }

/* ============ Toast ============ */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { padding: 10px 16px; border-radius: 12px; font-size: 13px; max-width: 320px; background: rgba(13,20,38,.94); border: 1px solid var(--line); color: var(--ink); opacity: 0; transform: translateY(10px); transition: all .25s; box-shadow: 0 12px 30px rgba(0,6,22,.4); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(53,230,160,.5); }
.toast-error { border-color: rgba(255,79,99,.6); }
.toast-warn { border-color: rgba(255,154,61,.6); }

/* ============ 关键帧 ============ */
@keyframes nfBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes nfGradText { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes nfPop { 0% { transform: translateY(6px) scale(.6); opacity: 0; } 60% { transform: translateY(-2px) scale(1.08); } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes nfBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes nfSweep { 0% { transform: translateX(-130%); } 100% { transform: translateX(230%); } }
@keyframes nfSpin { to { transform: rotate(360deg); } }
@keyframes nfSpinR { to { transform: rotate(-360deg); } }
@keyframes nfScanY { 0% { top: -30%; } 100% { top: 110%; } }
@keyframes nfStream { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes nfChipIn { 0% { opacity: 0; transform: scale(.4) translateY(6px); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes nfNoise { 0% { background-position: 0 0; } 100% { background-position: 38px 57px; } }
@keyframes nfPipe { 0% { left: -42%; } 100% { left: 100%; } }
@keyframes nfDrift { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes nfVisor { 0% { left: 12%; } 100% { left: 60%; } }
@keyframes nfBorderPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,79,163,.55), 0 0 20px rgba(255,79,163,.32), inset 0 0 22px rgba(255,79,163,.05); }
  50% { box-shadow: 0 0 0 1.5px rgba(255,79,163,.85), 0 0 32px rgba(255,79,163,.5), inset 0 0 26px rgba(255,79,163,.09); }
}
@keyframes nfRise { 0% { opacity: 0; transform: translateY(14px) scale(.97); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes nfModalIn { 0% { opacity: 0; transform: translateY(16px) scale(.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes nfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nfExtractSweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes nfExtractFlow { 0% { background-position: 0% 50%; } 100% { background-position: 220% 50%; } }
@keyframes nfExtractPulse { 0%,100% { box-shadow: inset 0 0 22px rgba(56,224,255,.03), 0 0 0 rgba(56,224,255,0); } 50% { box-shadow: inset 0 0 24px rgba(56,224,255,.08), 0 0 22px rgba(56,224,255,.12); } }
@keyframes nfExtractDot { 0%,100% { opacity: .28; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .panel { border-right: none; border-bottom: 1px solid rgba(120,170,255,.14); }
  .panel-spacer { display: none; }
}
@media (max-width: 900px) {
  .result-row { grid-template-columns: minmax(190px, 238px) minmax(0, 1fr); gap: 20px; }
  .result-actions { grid-column: 1 / -1; position: static; display: flex; flex-wrap: wrap; }
  .result-actions button { width: auto; min-width: 104px; }
}
@media (max-width: 720px) {
  .macro-read, .macro-gen { flex-direction: column; }
  .read-side { width: auto; }
  .stage-head { flex-direction: column; align-items: flex-start; }
  .stage { padding: 20px 16px; }
  .workspace-toolbar, .result-heading { align-items: flex-start; flex-direction: column; }
  .prov-note { text-align: left; }
  .history-retention { display: none; }
  .result-row { grid-template-columns: 1fr; gap: 17px; padding: 22px 0; }
  .result-cover { width: min(260px, 78vw); }
  .result-actions { grid-column: auto; }
  .result-actions button { flex: 1 1 118px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ============ JARVIS CONTENT OS · 2026-07 ============ */
:root {
  --ink: oklch(94% .018 250);
  --sub: oklch(70% .038 248);
  --dim: oklch(56% .045 248);
  --line: oklch(64% .075 238 / .22);
  --glass: oklch(17% .025 254 / .92);
  --glass-2: oklch(21% .03 250 / .92);
  --cyan: oklch(81% .13 211);
  --cyan-soft: oklch(86% .09 213);
  --mint: oklch(83% .11 164);
  --orange: oklch(76% .14 62);
  --gold: oklch(84% .12 86);
  --green: oklch(79% .14 157);
  --green-soft: oklch(86% .09 158);
  --radius: 8px;
}

body { background: #050912; }
.bg-base { background: #050912; }
.bg-grid {
  background-image:
    linear-gradient(rgba(90, 168, 208, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 168, 208, .055) 1px, transparent 1px);
  background-size: 58px 58px;
  animation: none;
  mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, .56));
}
.bg-sweep {
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 22%;
  border-right: 1px solid rgba(80, 216, 245, .10);
  background: linear-gradient(90deg, transparent, rgba(55, 190, 225, .025), transparent);
  animation: nfWorkbenchSweep 13s linear infinite;
}
.twinkle { width: 2px; height: 2px; border-radius: 0; opacity: .45; }

.app { grid-template-columns: 390px minmax(0, 1fr); max-width: 1840px; }
.panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 26px 32px;
  background: #08101e;
  border-right: 1px solid rgba(94, 181, 220, .22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(83, 205, 236, .28) transparent;
}
.brand { justify-content: space-between; align-items: flex-start; gap: 18px; }
.brand-kicker, .case-eyebrow {
  display: block;
  color: var(--cyan);
  font: 750 9px/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 2.1px;
}
.brand-name { margin-top: 5px; font-size: 21px; letter-spacing: .2px; }
.brand-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-soft);
  font: 750 9px/1 ui-monospace, monospace;
  letter-spacing: 1.2px;
  padding-top: 7px;
}
.brand-online i {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(75, 235, 170, .7);
}
.brand-desc { margin-top: 12px; font-size: 12px; }
.badge {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 6px 9px;
  border-radius: 3px;
  background: #060c17;
  color: var(--sub);
  font: 650 10px/1.3 inherit;
}
.service-badge i {
  width: 6px;
  height: 6px;
  background: var(--dim);
  box-shadow: 0 0 7px rgba(109, 129, 168, .55);
}
.service-badge.ready i {
  background: var(--green);
  box-shadow: 0 0 8px rgba(53, 230, 160, .65);
}
.service-badge.error { color: #ff9baa; }
.service-badge.error i {
  background: #ff6f84;
  box-shadow: 0 0 8px rgba(255, 111, 132, .6);
}
.section-label { margin-top: 20px; font: 750 10px/1 ui-monospace, monospace; }
.link-input,
input[type=text],
input[type=number],
select,
textarea,
.reference-field,
.extract-progress { border-radius: 5px; }
.link-input { padding: 11px 12px; background: #060c17; }
.link-input input { min-width: 0; width: 0; }
.link-dot { width: 5px; height: 5px; border-radius: 0; }
.link-btn.primary, .cta {
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(56, 224, 255, .15);
}
.link-btn.ghost { color: var(--cyan-soft); }
.cta:disabled, .cta.busy { background: #445166; }
.reference-field { background: #07131f; }
.editor-fold > summary { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.panel-spacer { min-height: 70px; }

.stage {
  height: 100vh;
  overflow-y: auto;
  padding: 24px clamp(22px, 3.2vw, 52px) 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(83, 205, 236, .28) transparent;
}
.workspace-toolbar { margin-bottom: 20px; }
.history-toggle, .case-toggle, .history-refresh { border-radius: 4px; background: #08101d; }
.history-panel { border-radius: 6px; background: #08101d; }

.case-library { padding: 8px 0 28px; border-bottom: 1px solid var(--line); }
.case-library[hidden] { display: none; }
.case-library-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 16px;
}
.case-library-head h2, .demo-console-head h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.25;
}
.case-library-head p { max-width: 630px; margin: 6px 0 0; color: var(--sub); font-size: 12.5px; }
.case-library-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.case-manage-btn {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #08101d;
  color: var(--sub);
  font: 700 10px inherit;
  cursor: pointer;
}
.case-manage-btn:hover,
.case-manage-btn[aria-expanded="true"] { border-color: var(--cyan); color: var(--cyan-soft); }
.case-manage-btn.active { border-color: rgba(74, 222, 128, .5); color: var(--green-soft); }
.case-admin-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(73, 201, 234, .28);
  border-left: 2px solid var(--cyan);
  background: #07111d;
}
.case-admin-panel[hidden],
.case-admin-login[hidden],
.case-admin-ready[hidden] { display: none; }
.case-admin-login {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px minmax(190px, 260px) auto;
  align-items: end;
  gap: 12px;
}
.case-admin-login strong,
.case-admin-ready strong { color: var(--ink); font-size: 13px; }
.case-admin-login p,
.case-admin-ready p { margin: 5px 0 0; color: var(--dim); font-size: 10.5px; line-height: 1.5; }
.case-admin-login label {
  align-self: center;
  color: var(--sub);
  font: 700 10px/1.2 inherit;
  text-align: right;
}
.case-admin-login input {
  min-width: 0;
  width: 100%;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #050b14;
  color: var(--ink);
}
.case-admin-login button,
.case-admin-ready button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--cyan);
  border-radius: 3px;
  background: var(--cyan);
  color: #031019;
  font: 750 10px inherit;
  cursor: pointer;
}
.case-admin-login button:disabled { cursor: wait; opacity: .6; }
.case-admin-ready { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.case-admin-ready strong { display: inline-flex; align-items: center; gap: 7px; color: var(--green-soft); }
.case-admin-ready strong i {
  width: 6px;
  height: 6px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.case-admin-ready button { flex: none; border-color: var(--line); background: transparent; color: var(--sub); }
.case-duration, .demo-clock {
  flex: none;
  color: var(--gold);
  font: 750 10px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 1px;
}
.case-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.case-loading { grid-column: 1 / -1; padding: 32px; color: var(--dim); text-align: center; font-size: 12px; }
.case-empty { display: grid; gap: 8px; border: 1px dashed var(--line); background: rgba(255,255,255,.015); }
.case-empty strong { color: var(--ink); font-size: 14px; }
.case-empty span { font-size: 11px; }
.case-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #08101d;
  border: 1px solid var(--line);
}
.case-card-visual {
  appearance: none;
  position: relative;
  width: 100%;
  padding: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #060c17;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}
.case-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: saturate(.9) contrast(1.01);
}
.case-card-visual::after { content: ""; position: absolute; inset: 0; border-top: 2px solid transparent; transition: border-color .2s; }
.case-card:hover .case-card-visual::after { border-color: var(--cyan); }
.case-card-visual span {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 3px 5px;
  background: rgba(4, 10, 18, .9);
  color: var(--cyan-soft);
  font: 700 8px/1 ui-monospace, monospace;
}
.case-card-copy { min-width: 0; min-height: 190px; display: flex; flex-direction: column; padding: 16px; }
.case-card-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--dim); font: 700 8px/1.2 ui-monospace, monospace; letter-spacing: .8px; }
.case-card-copy h3 { margin: 14px 0 0; font-size: 16px; line-height: 1.42; }
.case-card-copy p { margin: 7px 0 16px; color: var(--sub); font-size: 11.5px; line-height: 1.6; }
.case-card-actions { display: grid; gap: 7px; margin-top: auto; }
.case-card-copy button {
  width: 100%;
  margin-top: 0;
  padding: 8px 9px;
  border: 1px solid rgba(73, 201, 234, .3);
  border-radius: 3px;
  background: transparent;
  color: var(--cyan-soft);
  font: 750 10px inherit;
  text-align: left;
  cursor: pointer;
}
.case-card-copy button span { float: right; }
.case-card-copy button:hover { background: rgba(60, 205, 239, .07); border-color: var(--cyan); }
.case-card-copy .case-delete-btn {
  border-color: rgba(255, 111, 132, .34);
  color: #ff9bab;
  text-align: center;
}
.case-card-copy .case-delete-btn:hover {
  border-color: #ff6f84;
  background: rgba(255, 111, 132, .08);
}
.case-card-copy .case-delete-btn:disabled { cursor: wait; opacity: .55; }

.demo-console {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid rgba(73, 201, 234, .38);
  border-top: 2px solid var(--cyan);
  background: #07111d;
}
.demo-console[hidden] { display: none; }
.demo-console-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.demo-console-head h2 { font-size: 20px; }
.demo-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0 0;
  padding: 0;
  background: var(--line);
  list-style: none;
}
.demo-rail li { min-width: 0; min-height: 62px; padding: 10px; background: #0a1321; color: var(--dim); }
.demo-rail li span { display: block; font: 750 9px/1 ui-monospace, monospace; }
.demo-rail li strong { display: block; margin-top: 9px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-rail li.active { color: var(--cyan-soft); background: #0a1a27; box-shadow: inset 0 -2px var(--cyan); }
.demo-rail li.done { color: var(--green-soft); }
.demo-console-foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 14px; }
.demo-console-foot p { margin: 0; color: var(--sub); font-size: 11.5px; }
.demo-actions { display: flex; gap: 8px; flex: none; }
.demo-stop, .demo-use {
  padding: 8px 11px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font: 700 10.5px inherit;
  cursor: pointer;
}
.demo-use { border-color: var(--cyan); background: var(--cyan); color: #031019; }

.stage-head { margin-top: 23px; }
.headline {
  display: block;
  color: var(--ink);
  background: none;
  animation: none;
  font-size: clamp(22px, 2.2vw, 31px);
}
.stage-telemetry { width: 172px; flex: none; padding: 11px 12px; border: 1px solid var(--line); background: #07101c; }
.telemetry-row { display: flex; justify-content: space-between; gap: 14px; color: var(--dim); font: 700 8px/1.8 ui-monospace, monospace; letter-spacing: 1px; }
.telemetry-row strong { color: var(--cyan-soft); font-size: 9px; }
.signal-bars { height: 18px; display: flex; align-items: end; gap: 3px; margin-top: 6px; }
.signal-bars i { flex: 1; height: 25%; background: var(--cyan); opacity: .5; animation: nfSignal 1.5s ease-in-out infinite; }
.signal-bars i:nth-child(2) { height: 48%; animation-delay: -.2s; }
.signal-bars i:nth-child(3) { height: 80%; animation-delay: -.4s; }
.signal-bars i:nth-child(4) { height: 60%; animation-delay: -.6s; }
.signal-bars i:nth-child(5) { height: 100%; animation-delay: -.8s; }
.overall-meta { display: flex; justify-content: space-between; margin-top: 14px; color: var(--dim); font: 700 8px/1 ui-monospace, monospace; letter-spacing: 1px; }
.overall-track { margin-top: 7px; height: 3px; border-radius: 0; }
.overall-fill { border-radius: 0; background: var(--cyan); box-shadow: 0 0 8px rgba(56, 224, 255, .4); }

.read-main, .read-side, .macro-org, .gen-card, .write-text, .term, .stream, .api-box { border-radius: 5px; background-color: #08111f; }
.card-pulse { animation: nfWorkbenchPulse 1.8s ease-in-out infinite; }
.cnum { border-radius: 2px; }
.pill { border-radius: 2px; }
.src-hero { border-radius: 3px; background: #153a50; }
.kw, .ol { border-radius: 3px; }
.img-pipe, .gen-bar { border-radius: 0; }
.img-pipe-band, .gen-fill { border-radius: 0; }
.gen-fill { background: var(--cyan); }
.gen-fill.done { background: var(--green); }
.tile { border-radius: 3px; }
.tile-noise { backdrop-filter: none; }
.result-version, .result-image-state { border-radius: 2px; backdrop-filter: none; }
.result-cover, .result-scenes figure, .result-scene-preview, .result-actions button { border-radius: 4px; }

.image-viewer {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  height: min(920px, calc(100vh - 32px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(93, 211, 241, .46);
  border-top: 2px solid var(--cyan);
  border-radius: 6px;
  background: #050b14;
  color: var(--ink);
}
.image-viewer::backdrop { background: rgba(0, 4, 10, .86); }
.image-viewer-bar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #08111f;
}
.image-viewer-bar div { min-width: 0; }
.image-viewer-bar span {
  display: block;
  color: var(--cyan);
  font: 750 8px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 1.5px;
}
.image-viewer-bar strong {
  display: block;
  max-width: min(70vw, 760px);
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-viewer-bar button {
  flex: none;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--sub);
  font: 700 10px inherit;
  cursor: pointer;
}
.image-viewer-bar button:hover { border-color: var(--cyan); color: var(--cyan-soft); }
.image-viewer-canvas {
  height: calc(100% - 62px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 18px;
  overflow: auto;
  background-color: #040912;
  background-image:
    linear-gradient(rgba(120, 170, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, .045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.image-viewer-canvas img {
  min-width: 0;
  min-height: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .52);
}

.demo-focus {
  outline: 1px solid var(--cyan) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(56, 224, 255, .07), 0 0 26px rgba(56, 224, 255, .12) !important;
}
.demo-running .case-card button { opacity: .55; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

@keyframes nfWorkbenchSweep { from { left: -30%; } to { left: 120%; } }
@keyframes nfSignal { 0%, 100% { opacity: .28; } 50% { opacity: .95; } }
@keyframes nfWorkbenchPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(56, 224, 255, .15); }
  50% { box-shadow: 0 0 0 1px rgba(56, 224, 255, .45), 0 0 20px rgba(56, 224, 255, .08); }
}

@media (max-width: 1080px) {
  .app { width: 100%; max-width: 100vw; grid-template-columns: minmax(0, 1fr); }
  .panel, .stage { min-width: 0; }
  .panel { position: static; height: auto; overflow: visible; }
  .stage { height: auto; overflow: visible; }
  .case-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .case-list { grid-template-columns: 1fr; }
  .case-card-copy { min-height: 0; }
  .demo-rail { grid-template-columns: repeat(3, 1fr); }
  .case-admin-login { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .case-admin-login label { text-align: left; }
}

@media (max-width: 720px) {
  .panel { padding: 24px 18px; }
  .stage { padding: 20px 16px 48px; }
  .case-library-head, .demo-console-head, .demo-console-foot { align-items: flex-start; flex-direction: column; }
  .case-library-tools { width: 100%; justify-content: space-between; }
  .case-admin-ready { align-items: flex-start; flex-direction: column; }
  .stage-telemetry { width: 100%; }
  .demo-actions { width: 100%; }
  .demo-actions button { flex: 1; }
}

@media (max-width: 520px) {
  .opt-grid { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .field { min-width: 0; }
  .badge { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-sweep { display: none; }
}
