:root {
    --bg-1: #07111f;
    --bg-2: #071a2f;
    --bg-3: #0d2945;
    --panel: rgba(7, 18, 35, 0.72);
    --line: rgba(130, 214, 255, 0.22);
    --text: #e9f7ff;
    --muted: #7fa3bc;
    --cyan: #5ff0ff;
    --blue: #55a9ff;
    --mint: #78ffc8;
    --gold: #ffd36e;
    --glow: rgba(95, 240, 255, 0.45);
    --avatar-tilt-x: 0deg;
    --avatar-tilt-y: 0deg;
    --eye-shift-x: 0px;
    --eye-shift-y: 0px;
    --talk-scale: 1;
    --mode-color: var(--cyan);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(95, 240, 255, 0.08), transparent 30%),
        radial-gradient(circle at 20% 20%, rgba(85, 169, 255, 0.16), transparent 24%),
        radial-gradient(circle at 80% 10%, rgba(120, 255, 200, 0.12), transparent 24%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background-image:
        linear-gradient(rgba(120, 200, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 200, 255, 0.05) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at center, black 42%, transparent 84%);
}

body::after {
    background: radial-gradient(circle at center, transparent 0 58%, rgba(95, 240, 255, 0.08) 70%, transparent 78%);
    animation: rotate-bg 22s linear infinite;
}

