/*
 * 功能段演示卡的小动画：每张卡画的就是它说的那件事，纯 CSS 循环播放。
 * 只在卡片进入视口时播放（site.js 给 .viz 加 .is-on），离开就停；减少动态效果时停在最终画面。
 * 手下 / 电脑段 8 秒一个循环（--loop）；语音段 10 秒（要求 8~12 秒，逐字打出 + 打断 + 接上）。
 */
.art {
  --loop: 8s;
  --c: var(--accent);
  --c-soft: rgba(79, 195, 247, 0.16);
  --line: rgba(255, 255, 255, 0.12);
  --txt: rgba(232, 238, 248, 0.9);
  --dim: rgba(232, 238, 248, 0.5);
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--txt);
}
.art * { animation-play-state: paused; }
.viz.is-on .art * { animation-play-state: running; }

/* ---------- 段一（10s）：语音空间，照真界面画 ---------- */
.art--voice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vw, 22px); padding: clamp(12px, 3vw, 30px); }

.art .vs-title { font-size: clamp(34px, 5.6vw, 64px); font-weight: 700; letter-spacing: 0.08em; color: var(--ink); line-height: 1.1; }
.art .vs-sub { font-size: clamp(12px, 1.5vw, 15px); color: var(--dim); letter-spacing: 0.02em; margin-top: -6px; }