.page {
    position: relative;
    min-height: 100vh;
    padding: 16px 28px 28px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand::before {
    content: "";
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    background: url("../image.png") center / contain no-repeat;
    filter: none;
}

.brand-logo {
    display: none;
}

.brand h1 {
    margin: 0;
    font-size: clamp(24px, 3.2vw, 38px);
    letter-spacing: 0.06em;
}

.brand p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.task-tag {
    padding: 10px 18px;
    border: 1px solid rgba(95, 240, 255, 0.25);
    border-radius: 999px;
    background: rgba(9, 22, 38, 0.6);
    color: var(--cyan);
    font-size: 13px;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.layout {
    display: grid;
    grid-template-columns: 300px minmax(560px, 1fr) 360px;
    gap: 20px;
    min-height: 0;
    align-items: stretch;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
    pointer-events: none;
}

.panel-inner {
    position: relative;
    height: 100%;
    padding: 24px;
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.left-panel .panel-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-panel .panel-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.16em;
    color: var(--cyan);
}

.stage-panel {
    min-height: 680px;
}

.stage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.stage-head h2 {
    margin: 4px 0 8px;
    font-size: clamp(26px, 3vw, 40px);
}

.stage-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.status-pill {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.3);
    color: var(--mode-color);
    background: rgba(12, 24, 42, 0.8);
    box-shadow: inset 0 0 18px rgba(95, 240, 255, 0.08);
    white-space: nowrap;
}

.stage-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.intro-skip-btn {
    padding: 10px 16px;
    border: 1px solid rgba(95, 240, 255, 0.5);
    border-radius: 999px;
    background: rgba(95, 240, 255, 0.12);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.intro-skip-btn:hover,
.intro-skip-btn:focus-visible {
    background: rgba(95, 240, 255, 0.22);
    border-color: var(--cyan);
}

.intro-skip-btn[hidden] {
    display: none;
}

.avatar-stage {
    position: relative;
    height: 560px;
    border-radius: 30px;
    border: 1px solid rgba(95, 240, 255, 0.16);
    background:
        radial-gradient(circle at 50% 22%, rgba(85, 169, 255, 0.18), transparent 22%),
        radial-gradient(circle at 50% 70%, rgba(95, 240, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(7, 20, 34, 0.7), rgba(5, 13, 25, 0.94));
    overflow: hidden;
    isolation: isolate;
}

.avatar-stage::before,
.avatar-stage::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    pointer-events: none;
}

.avatar-stage::before {
    bottom: 42px;
    width: 360px;
    height: 70px;
    background: radial-gradient(circle, rgba(95, 240, 255, 0.4), rgba(95, 240, 255, 0.04) 60%, transparent 72%);
    filter: blur(10px);
}

.avatar-stage::after {
    inset: 0;
    background:
        linear-gradient(transparent, rgba(95, 240, 255, 0.08), transparent),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 2px, transparent 2px, transparent 8px);
    mix-blend-mode: screen;
    animation: scan-move 7s linear infinite;
    opacity: 0.5;
}

.ring,
.ring::before,
.ring::after {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(95, 240, 255, 0.16);
}

.ring {
    width: 420px;
    height: 420px;
    animation: spin 18s linear infinite;
    box-shadow: 0 0 60px rgba(95, 240, 255, 0.08);
}

.ring::before,
.ring::after {
    content: "";
    inset: 20px;
}

.ring::before {
    border-style: dashed;
    animation: spin-reverse 16s linear infinite;
}

.ring::after {
    inset: -22px;
    border-color: rgba(120, 255, 200, 0.22);
    animation: pulse-ring 4s ease-in-out infinite;
}

.ring-b {
    width: 520px;
    height: 520px;
    border-color: rgba(85, 169, 255, 0.15);
    animation-duration: 28s;
}

.ring-c {
    width: 300px;
    height: 300px;
    top: 48%;
    border-color: rgba(255, 211, 110, 0.14);
    animation-duration: 13s;
}

.particles span {
    position: absolute;
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(95, 240, 255, 0.9);
    box-shadow: 0 0 18px rgba(95, 240, 255, 0.9);
    animation: particle-float 12s linear infinite;
}

.particles span:nth-child(1) { left: 18%; top: 78%; animation-delay: -2s; }
.particles span:nth-child(2) { left: 24%; top: 30%; animation-delay: -6s; width: 5px; height: 5px; }
.particles span:nth-child(3) { left: 34%; top: 18%; animation-delay: -1s; }
.particles span:nth-child(4) { left: 67%; top: 20%; animation-delay: -4s; width: 6px; height: 6px; }
.particles span:nth-child(5) { left: 72%; top: 76%; animation-delay: -9s; }
.particles span:nth-child(6) { left: 82%; top: 54%; animation-delay: -7s; width: 5px; height: 5px; }

.avatar {
    position: absolute;
    left: 50%;
    top: 53%;
    width: 330px;
    height: 470px;
    transform: translate(-50%, -50%) rotateX(var(--avatar-tilt-x)) rotateY(var(--avatar-tilt-y));
    transform-style: preserve-3d;
    animation: avatar-float 5.5s ease-in-out infinite;
    filter: drop-shadow(0 0 38px rgba(95, 240, 255, 0.26));
}

.avatar * {
    position: absolute;
}

.avatar .beam {
    left: 50%;
    bottom: 32px;
    width: 180px;
    height: 280px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(95, 240, 255, 0), rgba(95, 240, 255, 0.2), rgba(95, 240, 255, 0));
    filter: blur(8px);
    opacity: 0.8;
}

.avatar .head {
    left: 50%;
    top: 36px;
    width: 148px;
    height: 172px;
    transform: translateX(-50%);
    border-radius: 44% 44% 38% 38% / 34% 34% 50% 50%;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.75), rgba(120, 220, 255, 0.28) 22%, rgba(13, 30, 50, 0.85) 60%),
        linear-gradient(180deg, rgba(79, 169, 255, 0.28), rgba(7, 21, 38, 0.92));
    border: 1px solid rgba(95, 240, 255, 0.42);
    box-shadow: 0 0 24px rgba(95, 240, 255, 0.25), inset 0 0 28px rgba(95, 240, 255, 0.18);
}

.avatar .head::before {
    content: "";
    inset: 16px 22px auto;
    height: 36px;
    border-radius: 18px;
    background: linear-gradient(90deg, transparent, rgba(95, 240, 255, 0.35), transparent);
    filter: blur(2px);
}

.avatar .crown {
    left: 50%;
    top: 0;
    width: 180px;
    height: 44px;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 1px solid rgba(120, 255, 200, 0.3);
    box-shadow: 0 0 30px rgba(120, 255, 200, 0.12);
    animation: hover-pulse 3.4s ease-in-out infinite;
}

.avatar .face-grid {
    left: 50%;
    top: 72px;
    width: 94px;
    height: 54px;
    transform: translateX(-50%);
    border-radius: 18px;
    border: 1px solid rgba(95, 240, 255, 0.24);
    background:
        repeating-linear-gradient(90deg, rgba(95, 240, 255, 0.09), rgba(95, 240, 255, 0.09) 1px, transparent 1px, transparent 12px),
        repeating-linear-gradient(180deg, rgba(95, 240, 255, 0.08), rgba(95, 240, 255, 0.08) 1px, transparent 1px, transparent 10px),
        rgba(5, 15, 28, 0.8);
    overflow: hidden;
}

.avatar .eyes {
    left: 50%;
    top: 88px;
    width: 96px;
    height: 22px;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
}

.avatar .eye {
    position: relative;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: rgba(11, 32, 54, 0.88);
    border: 1px solid rgba(95, 240, 255, 0.25);
    overflow: hidden;
    animation: blink 7s infinite;
}

.avatar .eye::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translate(calc(-50% + var(--eye-shift-x)), calc(-50% + var(--eye-shift-y)));
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(95, 240, 255, 0.85) 42%, rgba(95, 240, 255, 0.2) 72%);
    box-shadow: 0 0 12px rgba(95, 240, 255, 0.9);
}

.avatar .mouth {
    left: 50%;
    top: 130px;
    width: 46px;
    height: 8px;
    transform: translateX(-50%) scaleY(var(--talk-scale));
    transform-origin: center;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--mode-color), transparent);
    box-shadow: 0 0 16px rgba(95, 240, 255, 0.4);
    transition: transform 0.22s ease, background 0.22s ease;
}

.avatar .neck {
    left: 50%;
    top: 184px;
    width: 34px;
    height: 30px;
    transform: translateX(-50%);
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, rgba(95, 240, 255, 0.35), rgba(95, 240, 255, 0.04));
}

.avatar .torso {
    left: 50%;
    top: 206px;
    width: 188px;
    height: 192px;
    transform: translateX(-50%);
    clip-path: polygon(22% 0%, 78% 0%, 100% 24%, 84% 100%, 16% 100%, 0% 24%);
    background:
        linear-gradient(180deg, rgba(110, 208, 255, 0.22), rgba(7, 20, 36, 0.88) 62%),
        rgba(6, 16, 30, 0.94);
    border: 1px solid rgba(95, 240, 255, 0.28);
    box-shadow: inset 0 0 28px rgba(95, 240, 255, 0.15);
}

.avatar .torso::before,
.avatar .torso::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
}

.avatar .torso::before {
    top: 28px;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(95, 240, 255, 0.28);
    box-shadow: 0 0 22px rgba(95, 240, 255, 0.24), inset 0 0 16px rgba(95, 240, 255, 0.1);
}

.avatar .torso::after {
    top: 50px;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(95, 240, 255, 0.85), rgba(95, 240, 255, 0.1));
    box-shadow: 0 0 24px rgba(95, 240, 255, 0.9);
    animation: core-pulse 2.2s ease-in-out infinite;
}

.avatar .torso-lines {
    left: 50%;
    top: 244px;
    width: 128px;
    height: 130px;
    transform: translateX(-50%);
    background:
        linear-gradient(90deg, transparent 0 16%, rgba(95, 240, 255, 0.22) 16% 18%, transparent 18% 32%, rgba(95, 240, 255, 0.18) 32% 34%, transparent 34% 66%, rgba(95, 240, 255, 0.18) 66% 68%, transparent 68% 82%, rgba(95, 240, 255, 0.22) 82% 84%, transparent 84% 100%),
        linear-gradient(180deg, transparent 0 18%, rgba(95, 240, 255, 0.16) 18% 20%, transparent 20% 46%, rgba(95, 240, 255, 0.12) 46% 48%, transparent 48% 100%);
    opacity: 0.9;
}