/* 波形：15 根青蓝竖条，中间高两端对称变矮（高度取自真界面），持续起伏 */
.art .wave { display: flex; align-items: flex-end; gap: clamp(4px, 0.8vw, 9px); width: min(460px, 86%); height: clamp(34px, 5.5vw, 52px); max-width: 100%; }
.art .wave i { flex: 1; min-width: 0; height: 100%; border-radius: 3px; background: linear-gradient(180deg, #7ad3fb, #2b7fb0); transform-origin: bottom; animation: wave-bar 0.9s ease-in-out infinite alternate; }
@keyframes wave-bar { 0% { transform: scaleY(0.3); } 100% { transform: scaleY(1); } }
.art .wave i:nth-child(1) { height: 14%; } .art .wave i:nth-child(2) { height: 19%; }
.art .wave i:nth-child(3) { height: 42%; } .art .wave i:nth-child(4) { height: 56%; }
.art .wave i:nth-child(5) { height: 78%; } .art .wave i:nth-child(6) { height: 100%; }
.art .wave i:nth-child(7) { height: 61%; } .art .wave i:nth-child(8) { height: 89%; }
.art .wave i:nth-child(9) { height: 97%; } .art .wave i:nth-child(10) { height: 89%; }
.art .wave i:nth-child(11) { height: 61%; } .art .wave i:nth-child(12) { height: 50%; }
.art .wave i:nth-child(13) { height: 36%; } .art .wave i:nth-child(14) { height: 22%; }
.art .wave i:nth-child(15) { height: 17%; }
.art .wave i:nth-child(3n) { animation-duration: 0.7s; } .art .wave i:nth-child(4n+1) { animation-duration: 1.1s; } .art .wave i:nth-child(5n+2) { animation-duration: 0.55s; }
.art .wave i:nth-child(2n) { animation-delay: -0.3s; } .art .wave i:nth-child(3n+1) { animation-delay: -0.6s; }

/* 波形被打断时顿一下 */
@keyframes vtalk {
  0%, 28% { opacity: 1; transform: scaleY(1); }
  32%, 42% { opacity: 0.45; transform: scaleY(0.35); }
  46%, 50% { opacity: 0.3; transform: scaleY(0.2); }
  54%, 86% { opacity: 1; transform: scaleY(1); }
  92%, 100% { opacity: 0.2; transform: scaleY(0.2); }
}
.art .a-talk { animation: vtalk 10s cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }

/* 双卡：麦克风输入 / 维斯回复 */
.art .vs-cards { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(10px, 1.8vw, 18px); width: 100%; max-width: min(940px, 100%); }
.art .vs-card {
  display: flex; flex-direction: column; gap: 6px; padding: clamp(12px, 2vw, 18px) clamp(14px, 2.4vw, 22px);
  border-radius: 12px; background: #101d2a; border: 1px solid #233343; min-width: 0; text-align: left;
}
.art .vs-card__label { font-size: 12px; color: var(--dim); }
.art .vs-card__body { font-size: clamp(13px, 1.6vw, 15px); color: var(--txt); overflow-wrap: break-word; min-height: 1.4em; }

/* 麦克风输入：打断时亮起「改成周四」 */
@keyframes mic-in { 0%, 30% { opacity: 0.25; } 34%, 46% { opacity: 1; color: var(--accent); } 50%, 100% { opacity: 0.3; } }
.art .a-mic { opacity: 0.3; animation: mic-in 10s cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }

/* 维斯回复：逐字打出，说到一半停住（被打断），再接上说完（clip-path 揭示，纯 CSS，可逐帧定位） */
.art .a-type { display: inline-block; white-space: nowrap; clip-path: inset(0 100% 0 0); }
@keyframes voice-type {
  0%, 2% { clip-path: inset(0 100% 0 0); }
  30% { clip-path: inset(0 46% 0 0); }
  46% { clip-path: inset(0 46% 0 0); }
  66% { clip-path: inset(0 0 0 0); }
  86%, 90% { clip-path: inset(0 0 0 0); }
  96%, 100% { clip-path: inset(0 100% 0 0); }
}
.art .a-type { animation: voice-type 10s steps(25, end) infinite both; }

/* 圆形麦克风按钮：深底 + 青蓝描边 + 呼吸发光 */
.art .vs-mic { position: relative; width: clamp(56px, 7.4vw, 78px); height: clamp(56px, 7.4vw, 78px); border-radius: 50%; flex: none;
  background: #0a1420; border: 1.5px solid rgba(79, 195, 247, 0.6); box-shadow: 0 0 24px rgba(79, 195, 247, 0.35);
  display: grid; place-items: center; animation: mic-glow 2.4s ease-in-out infinite; }
@keyframes mic-glow { 0%, 100% { box-shadow: 0 0 14px rgba(79, 195, 247, 0.3); } 50% { box-shadow: 0 0 30px rgba(79, 195, 247, 0.6); } }
.art .vs-mic__icon { width: 40%; height: 55%; border-radius: 40%; background: #dff3ff; position: relative; }
.art .vs-mic__icon::before { content: ""; position: absolute; left: 50%; bottom: -26%; width: 70%; height: 70%; transform: translateX(-50%);
  border: 2px solid #dff3ff; border-top: 0; border-radius: 0 0 50% 50%; }

/* ---------- 段二（8s）：一句话 → 三个手下并行 → 逐个完成 → 验收 ---------- */
.art .hub {
  position: absolute; left: 50%; top: 11%; transform: translateX(-50%);
  padding: 8px 18px; border-radius: 999px; font-size: 13px; color: var(--txt);
  background: var(--c-soft); border: 1px solid rgba(79, 195, 247, 0.45);
  box-shadow: 0 0 22px rgba(79, 195, 247, 0.2);
}
.art .lanes { position: absolute; left: 10%; right: 10%; top: 34%; display: flex; flex-direction: column; gap: 16px; }
.art .lane { display: grid; grid-template-columns: 104px 1fr 64px; align-items: center; gap: 12px; min-width: 0; }
.art .lane__name { color: var(--dim); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art .lane .bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; min-width: 0; }
.art .lane .bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: var(--c); }
.art .lane__done { text-align: right; color: #6be3a0; font-weight: 600; font-size: 12px; flex: none; }
@keyframes run-a { 0%, 6% { width: 0; } 34%, 86% { width: 100%; } 96%, 100% { width: 0; } }
@keyframes run-b { 0%, 6% { width: 0; } 44%, 86% { width: 100%; } 96%, 100% { width: 0; } }
@keyframes run-c { 0%, 6% { width: 0; } 54%, 86% { width: 100%; } 96%, 100% { width: 0; } }
@keyframes done-pop { 0%, 16% { opacity: 0; transform: scale(0.4); } 24%, 86% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.art .ra { animation: run-a var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .rb { animation: run-b var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .rc { animation: run-c var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .a-done { animation: done-pop var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .a-done.s2 { animation-delay: 0.5s; }
.art .a-done.s3 { animation-delay: 1s; }
.art .badge {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  padding: 7px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #031018;
  background: var(--accent); box-shadow: 0 0 26px rgba(79, 195, 247, 0.45);
}
@keyframes badge-pop { 0%, 58% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } 66%, 90% { opacity: 1; transform: translate(-50%, 0) scale(1); } 96%, 100% { opacity: 0; transform: translate(-50%, 0) scale(1); } }
.art .a-badge { animation: badge-pop var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }

/* ---------- 段三（8s）：截屏 → 看懂 → 点准 → 结果 ---------- */
.art .win { position: absolute; left: 8%; top: 14%; width: 62%; height: 60%; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); overflow: hidden; }
.art .win::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.art .ctl { position: absolute; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.art .ctl--target { display: grid; place-items: center; color: var(--txt); font-size: 12px; }
.art .cursor { position: absolute; left: 62%; top: 33%; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 16px solid #fff; transform-origin: top; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); z-index: 2; }
@keyframes cursor-move {
  0%, 12% { transform: translate(-120px, 60px); opacity: 0; }
  20% { opacity: 1; }
  40%, 78% { transform: translate(0, 0); opacity: 1; }
  88%, 100% { opacity: 0; }
}
@keyframes press {
  0%, 38% { background: rgba(255, 255, 255, 0.05); border-color: var(--line); box-shadow: none; }
  44%, 52% { background: var(--c-soft); border-color: var(--accent); box-shadow: 0 0 18px var(--c-soft); }
  60%, 100% { background: rgba(255, 255, 255, 0.05); border-color: var(--line); box-shadow: none; }
}
.art .a-cursor { animation: cursor-move var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .ctl--target { animation: press var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .result { position: absolute; left: 58%; top: 52%; padding: 6px 12px; border-radius: 8px; background: rgba(107, 227, 160, 0.14); border: 1px solid rgba(107, 227, 160, 0.5); color: #6be3a0; font-size: 12px; font-weight: 600; z-index: 3; }
@keyframes result-in { 0%, 50% { opacity: 0; transform: translateY(8px); } 58%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.art .a-result { animation: result-in var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }

/* 截屏 → 看懂 → 点中：三个标签依次亮起 */
.art .pipeline { position: absolute; right: 8%; top: 22%; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.art .pipeline span { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--dim); border: 1px solid var(--line); }
.art .pipeline .p-arrow { width: 14px; height: 14px; border-radius: 50%; background: var(--c); margin-left: 8px; }
@keyframes p1-on { 0%, 8% { color: var(--dim); border-color: var(--line); } 12%, 80% { color: var(--txt); border-color: rgba(79, 195, 247, 0.6); background: var(--c-soft); } 92%, 100% { color: var(--dim); border-color: var(--line); } }
@keyframes p2-on { 0%, 22% { color: var(--dim); border-color: var(--line); } 26%, 80% { color: var(--txt); border-color: rgba(79, 195, 247, 0.6); background: var(--c-soft); } 92%, 100% { color: var(--dim); border-color: var(--line); } }
@keyframes p3-on { 0%, 36% { color: var(--dim); border-color: var(--line); } 40%, 80% { color: var(--txt); border-color: rgba(79, 195, 247, 0.6); background: var(--c-soft); } 92%, 100% { color: var(--dim); border-color: var(--line); } }
.art .p1 { animation: p1-on var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .p2 { animation: p2-on var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .p3 { animation: p3-on var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .p-arrow.a-arrow1 { animation: p2-on var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
.art .p-arrow.a-arrow2 { animation: p3-on var(--loop) cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }

/* ---------- 首屏演示卡：进度条走动（循环 9 秒，与打字大致同步） ---------- */
.d-bar i.d-fill { animation: dfill 9s cubic-bezier(0.22, 0.8, 0.24, 1) infinite both; }
@keyframes dfill { 0% { width: 0; } 55% { width: 100%; } 100% { width: 100%; } }

/* 窄屏：语音段句子与卡片缩一点，别溢出 */
@media (max-width: 700px) {
  .art .vs-cards { grid-template-columns: 1fr; }
  .art .a-type { white-space: normal; }
}

/* ---------- 减少动态效果：不动，停在最终画面 ---------- */
@media (prefers-reduced-motion: reduce) {
  .art *, .art *::before, .art *::after { animation: none !important; }
  .art .a-talk { opacity: 1 !important; transform: none !important; }
  .art .a-mic { opacity: 0.3 !important; color: var(--dim) !important; }
  .art .a-type { clip-path: inset(0 0 0 0) !important; }
  .art .vs-mic { box-shadow: 0 0 18px rgba(79, 195, 247, 0.4); }
  .art .lane .bar i { width: 100% !important; }
  .art .lane__done, .art .badge { opacity: 1 !important; transform: none !important; }
  .art .badge { transform: translateX(-50%) !important; }
  .art .a-cursor { opacity: 0 !important; }
  .art .ctl--target { box-shadow: none; }
  .art .result { opacity: 1 !important; transform: none !important; }
  .art .pipeline span { color: var(--txt) !important; border-color: rgba(79, 195, 247, 0.6) !important; }
  .d-bar i.d-fill { width: 100% !important; animation: none; }
  .d-caret { display: none; }
}