.avatar .arm {
    top: 220px;
    width: 48px;
    height: 174px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(92, 199, 255, 0.24), rgba(5, 16, 30, 0.9));
    border: 1px solid rgba(95, 240, 255, 0.18);
}

.avatar .arm.left {
    left: 48px;
    transform: rotate(14deg);
}

.avatar .arm.right {
    right: 48px;
    transform: rotate(-14deg);
}

.avatar .arm::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -14px;
    width: 26px;
    height: 26px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(95, 240, 255, 0.8), rgba(95, 240, 255, 0.1));
    box-shadow: 0 0 16px rgba(95, 240, 255, 0.8);
}

.avatar .waist {
    left: 50%;
    bottom: 48px;
    width: 126px;
    height: 74px;
    transform: translateX(-50%);
    border-radius: 26px 26px 34px 34px;
    border: 1px solid rgba(95, 240, 255, 0.22);
    background: linear-gradient(180deg, rgba(95, 240, 255, 0.18), rgba(7, 18, 32, 0.9));
}

.avatar .waist::before,
.avatar .waist::after {
    content: "";
    position: absolute;
    top: 18px;
    width: 30px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(95, 240, 255, 0.22), rgba(4, 14, 28, 0.95));
    border: 1px solid rgba(95, 240, 255, 0.16);
}

.avatar .waist::before {
    left: 14px;
    transform: rotate(8deg);
}

.avatar .waist::after {
    right: 14px;
    transform: rotate(-8deg);
}

.speech-bubble {
    position: absolute;
    right: 34px;
    top: 42px;
    max-width: 300px;
    max-height: 360px;
    padding: 18px 18px 20px;
    border-radius: 20px 20px 20px 6px;
    border: 1px solid rgba(95, 240, 255, 0.22);
    background: rgba(6, 16, 30, 0.7);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 3;
}

.speech-bubble::before {
    content: "";
    position: absolute;
    left: 28px;
    bottom: -10px;
    width: 18px;
    height: 18px;
    background: inherit;
    border-right: 1px solid rgba(95, 240, 255, 0.22);
    border-bottom: 1px solid rgba(95, 240, 255, 0.22);
    transform: rotate(45deg);
}

.speech-bubble h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--mode-color);
    letter-spacing: 0.1em;
}

.speech-bubble #bubbleText {
    margin: 0;
    line-height: 1.8;
    color: #d8efff;
    min-height: 0;
    max-height: 270px;
    overflow: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
    white-space: pre-wrap;
}

.speech-bubble #bubbleText.is-streaming::after {
    content: "|";
    margin-left: 4px;
    color: var(--mode-color);
    animation: cursor-flash 0.8s steps(1) infinite;
}

.floor-data {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    z-index: 3;
}

.floor-card,
.info-card,
.control-card,
.preview-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(95, 240, 255, 0.14);
    background: rgba(5, 14, 28, 0.46);
}

.floor-card span,
.readout-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

.floor-card strong,
.readout-item strong {
    font-size: 18px;
    color: #effbff;
}

.info-card p,
.control-card p,
.preview-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 14px;
}

.feature-list,
.experiment-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.feature-item {
    padding: 14px 14px 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background: rgba(8, 22, 38, 0.56);
}

.feature-item strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.feature-item span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.signal-cabin-card,
.challenge-card {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(95, 240, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(10, 24, 42, 0.88), rgba(5, 14, 26, 0.94)),
        rgba(5, 14, 28, 0.46);
    box-shadow: inset 0 0 24px rgba(95, 240, 255, 0.05);
}

.signal-cabin-head,
.challenge-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.signal-cabin-head strong,
.challenge-head strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    color: #f2fbff;
}

.challenge-head strong {
    font-size: 16px;
    line-height: 1.35;
}

.signal-badge,
.challenge-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.2);
    background: rgba(95, 240, 255, 0.08);
    color: var(--cyan);
    font-size: 12px;
    letter-spacing: 0.08em;
    white-space: nowrap;
    word-break: keep-all;
    writing-mode: horizontal-tb;
}

.signal-cabin-desc,
.challenge-question {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 14px;
}

.challenge-question {
    margin-top: 10px;
    line-height: 1.65;
    font-size: 13px;
}

.signal-wave-panel {
    position: relative;
    height: 170px;
    margin-top: 16px;
    border-radius: 20px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background:
        radial-gradient(circle at 20% 20%, rgba(95, 240, 255, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(6, 17, 30, 0.94), rgba(4, 10, 20, 0.98));
    overflow: hidden;
}

.signal-wave-grid,
.signal-wave-track,
.signal-rain {
    position: absolute;
    inset: 0;
}

.signal-wave-grid {
    background-image:
        linear-gradient(rgba(120, 200, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 200, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, transparent, black 12%, black 88%, transparent);
}

.signal-wave-track {
    inset: 18px 14px;
}

.wave-line {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 34px;
    opacity: 0.9;
    background-repeat: repeat-x;
    background-size: 180px 34px;
    filter: drop-shadow(0 0 8px rgba(95, 240, 255, 0.24));
}

.wave-line-a {
    top: 18px;
    background-image:
        linear-gradient(90deg, transparent 0 6%, rgba(95, 240, 255, 0.94) 6% 16%, transparent 16% 22%, rgba(95, 240, 255, 0.94) 22% 44%, transparent 44% 52%, rgba(95, 240, 255, 0.94) 52% 62%, transparent 62% 100%);
    animation: wave-move 5.4s linear infinite;
}

.wave-line-b {
    top: 68px;
    background-image:
        linear-gradient(90deg, transparent 0 12%, rgba(120, 255, 200, 0.9) 12% 18%, transparent 18% 34%, rgba(120, 255, 200, 0.9) 34% 56%, transparent 56% 62%, rgba(120, 255, 200, 0.9) 62% 68%, transparent 68% 100%);
    animation: wave-move 6.6s linear infinite reverse;
}

.wave-line-c {
    top: 118px;
    background-image:
        linear-gradient(90deg, transparent 0 8%, rgba(255, 211, 110, 0.92) 8% 14%, transparent 14% 28%, rgba(255, 211, 110, 0.92) 28% 34%, transparent 34% 58%, rgba(255, 211, 110, 0.92) 58% 82%, transparent 82% 100%);
    animation: wave-move 7.4s linear infinite;
}

.signal-rain {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 12px 10px;
    pointer-events: none;
}

.signal-rain span {
    font-size: 13px;
    color: rgba(95, 240, 255, 0.72);
    text-shadow: 0 0 10px rgba(95, 240, 255, 0.3);
    animation: rain-drop 6.4s linear infinite;
}

.signal-rain span:nth-child(2n) {
    color: rgba(120, 255, 200, 0.58);
    animation-duration: 7.2s;
}

.signal-rain span:nth-child(3n) {
    color: rgba(255, 211, 110, 0.62);
    animation-duration: 8.1s;
}

.signal-rain span:nth-child(2) { animation-delay: -1.1s; }
.signal-rain span:nth-child(3) { animation-delay: -2.2s; }
.signal-rain span:nth-child(4) { animation-delay: -3.2s; }
.signal-rain span:nth-child(5) { animation-delay: -1.8s; }
.signal-rain span:nth-child(6) { animation-delay: -4.4s; }
.signal-rain span:nth-child(7) { animation-delay: -2.7s; }
.signal-rain span:nth-child(8) { animation-delay: -5.1s; }

.signal-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.signal-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background: rgba(8, 21, 37, 0.72);
}

.signal-metric span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
}

.signal-metric strong {
    color: #f3fbff;
    font-size: 14px;
}

.challenge-card {
    position: relative;
    overflow: hidden;
    margin-top: 42px;
}

.challenge-card {
    padding: 14px 16px;
    border-radius: 20px;
}

.challenge-card .section-title {
    margin-bottom: 6px;
}

.challenge-card::before {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(95, 240, 255, 0.14), transparent 68%);
    pointer-events: none;
}

.challenge-clues {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.challenge-clues span {
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.14);
    background: rgba(95, 240, 255, 0.08);
    color: #d8f6ff;
    font-size: 11px;
}

.challenge-answer {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(120, 255, 200, 0.14);
    background: rgba(9, 25, 26, 0.72);
    color: #dcfff2;
    line-height: 1.8;
    font-size: 14px;
}

.challenge-answer.is-hidden {
    display: none;
}

.challenge-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.challenge-actions button {
    flex: 1;
    border: 1px solid rgba(95, 240, 255, 0.18);
    border-radius: 12px;
    background: rgba(8, 21, 37, 0.82);
    color: var(--text);
    padding: 10px 12px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.challenge-actions button:hover {
    transform: translateY(-2px);
    border-color: rgba(95, 240, 255, 0.42);
    box-shadow: 0 10px 24px rgba(95, 240, 255, 0.12);
}

.experiment-card,
.action-btn {
    width: 100%;
    border: 1px solid rgba(95, 240, 255, 0.18);
    border-radius: 18px;
    background: rgba(8, 21, 37, 0.78);
    color: var(--text);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.experiment-card:hover,
.experiment-card.active,
.action-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(95, 240, 255, 0.46);
    box-shadow: 0 10px 24px rgba(95, 240, 255, 0.12);
}

.experiment-card.active {
    background:
        linear-gradient(135deg, rgba(95, 240, 255, 0.14), rgba(8, 21, 37, 0.82)),
        rgba(8, 21, 37, 0.78);
}

.experiment-card strong,
.action-btn strong {
    display: block;
    font-size: 17px;
    margin-bottom: 6px;
}

.experiment-card em {
    display: block;
    font-style: normal;
    color: var(--mode-color);
    font-size: 13px;
    margin-bottom: 10px;
}

.experiment-card p,
.action-btn span {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.experiment-tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.18);
    color: var(--cyan);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-head strong {
    font-size: 20px;
}

.preview-head span {
    color: var(--mode-color);
    font-size: 13px;
}

.preview-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.preview-points span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(95, 240, 255, 0.08);
    border: 1px solid rgba(95, 240, 255, 0.12);
    color: #dcf8ff;
    font-size: 12px;
}

.action-group {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.readout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.readout-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(4, 13, 24, 0.55);
    border: 1px solid rgba(95, 240, 255, 0.12);
}

.readout-item strong {
    color: var(--mode-color);
}

.signature {
    margin-top: auto;
    padding-top: 8px;
    color: rgba(233, 247, 255, 0.5);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.assistant-inline-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(95, 240, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(10, 24, 42, 0.82), rgba(6, 15, 28, 0.9)),
        rgba(5, 14, 28, 0.46);
    box-shadow: inset 0 0 24px rgba(95, 240, 255, 0.04);
    min-height: 600px;
}

.assistant-inline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.assistant-inline-head h3 {
    margin: 4px 0 8px;
    font-size: 24px;
}

.assistant-inline-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.assistant-inline-status {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.2);
    background: rgba(8, 21, 37, 0.74);
    color: var(--cyan);
    white-space: nowrap;
}

.assistant-inline-box {
    display: grid;
    gap: 14px;
}

.assistant-inline-log,
.assistant-inline-input {
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background: rgba(7, 18, 32, 0.62);
}

.assistant-inline-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 560px;
    height: clamp(560px, 64vh, 760px);
    max-height: 760px;
    overflow: auto;
    padding-right: 10px;
    scrollbar-gutter: stable both-edges;
}

.assistant-inline-message + .assistant-inline-message {
    margin-top: 0;
}

.assistant-inline-message {
    display: flex;
    flex-direction: column;
    max-width: min(86%, 720px);
}

.assistant-inline-message.assistant {
    align-items: flex-start;
    margin-right: auto;
}

.assistant-inline-message.user {
    align-items: flex-end;
    margin-left: auto;
}

.assistant-inline-message.user .assistant-inline-role {
    color: var(--gold);
    border-color: rgba(255, 211, 110, 0.22);
    background: rgba(255, 211, 110, 0.08);
}

.assistant-inline-role {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.18);
    color: var(--cyan);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.assistant-inline-message > :is(p, .assistant-message-content) {
    margin: 0;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background: rgba(7, 23, 40, 0.88);
    color: #d8efff;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.assistant-inline-message.user p {
    background: linear-gradient(135deg, rgba(255, 211, 110, 0.18), rgba(35, 23, 8, 0.92));
    border-color: rgba(255, 211, 110, 0.18);
    color: #fff6dc;
    border-top-right-radius: 8px;
}

.assistant-inline-message.assistant > :is(p, .assistant-message-content) {
    background: linear-gradient(135deg, rgba(95, 240, 255, 0.12), rgba(6, 18, 32, 0.96));
    border-color: rgba(95, 240, 255, 0.14);
    border-top-left-radius: 8px;
}

.assistant-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.assistant-inline-meta span {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(95, 240, 255, 0.12);
    background: rgba(4, 13, 24, 0.6);
    color: var(--muted);
    font-size: 12px;
}

.assistant-inline-input textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    border: 1px solid rgba(95, 240, 255, 0.14);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(4, 13, 24, 0.8);
    font: inherit;
}

.assistant-inline-input textarea:focus {
    outline: none;
    border-color: rgba(95, 240, 255, 0.34);
    box-shadow: 0 0 0 3px rgba(95, 240, 255, 0.08);
}

.assistant-inline-suggestions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(95, 240, 255, 0.12);
}

.suggestions-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.assistant-inline-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 20px;
}

.assistant-inline-suggestions:empty {
    display: none;
}

.assistant-suggestion-chip {
    border: 1px solid rgba(95, 240, 255, 0.18);
    border-radius: 999px;
    background: rgba(7, 24, 40, 0.82);
    color: #d8f8ff;
    padding: 6px 12px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.assistant-suggestion-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(95, 240, 255, 0.42);
    box-shadow: 0 10px 24px rgba(95, 240, 255, 0.1);
}

.assistant-inline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.input-hint-text {
    font-size: 12px;
    color: rgba(233, 247, 255, 0.4);
    letter-spacing: 0.04em;
}

.actions-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.assistant-inline-actions button {
    border: 1px solid rgba(95, 240, 255, 0.18);
    border-radius: 12px;
    background: rgba(8, 21, 37, 0.82);
    color: var(--text);
    padding: 10px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.assistant-inline-actions button:hover {
    transform: translateY(-2px);
    border-color: rgba(95, 240, 255, 0.42);
    box-shadow: 0 10px 24px rgba(95, 240, 255, 0.12);
}

.assistant-inline-actions button.secondary {
    color: var(--cyan);
}

.assistant-inline-actions .primary-send-btn {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: rgba(95, 240, 255, 0.45) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    padding: 10px 18px !important;
}

.assistant-inline-actions .primary-send-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55) !important;
}

.assistant-inline-actions button.is-listening {
    border-color: rgba(255, 211, 110, 0.5);
    color: #fff6dc;
    background: linear-gradient(135deg, rgba(255, 211, 110, 0.18), rgba(36, 24, 8, 0.92));
    box-shadow: 0 0 0 1px rgba(255, 211, 110, 0.14), 0 10px 24px rgba(255, 211, 110, 0.12);
}

.assistant-inline-log,
.speech-bubble #bubbleText {
    scrollbar-width: thin;
    scrollbar-color: rgba(95, 240, 255, 0.34) rgba(6, 17, 29, 0.82);
}

.assistant-inline-log::-webkit-scrollbar,
.speech-bubble #bubbleText::-webkit-scrollbar {
    width: 10px;
}

.assistant-inline-log::-webkit-scrollbar-track,
.speech-bubble #bubbleText::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(6, 17, 29, 0.82);
}

.assistant-inline-log::-webkit-scrollbar-thumb,
.speech-bubble #bubbleText::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid rgba(6, 17, 29, 0.9);
    background: linear-gradient(180deg, rgba(95, 240, 255, 0.38), rgba(85, 169, 255, 0.48));
}

.assistant-inline-log::-webkit-scrollbar-thumb:hover,
.speech-bubble #bubbleText::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(120, 255, 200, 0.44), rgba(95, 240, 255, 0.56));
}

.assistant-inline-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.tips-chip {
    border: 1px solid rgba(95, 240, 255, 0.16);
    border-radius: 999px;
    background: rgba(95, 240, 255, 0.08);
    color: #dcf8ff;
    padding: 10px 14px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tips-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(95, 240, 255, 0.42);
    box-shadow: 0 10px 24px rgba(95, 240, 255, 0.1);
}

.mode-standby {
    --mode-color: var(--cyan);
}

.mode-guide {
    --mode-color: var(--mint);
}

.mode-speaking {
    --mode-color: var(--gold);
}

.avatar-stage {
    background:
        radial-gradient(circle at 50% 22%, rgba(85, 169, 255, 0.18), transparent 22%),
        radial-gradient(circle at 50% 70%, rgba(95, 240, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(7, 20, 34, 0.7), rgba(5, 13, 25, 0.94));
}

.avatar-stage::before {
    bottom: 42px;
    width: 360px;
    height: 70px;
    background: radial-gradient(circle, rgba(95, 240, 255, 0.4), rgba(95, 240, 255, 0.04) 60%, transparent 72%);
}

.ring {
    left: 50%;
    top: 52%;
    opacity: 1;
}

.ring-b {
    left: 50%;
    top: 52%;
    opacity: 1;
}

.ring-c {
    left: 50%;
    top: 48%;
    opacity: 1;
}

.speech-bubble {
    top: 42px;
    left: auto;
    right: 34px;
    max-width: 300px;
}

.speech-bubble::before {
    left: 28px;
    right: auto;
}

.avatar {
    left: 50%;
    top: 51%;
    width: 330px;
    height: 470px;
    filter: drop-shadow(0 0 38px rgba(95, 240, 255, 0.26));
}


@keyframes rotate-bg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scan-move {
    0% { transform: translateY(-36%); }
    50% { transform: translateY(36%); }
    100% { transform: translateY(-36%); }
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.45; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes particle-float {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-140px) scale(1.25); opacity: 0; }
}

@keyframes avatar-float {
    0%, 100% { transform: translate(-50%, -50%) rotateX(var(--avatar-tilt-x)) rotateY(var(--avatar-tilt-y)) translateY(0); }
    50% { transform: translate(-50%, -50%) rotateX(var(--avatar-tilt-x)) rotateY(var(--avatar-tilt-y)) translateY(-16px); }
}

@keyframes hover-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
    50% { transform: translateX(-50%) scale(1.08); opacity: 1; }
}

@keyframes blink {
    0%, 45%, 47%, 100% { transform: scaleY(1); }
    46% { transform: scaleY(0.12); }
}

@keyframes core-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.22); }
}

@keyframes cursor-flash {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes wave-move {
    from { transform: translateX(0); }
    to { transform: translateX(-180px); }
}

@keyframes rain-drop {
    0% {
        transform: translateY(-16px);
        opacity: 0;
    }
    16% {
        opacity: 1;
    }
    100% {
        transform: translateY(176px);
        opacity: 0;
    }
}

@media (max-width: 1380px) {
    .layout {
        grid-template-columns: 280px minmax(520px, 1fr) 330px;
    }
}

@media (max-width: 1160px) {
    .page {
        overflow: visible;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .stage-panel {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    .page {
        padding: 18px;
    }

    .topbar,
    .stage-head,
    .preview-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .speech-bubble {
        position: relative;
        top: auto;
        right: auto;
        margin: 18px;
        max-width: none;
    }

    .avatar-stage {
        height: 640px;
    }

    .avatar {
        width: 280px;
    }

    .floor-data,
    .readout {
        grid-template-columns: 1fr;
    }

    .assistant-inline-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
