/* ==========================================
   黎明魔方 - CSS 霓虹暗黑设计系统
   ========================================== */

:root {
    --bg-color: #08090f;
    --panel-bg: rgba(13, 17, 26, 0.75);
    --panel-border: rgba(0, 240, 255, 0.15);
    --panel-border-glow: rgba(0, 240, 255, 0.05);

    /* 霓虹色库 */
    --neon-blue: #00f0ff;
    --neon-green: #00ff88;
    --neon-purple: #bd00ff;
    --neon-red: #ff0055;
    --neon-yellow: #ffb700;
    --text-color: #e2e8f0;
    --text-dim: #718096;
    --ease-decisive: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-natural: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --motion-fast: 0.16s;
    --motion-base: 0.22s;
    --motion-slow: 0.5s;
    --font-ui: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-title: 'Orbitron', 'Noto Sans SC', sans-serif;
    --font-data: 'Oxanium', 'Orbitron', 'Noto Sans SC', monospace;
    --space-panel: clamp(0.75rem, 0.52rem + 0.7vw, 1.35rem);
    --space-control: clamp(0.5rem, 0.35rem + 0.45vw, 0.9rem);
}

.loading-overlay,
.archive-overlay,
.credits-overlay {
    z-index: 1310;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 2vw, 2.5rem);
    background:
        radial-gradient(circle at 18% 20%, rgba(0, 240, 255, 0.14), transparent 32%),
        radial-gradient(circle at 78% 72%, rgba(255, 0, 85, 0.12), transparent 36%),
        rgba(0, 2, 8, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--ease-decisive);
}

.loading-overlay.active,
.archive-overlay.active,
.credits-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bullet-time-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 48%, transparent 28%, rgba(0, 240, 255, 0.16) 62%, rgba(0, 6, 20, 0.42) 100%),
        linear-gradient(115deg, rgba(0, 240, 255, 0.08), transparent 34%, rgba(70, 90, 255, 0.1));
    box-shadow:
        inset 0 0 clamp(3rem, 9vw, 9rem) rgba(0, 240, 255, 0.18),
        inset 0 0 clamp(5rem, 14vw, 14rem) rgba(0, 32, 90, 0.42);
    mix-blend-mode: screen;
    transform: scale(1.02);
    transition:
        opacity var(--motion-fast) var(--ease-decisive),
        transform var(--motion-base) var(--ease-decisive);
}

.bullet-time-overlay.active {
    opacity: 1;
    transform: scale(1);
    animation: bullet-time-breathe 1.15s var(--ease-natural) infinite alternate;
}

body.page-hidden-motion-paused *,
body.page-hidden-motion-paused *::before,
body.page-hidden-motion-paused *::after {
    animation-play-state: paused !important;
}

body.low-power-mode .crt-scanlines,
body.low-power-mode .title-creature,
body.low-power-mode .bullet-time-overlay,
body.low-power-mode .wire-cube,
body.low-power-mode .tutorial-look-gesture,
body.low-power-mode .gesture-hand-svg,
body.low-power-mode .float-bubble-badge {
    animation-play-state: paused !important;
}

@keyframes bullet-time-breathe {
    from {
        filter: saturate(125%) brightness(1);
    }
    to {
        filter: saturate(180%) brightness(1.18);
    }
}

.loading-panel,
.archive-room,
.credits-terminal {
    width: min(58rem, 94vw);
    max-height: min(46rem, 88vh);
    overflow: auto;
    padding: clamp(1rem, 0.72rem + 1.3vw, 2rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 34%),
        rgba(2, 8, 15, 0.82);
    box-shadow:
        0 clamp(1.2rem, 0.8rem + 2vw, 3rem) clamp(2rem, 1rem + 4vw, 5rem) rgba(0, 0, 0, 0.62),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.loading-panel h2,
.archive-room h2 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(1.6rem, 1.15rem + 2vw, 3rem);
    color: #e8fbff;
}

.loading-log {
    min-height: clamp(7rem, 15vw, 11rem);
    margin-block: clamp(1rem, 0.75rem + 1vw, 1.6rem);
    padding: clamp(0.8rem, 0.6rem + 0.8vw, 1.2rem);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: clamp(0.55rem, 0.4rem + 0.5vw, 0.8rem);
    background: rgba(0, 8, 12, 0.72);
    color: rgba(199, 255, 222, 0.92);
    font-family: var(--font-data);
    line-height: 1.7;
}

.loading-progress {
    height: clamp(0.5rem, 0.4rem + 0.45vw, 0.85rem);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.16);
}

.loading-progress i {
    display: block;
    width: var(--loading-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green), var(--neon-pink));
    box-shadow: 0 0 clamp(0.8rem, 0.5rem + 1vw, 1.6rem) rgba(0, 240, 255, 0.45);
    transition: width 0.24s var(--ease-decisive);
}

.archive-room,
.credits-terminal {
    position: relative;
}

.archive-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
    gap: clamp(0.85rem, 0.6rem + 0.9vw, 1.35rem);
    margin-top: clamp(1rem, 0.75rem + 1vw, 1.5rem);
}

.archive-room-grid section {
    border: 1px solid rgba(0, 240, 255, 0.16);
    border-radius: clamp(0.7rem, 0.5rem + 0.7vw, 1rem);
    padding: clamp(0.8rem, 0.6rem + 0.8vw, 1.2rem);
    background: rgba(3, 12, 20, 0.58);
}

.archive-room-list {
    display: grid;
    gap: clamp(0.55rem, 0.42rem + 0.45vw, 0.85rem);
}

.archive-room-item {
    padding: clamp(0.65rem, 0.5rem + 0.55vw, 0.95rem);
    border: 1px solid rgba(139, 220, 255, 0.16);
    border-radius: clamp(0.55rem, 0.4rem + 0.5vw, 0.8rem);
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.13), transparent 42%),
        rgba(0, 8, 16, 0.66);
}

.credits-terminal pre {
    margin: 0;
    color: rgba(199, 255, 222, 0.95);
    font-family: var(--font-data);
    font-size: clamp(0.85rem, 0.72rem + 0.42vw, 1.05rem);
    line-height: 1.75;
    white-space: pre-wrap;
}

.glitch-capture {
    animation: captureGlitch 0.72s var(--ease-decisive) both;
}

@keyframes captureGlitch {
    0% { filter: none; transform: translateX(0); }
    18% { filter: hue-rotate(80deg) contrast(1.8) saturate(2.1); transform: translateX(-0.35rem); }
    42% { filter: hue-rotate(-35deg) contrast(1.45) saturate(1.7); transform: translateX(0.28rem); }
    68% { filter: grayscale(0.3) contrast(1.9); transform: translateX(-0.12rem); }
    100% { filter: none; transform: translateX(0); }
}

/* 基础设置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.is-hidden {
    display: none !important;
}

/* 赛博网格背景 */
.cyber-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px),
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

.cyber-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, #08090f 90%);
}

.cyber-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(0, 240, 255, 0.045) 18% 18.2%, transparent 18.2% 82%, rgba(255, 0, 85, 0.035) 82% 82.2%, transparent 82.2%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 6px);
    opacity: 0.45;
}

.screen-flash {
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--motion-base) var(--ease-natural);
}

.screen-flash.active {
    opacity: 1;
}

.screen-flash.info {
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15), transparent 62%);
}

.screen-flash.good {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.2), transparent 64%);
}

.screen-flash.warn {
    background: radial-gradient(circle, rgba(255, 183, 0, 0.18), transparent 62%);
}

.screen-flash.danger {
    background: radial-gradient(circle, rgba(255, 0, 85, 0.2), transparent 60%);
}

.feel-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 12px);
    z-index: 1200;
    max-width: min(420px, calc(100vw - 40px));
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(5, 8, 14, 0.84);
    border: 1px solid rgba(0, 240, 255, 0.28);
    color: var(--text-color);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.18s var(--ease-decisive),
        transform 0.18s var(--ease-decisive);
}

.feel-toast.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.feel-toast.good {
    border-color: rgba(0, 255, 136, 0.42);
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.14);
}

.feel-toast.warn {
    border-color: rgba(255, 183, 0, 0.42);
    box-shadow: 0 0 18px rgba(255, 183, 0, 0.14);
}

.feel-toast.danger {
    border-color: rgba(255, 0, 85, 0.45);
    box-shadow: 0 0 18px rgba(255, 0, 85, 0.18);
}

/* ==========================================
   磨砂玻璃面板 (Glassmorphism)
   ========================================== */
.glass-panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 24%),
        var(--panel-bg);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid var(--panel-border);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.34),
        0 5px 18px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(0, 240, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -22px 42px rgba(0, 240, 255, 0.025),
        0 0 24px 0 var(--panel-border-glow);
    border-radius: 12px;
    transition:
        background 0.3s var(--ease-decisive),
        border-color 0.3s var(--ease-decisive),
        box-shadow 0.3s var(--ease-decisive),
        transform 0.3s var(--ease-decisive);
}

/* 叠层 Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 10, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-slow) var(--ease-decisive);
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.story-overlay {
    z-index: 1150;
}

.landing-overlay {
    z-index: 1080;
    background:
        radial-gradient(circle at 78% 42%, rgba(0, 240, 255, 0.08), transparent 34%),
        radial-gradient(circle at 88% 62%, rgba(189, 0, 255, 0.1), transparent 38%),
        linear-gradient(90deg, rgba(2, 4, 9, 0.9) 0%, rgba(2, 4, 9, 0.66) 36%, rgba(2, 4, 9, 0.18) 72%, rgba(2, 4, 9, 0.08) 100%);
    backdrop-filter: blur(3px) saturate(142%);
    -webkit-backdrop-filter: blur(3px) saturate(142%);
}

.landing-overlay.is-fading {
    opacity: 0;
}

.landing-overlay:not(.active) .landing-panel {
    pointer-events: none;
}

.landing-panel {
    position: fixed;
    left: clamp(1rem, 3.4vw, 4.25rem);
    top: clamp(1rem, 3.1vw, 3.75rem);
    width: min(38rem, calc(100vw - clamp(2rem, 5vw, 5rem)));
    padding: clamp(0.35rem, 0.18rem + 0.7vw, 0.9rem) 0;
    display: grid;
    gap: clamp(0.85rem, 0.58rem + 1.05vw, 1.65rem);
    justify-items: start;
    text-align: left;
    pointer-events: auto;
}

.landing-kicker {
    font-family: var(--font-data);
    font-size: clamp(0.7rem, 0.62rem + 0.25vw, 0.86rem);
    letter-spacing: 0.18em;
    color: var(--neon-blue);
    text-transform: uppercase;
}

.landing-title {
    font-family: var(--font-title);
    font-size: clamp(3.35rem, 1.65rem + 7.1vw, 8.2rem);
    line-height: 0.78;
    letter-spacing: 0;
    color: #f7fbff;
    transform: perspective(48rem) rotateX(8deg) rotateY(-18deg) skewX(-4deg);
    transform-origin: left top;
    text-shadow:
        clamp(0.08rem, 0.02rem + 0.22vw, 0.22rem) clamp(0.08rem, 0.02rem + 0.2vw, 0.2rem) 0 rgba(255, 0, 161, 0.5),
        calc(-1 * clamp(0.08rem, 0.02rem + 0.22vw, 0.22rem)) calc(-1 * clamp(0.04rem, 0.01rem + 0.14vw, 0.14rem)) 0 rgba(0, 240, 255, 0.58),
        0 0 clamp(1rem, 0.6rem + 1.4vw, 2.4rem) rgba(0, 240, 255, 0.38),
        0 0 clamp(2rem, 1.2rem + 2.6vw, 4.5rem) rgba(189, 0, 255, 0.28);
    position: relative;
    filter: drop-shadow(0 clamp(1.1rem, 0.5rem + 2vw, 2.4rem) clamp(1rem, 0.7rem + 1.4vw, 2.4rem) rgba(0, 0, 0, 0.42));
}

.landing-title-line {
    display: block;
    position: relative;
}

.title-letter {
    display: inline-grid;
    place-items: center;
    width: 0.78em;
    margin-inline: -0.03em;
    color: var(--neon-green);
    text-shadow:
        0 0 clamp(0.65rem, 0.38rem + 1vw, 1.35rem) rgba(0, 255, 136, 0.55),
        0 0 clamp(1.4rem, 0.8rem + 1.8vw, 2.9rem) rgba(0, 240, 255, 0.24);
}

.title-letter-a {
    color: var(--neon-blue);
    animation: titlePointerBlink 1.9s steps(2, jump-none) infinite;
}

.title-letter-u {
    color: var(--neon-green);
    font-size: 0.88em;
    transform: translateY(-0.02em);
}

.landing-title small {
    display: block;
    margin-top: clamp(0.55rem, 0.32rem + 0.7vw, 1rem);
    font-family: var(--font-ui);
    font-size: clamp(1.05rem, 0.72rem + 1.05vw, 1.9rem);
    font-weight: 900;
    letter-spacing: 0.16em;
    color: var(--neon-green);
    transform: skewX(4deg);
}

.title-creature {
    position: absolute;
    display: block;
    pointer-events: none;
}

.title-creature-e7 {
    left: 1.18em;
    top: -0.2em;
    width: 0.34em;
    height: 0.42em;
}

.title-creature-e7::before,
.title-creature-e7::after {
    content: '';
    position: absolute;
    top: -0.12em;
    width: 0;
    height: 0;
    border-left: 0.08em solid transparent;
    border-right: 0.08em solid transparent;
    border-bottom: 0.14em solid rgba(185, 255, 232, 0.92);
    filter: drop-shadow(0 0 0.12em rgba(0, 255, 136, 0.8));
}

.title-creature-e7::before {
    left: 0.02em;
    transform: rotate(-18deg);
}

.title-creature-e7::after {
    right: 0.02em;
    transform: rotate(18deg);
}

.title-creature-e7 i {
    position: absolute;
    inset: 0.08em 0 0;
    border-radius: 50% 50% 45% 45%;
    background:
        radial-gradient(circle at 62% 36%, rgba(255, 0, 161, 0.9) 0 0.035em, transparent 0.04em),
        radial-gradient(circle at 38% 36%, rgba(0, 240, 255, 0.9) 0 0.035em, transparent 0.04em),
        linear-gradient(180deg, rgba(221, 255, 245, 0.95), rgba(96, 255, 196, 0.58));
    box-shadow:
        0 0 0.18em rgba(0, 255, 136, 0.7),
        inset 0 0 0.06em rgba(255, 255, 255, 0.8);
    animation: titlePeek 2.8s var(--ease-elastic) infinite;
}

.title-creature-chaser {
    left: 4.28em;
    top: 0.34em;
    width: 0.26em;
    height: 0.26em;
    border-radius: 42% 58% 48% 52%;
    background: linear-gradient(145deg, rgba(255, 0, 80, 0.95), rgba(109, 0, 56, 0.62));
    box-shadow:
        0 0 0.16em rgba(255, 0, 92, 0.8),
        0.1em 0.1em 0 rgba(0, 0, 0, 0.3);
    animation: titleChaserBob 2.1s var(--ease-natural) infinite;
}

.title-creature-portal {
    left: 3.1em;
    top: 0.98em;
    width: 0.54em;
    height: 0.3em;
    border-radius: 50%;
    border: 0.035em solid rgba(0, 240, 255, 0.8);
    box-shadow:
        0 0 0.16em rgba(0, 240, 255, 0.7),
        inset 0 0 0.12em rgba(255, 183, 0, 0.34);
    transform: rotate(-18deg);
    animation: titlePortalPulse 2.4s var(--ease-natural) infinite;
}

@keyframes titlePointerBlink {
    0%, 62% {
        opacity: 1;
    }
    63%, 74% {
        opacity: 0.34;
    }
    75%, 100% {
        opacity: 1;
    }
}

@keyframes titlePeek {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-0.08em);
    }
}

@keyframes titleChaserBob {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-0.05em) scale(1.08);
    }
}

@keyframes titlePortalPulse {
    0%, 100% {
        opacity: 0.58;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

.landing-subtitle {
    max-width: 34ch;
    color: rgba(226, 232, 240, 0.78);
    font-size: clamp(0.86rem, 0.72rem + 0.35vw, 1rem);
    line-height: 1.65;
    text-shadow: 0 0 1.2rem rgba(0, 0, 0, 0.72);
}

.landing-actions {
    width: min(26rem, 82vw);
    display: grid;
    gap: clamp(0.7rem, 0.48rem + 0.7vw, 1.05rem);
}

.landing-main-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.55rem, 0.42rem + 0.45vw, 0.85rem);
}

.landing-btn {
    min-height: clamp(2.8rem, 2.55rem + 0.85vw, 3.35rem);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.72rem;
    padding: 0 clamp(0.9rem, 0.62rem + 0.85vw, 1.45rem);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: clamp(0.45rem, 0.32rem + 0.4vw, 0.7rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 56%),
        rgba(4, 10, 18, 0.42);
    color: var(--text-color);
    font-family: var(--font-ui);
    font-size: clamp(0.82rem, 0.72rem + 0.32vw, 0.98rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        0 clamp(0.5rem, 0.25rem + 0.9vw, 1.1rem) clamp(1rem, 0.6rem + 1.4vw, 2rem) rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(0, 240, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition:
        border-color var(--motion-base) var(--ease-decisive),
        background var(--motion-base) var(--ease-decisive),
        box-shadow var(--motion-base) var(--ease-decisive),
        color var(--motion-base) var(--ease-decisive),
        transform var(--motion-base) var(--ease-elastic);
}

.landing-btn-icon,
.landing-meta-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.landing-btn-icon {
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 0.35rem;
    color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.07);
    font-family: var(--font-data);
    font-size: 0.84rem;
}

.landing-btn.primary {
    color: #061018;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 42%),
        var(--neon-blue);
    box-shadow:
        0 0 24px rgba(0, 240, 255, 0.22),
        0 14px 32px rgba(0, 0, 0, 0.28);
}

.landing-start-command {
    min-height: clamp(3.35rem, 2.9rem + 1.2vw, 4.3rem);
    font-size: clamp(0.95rem, 0.78rem + 0.45vw, 1.18rem);
}

.landing-btn.primary .landing-btn-icon {
    border-color: rgba(2, 6, 10, 0.22);
    color: #02060a;
    background: rgba(255, 255, 255, 0.34);
}

.landing-btn:hover {
    border-color: rgba(0, 240, 255, 0.58);
    color: #fff;
    transform: translateY(-2px) skewX(-1deg);
    box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.32),
        0 0 22px rgba(0, 240, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.landing-btn.primary:hover {
    color: #02060a;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.62), transparent 42%),
        #bdfaff;
}

.landing-meta-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.landing-meta-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(4, 10, 18, 0.34);
    color: rgba(226, 232, 240, 0.72);
    font-family: var(--font-ui);
    font-size: 0;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(14px) saturate(155%);
    -webkit-backdrop-filter: blur(14px) saturate(155%);
    transition:
        border-color var(--motion-base) var(--ease-decisive),
        background var(--motion-base) var(--ease-decisive),
        color var(--motion-base) var(--ease-decisive),
        box-shadow var(--motion-base) var(--ease-decisive),
        min-width var(--motion-base) var(--ease-elastic),
        transform var(--motion-base) var(--ease-elastic);
}

.landing-meta-btn span:last-child {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    font-size: 0.78rem;
    transition:
        max-width var(--motion-base) var(--ease-elastic),
        opacity var(--motion-base) var(--ease-decisive);
}

.landing-meta-icon {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 1rem;
}

.landing-meta-btn:hover,
.landing-meta-btn:focus-visible {
    min-width: 8.3rem;
    border-color: rgba(0, 240, 255, 0.42);
    background: rgba(0, 240, 255, 0.08);
    color: #fff;
    box-shadow: 0 0 1.25rem rgba(0, 240, 255, 0.15);
    transform: translateY(-1px);
}

.landing-meta-btn:hover span:last-child,
.landing-meta-btn:focus-visible span:last-child {
    max-width: 6.8rem;
    opacity: 1;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 2.5vw, 2.8rem);
    background:
        radial-gradient(circle at 30% 20%, rgba(0, 240, 255, 0.16), transparent 32%),
        radial-gradient(circle at 70% 80%, rgba(255, 0, 161, 0.12), transparent 36%),
        rgba(0, 2, 8, 0.68);
    backdrop-filter: blur(22px) saturate(185%);
    -webkit-backdrop-filter: blur(22px) saturate(185%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--ease-decisive);
}

.settings-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.settings-panel {
    width: min(58rem, 94vw);
    max-height: min(50rem, 92vh);
    overflow: auto;
    padding: clamp(1rem, 0.7rem + 1.4vw, 2rem);
    display: grid;
    gap: clamp(1rem, 0.75rem + 0.9vw, 1.55rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 28%),
        rgba(3, 7, 14, 0.78);
    border-color: rgba(0, 240, 255, 0.28);
    box-shadow:
        0 clamp(1.2rem, 0.8rem + 2vw, 3rem) clamp(2rem, 1rem + 4vw, 5rem) rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(0, 240, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 0 clamp(1.8rem, 1rem + 2vw, 3.6rem) rgba(0, 240, 255, 0.05);
    transform: translateY(clamp(0.8rem, 0.4rem + 1vw, 1.6rem)) scale(0.98);
    transition:
        transform var(--motion-base) var(--ease-elastic),
        opacity var(--motion-base) var(--ease-decisive);
}

.settings-overlay.active .settings-panel {
    transform: translateY(0) scale(1);
}

.settings-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: clamp(0.35rem, 0.25rem + 0.5vw, 0.75rem);
    align-items: start;
}

.settings-header .terminal-kicker {
    grid-column: 1 / -1;
}

.settings-header h2 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(1.65rem, 1.15rem + 2.1vw, 3.1rem);
    letter-spacing: 0;
    color: #f8fbff;
    text-shadow: 0 0 clamp(0.8rem, 0.45rem + 1.2vw, 1.8rem) rgba(0, 240, 255, 0.42);
}

.settings-close-btn {
    width: clamp(2.3rem, 1.9rem + 1vw, 3rem);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 0, 80, 0.38);
    border-radius: 50%;
    background: rgba(255, 0, 80, 0.12);
    color: #fff;
    font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.55rem);
    cursor: pointer;
    box-shadow:
        0 0 clamp(0.7rem, 0.4rem + 1vw, 1.5rem) rgba(255, 0, 80, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition:
        transform var(--motion-base) var(--ease-elastic),
        border-color var(--motion-base) var(--ease-decisive),
        background var(--motion-base) var(--ease-decisive);
}

.settings-close-btn:hover {
    transform: translateY(-1px) rotate(5deg);
    border-color: rgba(255, 86, 132, 0.78);
    background: rgba(255, 0, 80, 0.22);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: clamp(0.7rem, 0.45rem + 0.8vw, 1.1rem);
}

.settings-card,
.settings-keybinds {
    border: 1px solid rgba(0, 240, 255, 0.16);
    border-radius: clamp(0.55rem, 0.35rem + 0.6vw, 0.9rem);
    padding: clamp(0.8rem, 0.58rem + 0.8vw, 1.25rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 50%),
        rgba(0, 14, 22, 0.42);
    box-shadow:
        0 clamp(0.5rem, 0.22rem + 1vw, 1.2rem) clamp(1rem, 0.55rem + 1.8vw, 2.2rem) rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.settings-card {
    display: grid;
    gap: clamp(0.55rem, 0.4rem + 0.5vw, 0.85rem);
}

.settings-label,
.settings-keybinds h3 {
    font-family: var(--font-data);
    font-size: clamp(0.78rem, 0.68rem + 0.32vw, 0.95rem);
    color: rgba(204, 251, 255, 0.78);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.segmented-control {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: clamp(0.35rem, 0.25rem + 0.4vw, 0.55rem);
}

.settings-segment,
.settings-toggle,
.keybind-button {
    min-height: clamp(2.35rem, 2rem + 0.75vw, 2.9rem);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: clamp(0.42rem, 0.3rem + 0.45vw, 0.68rem);
    background: rgba(5, 13, 22, 0.66);
    color: var(--text-color);
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(0, 240, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition:
        transform var(--motion-base) var(--ease-elastic),
        border-color var(--motion-base) var(--ease-decisive),
        background var(--motion-base) var(--ease-decisive),
        color var(--motion-base) var(--ease-decisive),
        box-shadow var(--motion-base) var(--ease-decisive);
}

.settings-segment:hover,
.settings-toggle:hover,
.keybind-button:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 240, 255, 0.56);
}

.settings-segment.active,
.settings-toggle.active,
.keybind-button.is-listening {
    color: #021018;
    background: var(--neon-blue);
    box-shadow:
        0 0 clamp(0.9rem, 0.5rem + 1.5vw, 2rem) rgba(0, 240, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.settings-toggle.danger.active {
    background: var(--neon-yellow);
}

.dev-tuning-card.is-hidden {
    display: none;
}

.settings-slider-row {
    display: grid;
    grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 1.6fr) auto;
    align-items: center;
    gap: clamp(0.45rem, 0.35rem + 0.45vw, 0.8rem);
    color: rgba(226, 246, 255, 0.86);
    font-weight: 800;
}

.settings-slider-row input {
    width: 100%;
    accent-color: var(--neon-blue);
}

.settings-slider-row b {
    font-family: var(--font-data);
    color: var(--neon-yellow);
    min-width: 4.4em;
    text-align: right;
}

.settings-guide {
    border: 1px solid rgba(0, 240, 255, 0.14);
    border-radius: clamp(0.6rem, 0.42rem + 0.6vw, 0.95rem);
    padding: clamp(0.85rem, 0.62rem + 0.8vw, 1.35rem);
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(189, 0, 255, 0.04)),
        rgba(3, 12, 20, 0.5);
    box-shadow:
        0 clamp(0.4rem, 0.25rem + 0.8vw, 1rem) clamp(1.2rem, 0.7rem + 1.6vw, 2.2rem) rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.settings-guide h3 {
    margin: 0 0 clamp(0.6rem, 0.45rem + 0.5vw, 0.95rem);
    font-family: var(--font-title);
    color: #e8fbff;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: clamp(0.55rem, 0.4rem + 0.5vw, 0.85rem);
}

.guide-grid article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(0.45rem, 0.3rem + 0.4vw, 0.7rem);
    align-items: center;
    padding: clamp(0.55rem, 0.4rem + 0.5vw, 0.85rem);
    border: 1px solid rgba(139, 220, 255, 0.16);
    border-radius: clamp(0.45rem, 0.32rem + 0.45vw, 0.72rem);
    background: rgba(5, 14, 24, 0.58);
}

.guide-grid b {
    display: grid;
    place-items: center;
    width: clamp(1.9rem, 1.55rem + 0.7vw, 2.4rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.12);
    color: var(--neon-blue);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.settings-keybinds {
    display: grid;
    gap: clamp(0.75rem, 0.5rem + 0.8vw, 1.15rem);
}

.keybind-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: clamp(0.55rem, 0.42rem + 0.5vw, 0.85rem);
}

.keybind-grid label {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: clamp(0.5rem, 0.32rem + 0.5vw, 0.8rem);
    color: rgba(226, 232, 240, 0.84);
    font-weight: 800;
}

.keybind-button {
    min-width: clamp(4.4rem, 3.4rem + 2vw, 6rem);
    font-family: var(--font-data);
    color: var(--neon-green);
}

/* 配置面板 & 结算面板 */
.setup-panel, .end-panel {
    width: 720px;
    max-width: 90%;
    padding: 16px 30px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 96vh;
    overflow-y: auto;
}


.setup-panel::-webkit-scrollbar {
    width: 6px;
}
.setup-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 3px;
}

#setup-overlay {
    background:
        radial-gradient(circle at 70% 42%, rgba(0, 240, 255, 0.06), transparent 34%),
        radial-gradient(circle at 26% 18%, rgba(255, 183, 0, 0.08), transparent 28%),
        rgba(0, 2, 8, 0.16);
    backdrop-filter: blur(2px) saturate(132%);
    -webkit-backdrop-filter: blur(2px) saturate(132%);
}

#setup-overlay .setup-panel {
    width: min(38rem, 92vw);
    max-height: min(48rem, 92vh);
    padding: clamp(0.9rem, 0.6rem + 1.4vw, 1.9rem);
    gap: clamp(0.75rem, 0.55rem + 0.7vw, 1.2rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 32%),
        rgba(2, 8, 14, 0.34);
    border-color: rgba(0, 240, 255, 0.16);
    backdrop-filter: blur(24px) saturate(185%);
    -webkit-backdrop-filter: blur(24px) saturate(185%);
    box-shadow:
        0 clamp(1.2rem, 0.8rem + 2vw, 3rem) clamp(2rem, 1rem + 4vw, 5rem) rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.inspect-overlay {
    position: absolute;
    left: clamp(0.8rem, 0.55rem + 1vw, 1.5rem);
    top: clamp(0.8rem, 0.55rem + 1vw, 1.5rem);
    z-index: 8;
    width: min(24rem, calc(100vw - 2rem));
    padding: clamp(0.9rem, 0.65rem + 0.9vw, 1.45rem);
    display: grid;
    gap: clamp(0.65rem, 0.42rem + 0.7vw, 1rem);
    opacity: 0;
    pointer-events: none;
    transform: translateX(clamp(-1.4rem, -1vw, -0.6rem));
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 38%),
        rgba(3, 9, 18, 0.74);
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: 8px;
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    box-shadow:
        0 clamp(1.2rem, 0.8rem + 2vw, 2.8rem) clamp(2rem, 1rem + 4vw, 4.6rem) rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(0, 240, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition:
        opacity var(--motion-base) var(--ease-decisive),
        transform var(--motion-base) var(--ease-decisive);
}

.inspect-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.inspect-overlay h2 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(1.35rem, 1rem + 1.3vw, 2.35rem);
    letter-spacing: 0;
}

.inspect-overlay p {
    margin: 0;
    color: #c6d6e7;
    line-height: 1.6;
}

.briefing-kicker {
    display: block;
    margin-bottom: clamp(0.25rem, 0.2rem + 0.2vw, 0.4rem);
    color: var(--neon-blue);
    font-family: var(--font-data);
    font-size: clamp(0.62rem, 0.56rem + 0.18vw, 0.74rem);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.inspect-overlay p b {
    display: block;
    color: #eef8ff;
    font-size: clamp(0.88rem, 0.78rem + 0.35vw, 1.08rem);
    line-height: 1.45;
}

.inspect-meta {
    display: grid;
    gap: clamp(0.6rem, 0.45rem + 0.45vw, 0.9rem);
}

.inspect-meta span {
    padding: clamp(0.25rem, 0.18rem + 0.3vw, 0.4rem) clamp(0.48rem, 0.34rem + 0.45vw, 0.75rem);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 999px;
    color: #d8f8ff;
    background: rgba(0, 240, 255, 0.06);
}

.scanner-card,
.briefing-log {
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.09), transparent 44%),
        rgba(0, 0, 0, 0.22);
    padding: clamp(0.65rem, 0.48rem + 0.52vw, 0.95rem);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.scanner-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    color: rgba(226, 232, 240, 0.64);
    font-family: var(--font-title);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.scanner-card-head b,
.scanner-chip.new,
.hover-new {
    color: #fff;
    background: rgba(255, 0, 85, 0.18);
    border-color: rgba(255, 0, 85, 0.48);
    box-shadow: 0 0 0.8rem rgba(255, 0, 85, 0.18);
}

.scanner-card-head em {
    color: var(--neon-green);
    font-style: normal;
}

.scanner-grid,
.scanner-icons,
.hover-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.scanner-icons {
    margin-top: 0.48rem;
}

.scanner-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    padding: 0.16rem 0.5rem;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 999px;
    color: #d8f8ff;
    background: rgba(0, 240, 255, 0.06);
    font-family: var(--font-data);
    font-size: 0.64rem;
    font-weight: 900;
}

.scanner-chip.danger {
    border-color: rgba(255, 0, 85, 0.36);
    background: rgba(255, 0, 85, 0.11);
    color: #ff9abb;
}

.scanner-chip.guardian {
    border-color: rgba(255, 183, 0, 0.4);
    background: rgba(255, 183, 0, 0.12);
    color: #ffe27a;
}

.scanner-chip.safe {
    border-color: rgba(0, 255, 136, 0.28);
    background: rgba(0, 255, 136, 0.08);
    color: #9dffc4;
}

.scanner-chip.key {
    border-color: rgba(255, 183, 0, 0.38);
    background: rgba(255, 183, 0, 0.11);
    color: #ffe27a;
}

.scanner-chip.no-twist {
    border-color: rgba(255, 0, 55, 0.42);
    background: rgba(255, 0, 55, 0.1);
    color: #ffb8c4;
}

.scanner-chip.no-twist::before {
    content: "";
    width: 0.72rem;
    height: 0.72rem;
    margin-right: 0.32rem;
    border: 2px solid #ff173e;
    border-radius: 50%;
    background:
        linear-gradient(45deg, transparent 41%, #ff173e 43%, #ff173e 57%, transparent 59%);
    box-shadow: 0 0 0.52rem rgba(255, 0, 55, 0.5);
}

.scanner-chip.wide {
    flex-basis: 100%;
    justify-content: center;
}

.briefing-log span {
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.briefing-log p {
    margin: 0.35rem 0;
    font-size: 0.82rem;
}

.briefing-log small {
    color: rgba(226, 232, 240, 0.62);
    font-family: var(--font-data);
    font-size: 0.66rem;
}

.inspect-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(0.5rem, 0.35rem + 0.45vw, 0.8rem);
}

#setup-overlay .setup-section:first-of-type {
    position: relative;
}

#setup-overlay .setup-section:first-of-type::before {
    content: '';
    position: absolute;
    inset: clamp(4.1rem, 3.5rem + 1vw, 4.8rem) 0 clamp(0.6rem, 0.4rem + 0.6vw, 1rem);
    background:
        linear-gradient(118deg, transparent 8%, rgba(0, 240, 255, 0.22) 8.2%, transparent 8.6% 26%, rgba(255, 183, 0, 0.2) 26.2%, transparent 26.7% 48%, rgba(0, 240, 255, 0.16) 48.2%, transparent 48.7% 70%, rgba(189, 0, 255, 0.16) 70.2%, transparent 70.7%),
        linear-gradient(62deg, transparent 14%, rgba(0, 240, 255, 0.12) 14.2%, transparent 14.8% 56%, rgba(255, 255, 255, 0.08) 56.2%, transparent 56.8%);
    opacity: 0.55;
    pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

#setup-overlay .level-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
    gap: clamp(1.2rem, 1rem + 1vw, 2rem);
    padding: 1.2rem 0.5rem;
    min-height: auto;
}

#setup-overlay .level-card {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: clamp(3.6rem, 3.2rem + 1vw, 4.4rem);
    min-height: clamp(3.6rem, 3.2rem + 1vw, 4.4rem);
    padding: 0;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 50%;
    transform: none !important;
    margin: 0 auto;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.7), transparent 0.18rem),
        radial-gradient(circle, rgba(0, 240, 255, 0.22), rgba(0, 240, 255, 0.06) 48%, rgba(2, 8, 14, 0.58) 72%);
    border: 1px solid rgba(0, 240, 255, 0.28);
    box-shadow:
        0 0 clamp(0.8rem, 0.5rem + 1.1vw, 1.6rem) rgba(0, 240, 255, 0.24),
        inset 0 0 clamp(0.6rem, 0.35rem + 0.8vw, 1.2rem) rgba(0, 240, 255, 0.14);
    transition:
        transform var(--motion-base) var(--ease-elastic),
        border-color var(--motion-base) var(--ease-decisive),
        box-shadow var(--motion-base) var(--ease-decisive),
        background var(--motion-base) var(--ease-decisive);
}

#setup-overlay .leo-star-line {
    display: none !important;
}

#setup-overlay .leo-star-line.completed {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.18), rgba(0, 240, 255, 0.7));
    box-shadow: 0 0 clamp(0.55rem, 0.34rem + 0.8vw, 1.1rem) rgba(0, 255, 136, 0.25);
    opacity: 0.82;
}

#setup-overlay .leo-star-line.frontier {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.24), rgba(255, 183, 0, 0.72));
    box-shadow:
        0 0 clamp(0.7rem, 0.4rem + 1vw, 1.4rem) rgba(255, 183, 0, 0.3),
        0 0 clamp(1rem, 0.7rem + 1.6vw, 2.2rem) rgba(0, 240, 255, 0.12);
    opacity: 0.94;
}

#setup-overlay .level-card:hover,
#setup-overlay .level-card.active {
    transform: translate(-50%, -50%) scale(1.12);
    border-color: rgba(255, 183, 0, 0.76);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.86), transparent 0.2rem),
        radial-gradient(circle, rgba(255, 183, 0, 0.3), rgba(255, 183, 0, 0.12) 48%, rgba(2, 8, 14, 0.78) 72%);
    box-shadow:
        0 0 clamp(1rem, 0.6rem + 1.4vw, 2rem) rgba(255, 183, 0, 0.36),
        0 0 clamp(1.8rem, 1rem + 2.6vw, 3.6rem) rgba(0, 240, 255, 0.18),
        inset 0 0 clamp(0.7rem, 0.42rem + 1vw, 1.4rem) rgba(255, 183, 0, 0.18);
}

#setup-overlay .level-card.frontier:not(.completed) {
    border-color: rgba(255, 183, 0, 0.58);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.82), transparent 0.2rem),
        radial-gradient(circle, rgba(255, 183, 0, 0.28), rgba(255, 183, 0, 0.11) 48%, rgba(2, 8, 14, 0.7) 72%);
    box-shadow:
        0 0 clamp(0.9rem, 0.55rem + 1.1vw, 1.8rem) rgba(255, 183, 0, 0.28),
        inset 0 0 clamp(0.65rem, 0.4rem + 0.8vw, 1.2rem) rgba(255, 183, 0, 0.16);
}

#setup-overlay .level-card.completed {
    border-color: rgba(0, 255, 136, 0.54);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.76), transparent 0.18rem),
        radial-gradient(circle, rgba(0, 255, 136, 0.25), rgba(0, 240, 255, 0.08) 48%, rgba(2, 8, 14, 0.66) 72%);
}

#setup-overlay .level-card.dev-unlocked:not(.active) {
    border-color: rgba(189, 0, 255, 0.38);
    box-shadow:
        0 0 clamp(0.8rem, 0.45rem + 1vw, 1.6rem) rgba(189, 0, 255, 0.22),
        inset 0 0 clamp(0.6rem, 0.35rem + 0.8vw, 1.2rem) rgba(0, 240, 255, 0.14);
}

#setup-overlay .level-card::before {
    display: none;
}

#setup-overlay .level-card-title {
    font-family: var(--font-data);
    font-size: clamp(0.9rem, 0.75rem + 0.4vw, 1.25rem);
    line-height: 1;
    max-width: none;
    color: #f8fbff;
}

#setup-overlay .level-card-chapter,
#setup-overlay .level-card-meta,
#setup-overlay .level-card-concept {
    display: none;
}

.level-hover-card {
    position: fixed;
    left: var(--hover-x, 50vw);
    top: var(--hover-y, 50vh);
    z-index: 90;
    width: min(20rem, calc(100vw - 1.5rem));
    padding: clamp(0.75rem, 0.55rem + 0.7vw, 1.05rem);
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 8px;
    color: #eef8ff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 38%),
        linear-gradient(90deg, rgba(0, 240, 255, 0.12), rgba(255, 0, 85, 0.08)),
        rgba(3, 8, 16, 0.88);
    backdrop-filter: blur(18px) saturate(185%);
    -webkit-backdrop-filter: blur(18px) saturate(185%);
    box-shadow:
        0 1rem 2.4rem rgba(0, 0, 0, 0.48),
        0 0 1.4rem rgba(0, 240, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.45rem) scale(0.98);
    transition:
        opacity var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.level-hover-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hover-kicker {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--neon-blue);
    font-family: var(--font-data);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.level-hover-card strong {
    display: block;
    font-family: var(--font-title);
    font-size: clamp(0.95rem, 0.82rem + 0.45vw, 1.18rem);
}

.level-hover-card small {
    display: block;
    margin: 0.15rem 0 0.55rem;
    color: rgba(226, 232, 240, 0.62);
    font-family: var(--font-data);
    font-size: 0.64rem;
}

.level-hover-card p {
    margin: 0.58rem 0 0;
    color: rgba(238, 248, 255, 0.86);
    font-size: 0.78rem;
    line-height: 1.5;
}

.hover-new {
    display: inline-flex;
    margin-top: 0.5rem;
    padding: 0.18rem 0.5rem;
    border: 1px solid;
    border-radius: 999px;
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 900;
}

#setup-overlay .selected-level-panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
        rgba(1, 6, 11, 0.92);
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: clamp(0.65rem, 0.45rem + 0.7vw, 1rem);
    padding: clamp(0.85rem, 0.6rem + 0.9vw, 1.35rem);
    box-shadow:
        0 clamp(0.65rem, 0.35rem + 1vw, 1.4rem) clamp(1.1rem, 0.65rem + 1.8vw, 2.4rem) rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* 标题 Glitch 特效 */
.glitch-text {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    color: #fff;
    position: relative;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.subtitle {
    text-align: center;
    color: var(--neon-blue);
    font-size: 0.82rem;
    letter-spacing: 2px;
    margin-top: -8px;
    font-weight: 600;
    text-transform: uppercase;
}

.setup-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.setup-section h3 {
    font-family: var(--font-title);
    font-size: 0.88rem;
    line-height: 1.12;
    color: var(--neon-blue);
    border-left: 3px solid var(--neon-blue);
    padding-left: 8px;
    letter-spacing: 1px;
}

.setup-panel .glitch-text {
    font-size: 1.72rem;
    line-height: 1;
}

/* 残局册 */
.act-page-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.act-page-tab {
    min-height: 31px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.24);
    color: var(--text-dim);
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        color var(--motion-fast) var(--ease-decisive),
        box-shadow var(--motion-fast) var(--ease-decisive);
}

.act-page-tab:hover,
.act-page-tab.active {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.34);
    background: rgba(0, 240, 255, 0.09);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.08);
}

.act-page-tab[data-act-page="2"].active {
    border-color: rgba(189, 0, 255, 0.42);
    background: rgba(189, 0, 255, 0.12);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.12);
}

.act-page-tab[data-act-page="3"].active {
    border-color: rgba(255, 119, 0, 0.42);
    background: rgba(255, 119, 0, 0.12);
    box-shadow: 0 0 12px rgba(255, 119, 0, 0.12);
}

.act-page-tab[data-act-page="4"].active {
    border-color: rgba(255, 0, 85, 0.42);
    background: rgba(255, 0, 85, 0.12);
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.12);
}

.act-page-tab[data-act-page="5"].active {
    border-color: rgba(255, 221, 0, 0.42);
    background: rgba(255, 221, 0, 0.12);
    box-shadow: 0 0 12px rgba(255, 221, 0, 0.12);
}

.level-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.level-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        rgba(255, 255, 255, 0.035);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    font-family: inherit;
    min-height: 56px;
    transition:
        border-color 0.18s var(--ease-decisive),
        background 0.18s var(--ease-decisive),
        box-shadow 0.18s var(--ease-decisive),
        transform 0.18s var(--ease-elastic);
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--neon-blue);
    opacity: 0;
    transition: opacity 0.18s var(--ease-decisive);
}

.level-card:hover,
.level-card.active {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
}

.level-card:hover::before,
.level-card.active::before {
    opacity: 1;
}

.level-card.act-2 {
    border-color: rgba(189, 0, 255, 0.24);
    background:
        linear-gradient(135deg, rgba(189, 0, 255, 0.12), rgba(0, 240, 255, 0.045)),
        rgba(255, 255, 255, 0.035);
}

.level-card.act-2::before {
    background: var(--neon-purple);
}

.level-card.act-2:hover,
.level-card.act-2.active {
    border-color: var(--neon-purple);
    background:
        linear-gradient(135deg, rgba(189, 0, 255, 0.2), rgba(0, 240, 255, 0.07)),
        rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 14px rgba(189, 0, 255, 0.16);
}

.level-card.act-2 .level-card-chapter {
    color: #dba8ff;
}

.level-card.act-2 .level-card-meta span {
    border-color: rgba(189, 0, 255, 0.24);
    background: rgba(189, 0, 255, 0.09);
}

.level-card.act-3 {
    border-color: rgba(255, 119, 0, 0.24);
    background:
        linear-gradient(135deg, rgba(255, 119, 0, 0.12), rgba(255, 221, 0, 0.045)),
        rgba(255, 255, 255, 0.035);
}

.level-card.act-3::before {
    background: #ff7700;
}

.level-card.act-3:hover,
.level-card.act-3.active {
    border-color: #ff7700;
    background:
        linear-gradient(135deg, rgba(255, 119, 0, 0.2), rgba(255, 221, 0, 0.07)),
        rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 14px rgba(255, 119, 0, 0.16);
}

.level-card.act-4 {
    border-color: rgba(255, 0, 85, 0.24);
    background:
        linear-gradient(135deg, rgba(255, 0, 85, 0.12), rgba(189, 0, 255, 0.045)),
        rgba(255, 255, 255, 0.035);
}

.level-card.act-4::before {
    background: var(--neon-red);
}

.level-card.act-4:hover,
.level-card.act-4.active {
    border-color: var(--neon-red);
    background:
        linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(189, 0, 255, 0.07)),
        rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.16);
}

.level-card.act-5 {
    border-color: rgba(255, 221, 0, 0.24);
    background:
        linear-gradient(135deg, rgba(255, 221, 0, 0.12), rgba(0, 255, 136, 0.045)),
        rgba(255, 255, 255, 0.035);
}

.level-card.act-5::before {
    background: #ffdd00;
}

.level-card.act-5:hover,
.level-card.act-5.active {
    border-color: #ffdd00;
    background:
        linear-gradient(135deg, rgba(255, 221, 0, 0.2), rgba(0, 255, 136, 0.07)),
        rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 14px rgba(255, 221, 0, 0.16);
}

.level-card-title {
    font-family: var(--font-title);
    font-size: 0.82rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.level-card-chapter {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.level-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    color: var(--text-color);
    font-size: 0.62rem;
}

.level-card-meta span,
.brief-meta .meta-token {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
}

.meta-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 22px;
    min-height: 18px;
    color: #fff;
    line-height: 1;
}

.meta-token b {
    font-size: 0.78rem;
    line-height: 1;
}

.meta-token small {
    font-size: 0.58rem;
    font-weight: 900;
    color: rgba(245, 252, 255, 0.84);
}

.meta-token.enemy-chaser {
    border-color: rgba(255, 0, 85, 0.36);
    background: rgba(255, 0, 85, 0.13);
    color: #ff6f9b;
}

.meta-token.enemy-guardian {
    border-color: rgba(255, 183, 0, 0.4);
    background: rgba(255, 183, 0, 0.12);
    color: #ffe27a;
}

.meta-token.enemy-ambusher {
    border-color: rgba(189, 0, 255, 0.38);
    background: rgba(189, 0, 255, 0.12);
    color: #dda3ff;
}

.meta-token.tool-rotation {
    border-color: rgba(0, 240, 255, 0.36);
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-blue);
}

.meta-token.tool-bridge {
    border-color: rgba(255, 183, 0, 0.36);
    background: linear-gradient(90deg, rgba(53, 230, 255, 0.12), rgba(255, 183, 0, 0.14));
    color: #fff;
}

.meta-token.rule {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-color);
}

.meta-token.rule-guardian {
    border-color: rgba(255, 183, 0, 0.36);
    background: rgba(255, 183, 0, 0.11);
    color: #ffe27a;
}

.meta-token.rule-no-twist {
    border-color: rgba(255, 0, 55, 0.42);
    background: rgba(255, 0, 55, 0.11);
    color: #ffb8c4;
}

.level-card-concept {
    display: none;
}

.level-brief {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.brief-title {
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.brief-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.brief-meta span {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.74rem;
}

/* AI 配置列表 */
.ai-config-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.ai-label {
    font-size: 0.9rem;
    font-weight: 600;
}
.ai-chaser { color: var(--neon-red); }
.ai-ambusher { color: var(--neon-purple); }
.ai-guardian { color: var(--neon-yellow); }

.ai-controls {
    display: flex;
    gap: 10px;
}

/* 规则简述 */
.intro-rules {
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.intro-rules li {
    padding-left: 15px;
    position: relative;
}

.intro-rules li::before {
    content: '▪';
    position: absolute;
    left: 0;
    color: var(--neon-blue);
}

.rule-chip-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.rule-chip-grid span {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-color);
    padding: 5px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.rule-chip-grid b {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(255, 183, 0, 0.12);
    color: var(--neon-yellow);
    font-family: var(--font-title);
}

/* 漫画叙事层 */
.comic-panel {
    width: min(920px, calc(100vw - 48px));
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comic-kicker {
    align-self: flex-start;
    color: var(--neon-yellow);
    border: 1px solid rgba(255, 183, 0, 0.26);
    border-radius: 999px;
    background: rgba(255, 183, 0, 0.08);
    padding: 6px 10px;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.comic-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.comic-frame {
    position: relative;
    min-height: 154px;
    border: 1px solid rgba(0, 240, 255, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(0, 240, 255, 0.08), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 10px),
        rgba(255, 255, 255, 0.04);
    padding: 42px 14px 14px;
    overflow: hidden;
}

.comic-frame::after {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -20px;
    width: 78px;
    height: 78px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    transform: rotate(22deg);
    opacity: 0.6;
}

.comic-frame.danger-frame {
    border-color: rgba(255, 0, 85, 0.28);
    background:
        linear-gradient(145deg, rgba(255, 0, 85, 0.11), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 10px),
        rgba(255, 255, 255, 0.04);
}

.comic-no {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--neon-blue);
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 900;
}

.comic-frame p {
    color: #fff;
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
}

.comic-frame small {
    display: block;
    color: var(--text-dim);
    font-size: 0.78rem;
    line-height: 1.5;
}

.story-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-lang-toggle {
    border: 1px solid rgba(77, 225, 255, 0.32);
    border-radius: 999px;
    background: rgba(6, 14, 24, 0.72);
    color: #dff9ff;
    padding: 0.42rem 0.72rem;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic),
        background var(--motion-fast) var(--ease-decisive);
}

.btn-lang-toggle:hover {
    border-color: rgba(77, 225, 255, 0.72);
    background: rgba(77, 225, 255, 0.12);
    transform: translateY(-1px);
}

.setup-lang {
    position: absolute;
    right: 20px;
    top: 18px;
}

.console-lang {
    width: fit-content;
    justify-self: start;
}

.crt-prologue {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1fr);
    gap: clamp(1.25rem, 1rem + 2vw, 3rem);
    width: min(1040px, calc(100vw - 36px));
    min-height: min(680px, calc(100vh - 48px));
    padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
    border: 1px solid rgba(77, 225, 255, 0.26);
    border-radius: 22px;
    background:
        radial-gradient(circle at 25% 25%, rgba(77, 225, 255, 0.13), transparent 34%),
        linear-gradient(135deg, rgba(4, 14, 22, 0.94), rgba(1, 3, 9, 0.92));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 42px rgba(77, 225, 255, 0.12);
    overflow: hidden;
}

.crt-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.045) 0, rgba(255,255,255,0.045) 1px, transparent 1px, transparent 5px);
    mix-blend-mode: overlay;
    opacity: 0.22;
}

.crt-stage {
    display: grid;
    place-items: center;
    perspective: 720px;
}

.wire-cube {
    position: relative;
    width: clamp(150px, 18vw, 240px);
    aspect-ratio: 1;
    transform-style: preserve-3d;
    animation: wireCubeSpin 7s linear infinite;
}

.wire-cube i,
.wire-cube span {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(77, 225, 255, 0.74);
    box-shadow: 0 0 18px rgba(77, 225, 255, 0.38), inset 0 0 24px rgba(77, 225, 255, 0.12);
}

.wire-cube i:nth-child(1) { transform: translateZ(76px); }
.wire-cube i:nth-child(2) { transform: rotateY(90deg) translateZ(76px); }
.wire-cube i:nth-child(3) { transform: rotateY(180deg) translateZ(76px); }
.wire-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(76px); }
.wire-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(76px); }
.wire-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(76px); }
.wire-cube i:nth-child(7) { transform: scale3d(0.68, 0.68, 0.68) translateZ(36px); border-color: rgba(255, 183, 0, 0.7); }
.wire-cube i:nth-child(8) { transform: rotateZ(45deg) scale3d(0.42, 0.42, 0.42) translateZ(90px); border-color: rgba(255, 0, 170, 0.62); }
.wire-cube span { transform: scale3d(1.2, 1.2, 1.2); border-color: rgba(111, 255, 153, 0.24); }

@keyframes wireCubeSpin {
    from { transform: rotateX(-18deg) rotateY(0deg) rotateZ(2deg); }
    to { transform: rotateX(-18deg) rotateY(360deg) rotateZ(2deg); }
}

.crt-terminal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    padding: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    border: 1px solid rgba(111, 255, 153, 0.26);
    border-radius: 16px;
    background: rgba(0, 8, 12, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.crt-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #82ffc0;
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 900;
}

.prologue-feed {
    flex: 1;
    margin: 18px 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prologue-line {
    margin: 0;
    color: rgba(231, 248, 255, 0.86);
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 0.84rem + 0.2vw, 1rem);
    line-height: 1.6;
}

.prologue-line.sys {
    color: rgba(126, 255, 191, 0.72);
    font-family: var(--font-title);
}

.prologue-line.dawn {
    color: #f4fbff;
}

.prologue-line.you {
    color: #8de8ff;
    text-align: right;
}

.prologue-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.prologue-replies.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.finale-comic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.finale-comic .comic-frame {
    min-height: 126px;
}

/* ==========================================
   游戏主布局 Grid
   ========================================== */
#game-container {
    display: grid;
    grid-template-columns:
        clamp(13.75rem, 11.5rem + 5vw, 16.25rem)
        minmax(0, 1fr)
        clamp(20.5rem, 18rem + 6vw, 25.5rem);
    width: 100vw;
    height: 100vh;
    padding: clamp(0.55rem, 0.4rem + 0.55vw, 0.95rem);
    gap: clamp(0.55rem, 0.4rem + 0.55vw, 0.95rem);
    position: relative;
}

#game-container.preplay-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
    pointer-events: none;
}

#game-container.preplay-stage .meta-toolbar,
#game-container.preplay-stage .top-hud,
#game-container.preplay-stage #phone-panel,
#game-container.preplay-stage #canvas-overlay-ui,
#game-container.preplay-stage #audio-toggle,
#game-container.preplay-stage #btn-twist-mode {
    opacity: 0;
    pointer-events: none;
}

#game-container.preplay-stage #canvas-container {
    grid-column: 1 / -1;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border-color: transparent;
    box-shadow: none;
    filter: saturate(1.16) brightness(0.82);
}

#game-container.preplay-stage #canvas-container::before,
#game-container.preplay-stage #canvas-container::after {
    opacity: 0;
}

/* M9.1: Inspect Mode — restore canvas-overlay-ui so #inspect-overlay is visible & clickable */
#game-container.inspect-stage #canvas-overlay-ui {
    opacity: 1 !important;
    pointer-events: auto !important;
}
#game-container.inspect-stage #route-tip,
#game-container.inspect-stage #tutorial-helper-card {
    opacity: 0 !important;
    pointer-events: none !important;
}

#game-container.is-entering #canvas-container {
    transition:
        filter 0.72s var(--ease-decisive),
        transform 0.72s var(--ease-decisive);
}

.meta-toolbar {
    position: absolute;
    left: clamp(0.85rem, 0.65rem + 0.7vw, 1.45rem);
    top: clamp(0.85rem, 0.65rem + 0.7vw, 1.45rem);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--space-control);
    border-radius: 14px;
    background: rgba(5, 8, 14, 0.76);
    backdrop-filter: blur(10px);
}

.meta-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic),
        opacity var(--motion-fast) var(--ease-decisive);
}

.meta-btn:hover:not(:disabled) {
    border-color: rgba(0, 240, 255, 0.36);
    background: rgba(0, 240, 255, 0.08);
    transform: translateY(-1px);
}

.meta-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.hud-panel {
    display: flex;
    flex-direction: column;
    padding: var(--space-panel);
    gap: clamp(0.65rem, 0.5rem + 0.45vw, 0.95rem);
    overflow-y: auto;
    z-index: 10;
}

.compact-hud {
    padding-top: 76px;
    gap: 12px;
}

.hud-panel::-webkit-scrollbar {
    width: 4px;
}
.hud-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.escape-terminal {
    position: relative;
    gap: 12px;
    padding: 18px 16px 20px;
    border-color: rgba(0, 240, 255, 0.2);
    background:
        linear-gradient(180deg, rgba(0, 240, 255, 0.08), transparent 24%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 32%),
        rgba(8, 12, 20, 0.84);
}

.escape-terminal::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: 9px;
    pointer-events: none;
}

.phone-terminal {
    border-radius: 30px;
    border: 1px solid rgba(129, 233, 255, 0.3);
    box-shadow:
        inset 0 0 0 6px rgba(0, 0, 0, 0.24),
        inset 0 0 26px rgba(0, 240, 255, 0.04),
        0 18px 48px rgba(0, 0, 0, 0.36),
        0 0 34px rgba(0, 240, 255, 0.08);
}

.phone-terminal::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 74px;
    height: 5px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
    pointer-events: none;
}

.phone-terminal.tool-focus .phone-action-dock {
    border-color: rgba(255, 183, 0, 0.34);
    box-shadow:
        0 0 1.2rem rgba(255, 183, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.float-bubble-layer {
    position: fixed;
    inset: 0;
    z-index: 42;
    pointer-events: none;
}

.float-bubble-layer.tutorial-focus-shell {
    z-index: 1540;
}

#game-container.preplay-stage .float-bubble-layer {
    display: none;
}

.float-bubble {
    position: fixed;
    left: var(--bubble-x, calc(100vw - 9rem));
    top: var(--bubble-y, calc(100vh - 6rem));
    width: clamp(3.25rem, 2.7rem + 1.2vw, 4.1rem);
    height: clamp(3.25rem, 2.7rem + 1.2vw, 4.1rem);
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 240, 255, 0.34);
    border-radius: 50%;
    color: #f8fbff;
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.28), transparent 30%),
        radial-gradient(circle, rgba(0, 240, 255, 0.22), rgba(2, 8, 16, 0.82) 68%);
    box-shadow:
        0 0 0 0.28rem rgba(0, 240, 255, 0.06),
        0 0 1.35rem rgba(0, 240, 255, 0.22),
        inset 0 0 1rem rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        box-shadow var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.float-bubble span {
    font-family: var(--font-title);
    font-size: clamp(1.25rem, 1rem + 0.7vw, 1.75rem);
    line-height: 1;
    text-shadow: 0 0 0.8rem rgba(0, 240, 255, 0.48);
}

.float-bubble:hover,
.float-bubble.tutorial-target {
    border-color: rgba(255, 183, 0, 0.72);
    box-shadow:
        0 0 0 0.32rem rgba(255, 183, 0, 0.16),
        0 0 0 0.58rem rgba(255, 183, 0, 0.08),
        0 0 2.1rem rgba(255, 183, 0, 0.52),
        0 0 3.2rem rgba(0, 240, 255, 0.24),
        inset 0 0 1rem rgba(255, 255, 255, 0.1);
    transform: translateY(-1px) scale(1.03);
}

.float-bubble.tutorial-target {
    animation: tutorial-target-pulse 0.9s ease-in-out infinite alternate;
}

.float-bubble.is-dragging {
    cursor: grabbing;
    transform: scale(1.06);
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        box-shadow var(--motion-fast) var(--ease-decisive);
}

.tools-bubble {
    color: #56ff8a;
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.32), transparent 30%),
        radial-gradient(circle, rgba(0, 255, 136, 0.26), rgba(2, 8, 16, 0.84) 68%);
}

.tools-bubble.has-tools {
    border-color: rgba(0, 255, 136, 0.48);
}

.toolbox-icon-svg {
    width: 74%;
    height: 74%;
    color: #56ff8a;
    filter: drop-shadow(0 0 0.45rem rgba(0, 255, 136, 0.72));
}

.tools-bubble.is-tool-active {
    border-color: rgba(0, 255, 136, 0.78);
    box-shadow:
        0 0 0 0.3rem rgba(0, 255, 136, 0.14),
        0 0 1.65rem rgba(0, 255, 136, 0.34),
        inset 0 0 1rem rgba(255, 255, 255, 0.1);
}

.float-bubble-badge {
    position: absolute;
    top: -0.28rem;
    right: -0.2rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    background: #ff1d55;
    color: #fff;
    font-family: var(--font-data);
    font-size: 0.56rem;
    line-height: 1.05rem;
    text-align: center;
    box-shadow: 0 0 0.8rem rgba(255, 29, 85, 0.48);
}

.float-bubble-badge.is-hidden {
    display: none;
}

.terminal-header {
    display: grid;
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
    gap: 10px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.terminal-kicker {
    display: block;
    color: var(--text-dim);
    font-family: var(--font-title);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.terminal-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.28);
}

.companion-dock {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    padding: 7px;
    min-width: 0;
}

.companion-slot {
    display: none !important;
}

.companion-copy {
    min-width: 0;
}

.companion-status {
    display: block;
    color: var(--neon-green);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

#companion-bubble {
    margin: 1px 0 0;
    color: var(--text-color);
    font-size: 0.72rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.terminal-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    position: relative;
    z-index: 1;
}

.terminal-tab {
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-dim);
    font-family: var(--font-title);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    position: relative;
    transition:
        color var(--motion-fast) var(--ease-decisive),
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        box-shadow var(--motion-fast) var(--ease-decisive);
}

.terminal-tab:hover {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.24);
}

.terminal-tab.active {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.42);
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

.tab-badge {
    position: absolute;
    top: -7px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff1d55;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 10px rgba(255, 29, 85, 0.48);
    font-family: var(--font-data);
    font-size: 0.56rem;
    line-height: 15px;
    text-align: center;
    letter-spacing: 0;
}

.terminal-panel {
    display: none;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.terminal-panel.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comms-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.26);
    padding: 10px;
}

.comms-scene-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-dim);
    font-family: var(--font-title);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

#comms-scene-title {
    color: var(--neon-blue);
}

#comms-bond-label {
    color: rgba(226, 232, 240, 0.72);
}

.comms-story-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comms-line {
    border-radius: 7px;
    padding: 8px 9px;
    font-size: 0.82rem;
    line-height: 1.42;
}

.comms-line.protagonist {
    color: var(--text-color);
    background: rgba(0, 240, 255, 0.075);
    border-left: 3px solid var(--neon-blue);
}

.comms-line.system {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.035);
    border-left: 3px solid rgba(255, 255, 255, 0.16);
}

.comms-line.player {
    align-self: flex-end;
    min-width: 52px;
    text-align: center;
    color: #fff;
    background: rgba(255, 183, 0, 0.08);
    border: 1px solid rgba(255, 183, 0, 0.16);
    border-left: 3px solid var(--neon-yellow);
    font-size: 1.05rem;
    line-height: 1.1;
}

.comms-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.terminal-choice {
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 7px;
    background: rgba(0, 240, 255, 0.06);
    color: var(--text-color);
    min-height: 42px;
    padding: 9px 8px;
    text-align: center;
    font-size: 1.08rem;
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.terminal-choice.kaomoji-choice {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 58px;
    padding: 8px 6px 7px;
}

.kaomoji-face {
    display: block;
    font-size: clamp(1rem, 0.86rem + 0.52vw, 1.34rem);
    line-height: 1;
}

.terminal-choice small {
    display: block;
    max-width: 100%;
    color: rgba(226, 232, 240, 0.62);
    font-family: var(--font-data);
    font-size: clamp(0.54rem, 0.49rem + 0.18vw, 0.64rem);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-choice:hover {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.1);
    transform: translateY(-1px);
}

.archive-stack,
.archive-section,
.archive-list,
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.archive-section h3 {
    margin: 0 0 2px;
    color: var(--text-dim);
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.archive-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px;
}

.archive-card span {
    display: block;
    margin-bottom: 4px;
    color: var(--neon-green);
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 800;
}

.archive-card p {
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.45;
}

.archive-empty {
    margin: 0;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-dim);
    padding: 10px;
    font-size: 0.8rem;
}

.achievement-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.028);
    padding: 9px;
}

.achievement-card.unlocked {
    border-color: rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.055);
}

.achievement-card.locked {
    opacity: 0.58;
}

.achievement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.16);
}

.achievement-card strong {
    display: block;
    color: #fff;
    font-size: 0.78rem;
    margin-bottom: 3px;
}

.achievement-card p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.74rem;
    line-height: 1.35;
}

/* 3D 渲染容器 */
#canvas-container {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(145deg, rgba(0, 240, 255, 0.05), transparent 24%),
        radial-gradient(circle at center, #111422 0%, #08090f 100%);
    overflow: hidden;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 240, 255, 0.08),
        0 0 28px rgba(0, 240, 255, 0.035);
}

#canvas-container::before,
#canvas-container::after {
    content: '';
    position: absolute;
    inset: 14px;
    z-index: 5;
    pointer-events: none;
}

#canvas-container::before {
    border-top: 1px solid rgba(0, 240, 255, 0.18);
    border-bottom: 1px solid rgba(189, 0, 255, 0.12);
}

#canvas-container::after {
    background:
        linear-gradient(90deg, rgba(0, 240, 255, 0.42) 0 28px, transparent 28px calc(100% - 28px), rgba(0, 240, 255, 0.42) calc(100% - 28px)),
        linear-gradient(0deg, rgba(0, 240, 255, 0.42) 0 28px, transparent 28px calc(100% - 28px), rgba(0, 240, 255, 0.42) calc(100% - 28px));
    opacity: 0.16;
    mask:
        linear-gradient(#000 0 0) top left / 42px 42px no-repeat,
        linear-gradient(#000 0 0) top right / 42px 42px no-repeat,
        linear-gradient(#000 0 0) bottom left / 42px 42px no-repeat,
        linear-gradient(#000 0 0) bottom right / 42px 42px no-repeat;
}

#canvas-container canvas {
    position: relative;
    z-index: 1;
}

#canvas-overlay-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
}

.audio-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    border: 1px solid rgba(0, 240, 255, 0.22);
    background: rgba(0, 0, 0, 0.48);
    color: var(--neon-blue);
    border-radius: 999px;
    padding: 7px 12px;
    font-family: var(--font-ui);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
    transition:
        border-color 0.18s var(--ease-decisive),
        background 0.18s var(--ease-decisive),
        color 0.18s var(--ease-decisive),
        box-shadow 0.18s var(--ease-decisive),
        transform 0.18s var(--ease-elastic);
}

.audio-toggle:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.09);
    transform: translateY(-1px);
}

.audio-toggle.muted {
    color: var(--text-dim);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.help-tooltip {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.tool-mode-indicator {
    position: absolute;
    left: clamp(0.85rem, 1.6vw, 1.5rem);
    bottom: clamp(0.85rem, 1.6vw, 1.5rem);
    width: min(20rem, calc(100% - 2rem));
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon title"
        "icon desc";
    column-gap: 0.72rem;
    row-gap: 0.12rem;
    align-items: center;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 0.5rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 42%),
        rgba(2, 8, 16, 0.62);
    color: rgba(248, 251, 255, 0.9);
    backdrop-filter: blur(14px) saturate(165%);
    -webkit-backdrop-filter: blur(14px) saturate(165%);
    box-shadow:
        0 0.65rem 1.4rem rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition:
        border-color var(--motion-base) var(--ease-decisive),
        box-shadow var(--motion-base) var(--ease-decisive),
        transform var(--motion-base) var(--ease-elastic);
}

.tool-mode-icon {
    grid-area: icon;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 0.45rem;
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-blue);
    font-family: var(--font-data);
    font-size: 1rem;
    font-weight: 900;
}

.tool-mode-indicator strong {
    grid-area: title;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.tool-mode-indicator small {
    grid-area: desc;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.72rem;
    line-height: 1.4;
}

.tool-mode-indicator.is-tool-active {
    border-color: rgba(0, 255, 136, 0.54);
    box-shadow:
        0 0 0 0.22rem rgba(0, 255, 136, 0.08),
        0 0.8rem 1.7rem rgba(0, 0, 0, 0.32),
        0 0 1.4rem rgba(0, 255, 136, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.tool-mode-indicator[data-mode="patch"] .tool-mode-icon {
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.12);
}

.tool-mode-indicator[data-mode="beacon"] .tool-mode-icon {
    color: var(--neon-yellow);
    background: rgba(255, 183, 0, 0.12);
}

.tool-mode-indicator[data-mode="break"] .tool-mode-icon {
    color: #ff6b88;
    background: rgba(255, 29, 85, 0.13);
}

body[data-tool-mode="route"] #canvas-container {
    cursor: crosshair;
}

body[data-tool-mode="patch"] #canvas-container {
    cursor: copy;
}

body[data-tool-mode="beacon"] #canvas-container {
    cursor: cell;
}

body[data-tool-mode="break"] #canvas-container {
    cursor: not-allowed;
}

body.twist-interaction-active #canvas-container {
    cursor: grab;
    border-color: rgba(255, 201, 77, 0.58);
    background:
        radial-gradient(circle at 50% 44%, rgba(255, 210, 84, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 183, 0, 0.16), transparent 28%),
        radial-gradient(circle at center, #191409 0%, #090807 100%);
    box-shadow:
        inset 0 0 48px rgba(0, 0, 0, 0.82),
        inset 0 0 80px rgba(255, 183, 0, 0.08),
        0 0 0 1px rgba(255, 214, 84, 0.2),
        0 0 38px rgba(255, 183, 0, 0.16);
}

body.twist-interaction-active #canvas-container:active {
    cursor: grabbing;
}

body.twist-interaction-active #canvas-container::before {
    border-top-color: rgba(255, 214, 84, 0.42);
    border-bottom-color: rgba(255, 120, 60, 0.25);
}

body.twist-interaction-active #canvas-container::after {
    background:
        linear-gradient(90deg, rgba(255, 214, 84, 0.72) 0 28px, transparent 28px calc(100% - 28px), rgba(255, 214, 84, 0.72) calc(100% - 28px)),
        linear-gradient(0deg, rgba(255, 168, 48, 0.66) 0 28px, transparent 28px calc(100% - 28px), rgba(255, 168, 48, 0.66) calc(100% - 28px));
    opacity: 0.28;
}

.twist-cross-hint {
    position: absolute;
    z-index: 9;
    width: 7.2rem;
    height: 7.2rem;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 18px rgba(255, 183, 0, 0.55));
    opacity: 1;
    transition:
        opacity var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic),
        filter var(--motion-fast) var(--ease-decisive);
}

.twist-cross-hint.is-hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
}

.twist-cross-hint.is-disabled {
    filter: grayscale(0.4) drop-shadow(0 0 12px rgba(255, 80, 80, 0.35));
}

.twist-cross-arm,
.twist-cross-core {
    position: absolute;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 252, 214, 0.84);
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.42), transparent 34%),
        rgba(255, 183, 0, 0.86);
    color: #071019;
    font-family: var(--font-title);
    font-weight: 1000;
    box-shadow:
        0 0 0 0.22rem rgba(255, 183, 0, 0.16),
        0 0 1rem rgba(255, 183, 0, 0.55);
}

.twist-cross-arm {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    font-size: 1.28rem;
    opacity: 0.62;
}

.twist-cross-core {
    left: 50%;
    top: 50%;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: #fff3a6;
}

.twist-cross-up {
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.twist-cross-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.twist-cross-down {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}

.twist-cross-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.twist-cross-hint.is-up .twist-cross-up,
.twist-cross-hint.is-right .twist-cross-right,
.twist-cross-hint.is-down .twist-cross-down,
.twist-cross-hint.is-left .twist-cross-left {
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.48), transparent 34%),
        #fff3a6;
    opacity: 1;
    box-shadow:
        0 0 0 0.34rem rgba(255, 183, 0, 0.24),
        0 0 1.55rem rgba(255, 183, 0, 0.78),
        0 0 2.4rem rgba(255, 255, 255, 0.18);
}

.twist-cross-hint.is-up .twist-cross-up {
    transform: translateX(-50%) scale(1.12);
}

.twist-cross-hint.is-right .twist-cross-right {
    transform: translateY(-50%) scale(1.12);
}

.twist-cross-hint.is-down .twist-cross-down {
    transform: translateX(-50%) scale(1.12);
}

.twist-cross-hint.is-left .twist-cross-left {
    transform: translateY(-50%) scale(1.12);
}

.twist-cross-hint.is-blocked.is-up .twist-cross-up,
.twist-cross-hint.is-blocked.is-right .twist-cross-right,
.twist-cross-hint.is-blocked.is-down .twist-cross-down,
.twist-cross-hint.is-blocked.is-left .twist-cross-left {
    border-color: rgba(255, 90, 120, 0.78);
    background: rgba(80, 18, 28, 0.88);
    color: #ffd6de;
}

.twist-cross-hint.is-blocked:not(.is-up):not(.is-right):not(.is-down):not(.is-left) .twist-cross-arm {
    border-color: rgba(255, 90, 120, 0.62);
    background: rgba(80, 18, 28, 0.72);
    color: #ffd6de;
}

/* ==========================================
   系统状态 (Status displays)
   ========================================== */
.task-card {
    border: 1px solid rgba(0, 240, 255, 0.14);
    background:
        linear-gradient(145deg, rgba(0, 240, 255, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.035);
    border-radius: 8px;
    padding: 12px;
}

.tutorial-strip {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.tutorial-sticker {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 183, 0, 0.42);
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.18), transparent 38%),
        rgba(255, 183, 0, 0.12);
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 16px rgba(255, 183, 0, 0.12);
}

.tutorial-cue {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
}

.task-title {
    font-family: var(--font-title);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-dim);
    line-height: 1.35;
    margin-top: 3px;
    margin-bottom: 0;
}

.task-goal {
    color: var(--text-color);
    font-size: 0.86rem;
    line-height: 1.45;
}

.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    padding: 9px 10px;
}

.quick-stat span {
    color: var(--text-dim);
    font-size: 0.74rem;
}

.quick-stat strong {
    font-family: var(--font-data);
    font-size: 1.08rem;
}

.route-tip {
    border-left: 3px solid var(--neon-blue);
    background: rgba(0, 240, 255, 0.06);
    color: var(--text-color);
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 0.8rem;
    line-height: 1.45;
}

.action-heading-row {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
    margin-bottom: 8px;
}

.action-heading-row h3 {
    margin: 0;
}

.info-hint {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 183, 0, 0.45);
    background: rgba(255, 183, 0, 0.1);
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
    cursor: help;
}

.info-tooltip {
    position: absolute;
    left: 0;
    top: 28px;
    z-index: 8;
    width: min(260px, 78vw);
    border: 1px solid rgba(255, 183, 0, 0.34);
    border-radius: 7px;
    background: rgba(8, 9, 15, 0.96);
    color: var(--text-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(255, 183, 0, 0.12);
    padding: 9px 10px;
    font-size: 0.76rem;
    line-height: 1.42;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition:
        opacity 0.14s var(--ease-decisive),
        transform 0.14s var(--ease-decisive);
}

.action-heading-row:hover .info-tooltip,
.action-heading-row:focus-within .info-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.phone-action-dock {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.72fr);
    gap: 8px;
    position: relative;
    z-index: 2;
    padding: 9px;
    border: 1px solid rgba(0, 240, 255, 0.13);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.08), transparent 42%),
        rgba(0, 0, 0, 0.2);
}

.phone-action-dock .btn {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.phone-primary {
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.22);
}

.phone-secondary {
    color: rgba(245, 252, 255, 0.86);
}

.phone-action-dock:has(#btn-end-turn.is-hidden) .phone-primary {
    grid-column: 1 / -1;
}

.phone-tool-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr));
    gap: 6px;
}

.tool-mode-btn {
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(226, 232, 240, 0.78);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        color var(--motion-fast) var(--ease-decisive);
}

.tool-mode-btn b {
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.72rem;
}

.tool-mode-btn:hover:not(:disabled),
.tool-mode-btn.active {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.42);
    background: rgba(0, 240, 255, 0.1);
}

.tool-mode-btn[data-tool-mode="patch"].active {
    border-color: rgba(139, 220, 255, 0.58);
    background: rgba(139, 220, 255, 0.12);
}

.tool-mode-btn[data-tool-mode="beacon"].active {
    border-color: rgba(255, 183, 0, 0.58);
    background: rgba(255, 183, 0, 0.12);
}

.tool-mode-btn[data-tool-mode="break"].active {
    border-color: rgba(255, 0, 85, 0.58);
    background: rgba(255, 0, 85, 0.12);
}

.tool-mode-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.phone-fold-panel {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid rgba(255, 183, 0, 0.2);
    border-radius: 11px;
    background:
        linear-gradient(90deg, rgba(255, 183, 0, 0.08), rgba(0, 240, 255, 0.035)),
        rgba(0, 0, 0, 0.18);
    padding: 8px;
}

.fold-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.fold-title-line {
    position: relative;
}

.fold-title-line strong {
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.76rem;
    line-height: 1;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.rotation-cost-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.66rem;
    line-height: 1;
    white-space: nowrap;
}

.rotation-cost-inline b {
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.68rem;
}

.fold-title-line .info-hint {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    font-size: 0.62rem;
    line-height: 16px;
}

.fold-title-line .info-tooltip {
    left: auto;
    right: 0;
    top: 24px;
    width: min(254px, calc(100vw - 44px));
}

.fold-title-line:hover .info-tooltip,
.fold-title-line:focus-within .info-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.fold-controls-line {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr) 38px 38px;
    gap: 7px;
}

.cyber-select.fold-select {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
}

.fold-arrow {
    width: 38px;
    min-width: 38px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    color: #fff;
    font-size: 1.08rem;
    line-height: 1;
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.fold-arrow:hover:not(:disabled) {
    color: var(--neon-yellow);
    border-color: rgba(255, 183, 0, 0.54);
    background: rgba(255, 183, 0, 0.1);
}

.rotation-cost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 183, 0, 0.2);
    border-radius: 6px;
    background: rgba(255, 183, 0, 0.06);
    padding: 7px 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.rotation-cost strong {
    font-family: var(--font-title);
    color: var(--neon-yellow);
}

.rotation-preview-chip {
    border: 1px solid rgba(255, 183, 0, 0.24);
    border-radius: 6px;
    background: rgba(255, 183, 0, 0.075);
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 7px 9px;
    margin-bottom: 10px;
}

.rotation-preview-chip.is-compact {
    display: none;
}

.tracker-status-chip {
    border: 1px solid rgba(139, 220, 255, 0.28);
    border-radius: 6px;
    background: rgba(139, 220, 255, 0.08);
    color: #8bdcff;
    font-family: var(--font-title);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 7px 9px;
    margin-bottom: 10px;
}

.tracker-status-chip.is-active {
    border-color: rgba(0, 255, 136, 0.45);
    background: rgba(0, 255, 136, 0.08);
    color: var(--neon-green);
}

.tracker-status-chip.is-picking {
    border-color: rgba(255, 183, 0, 0.55);
    background: rgba(255, 183, 0, 0.09);
    color: var(--neon-yellow);
}

#btn-toggle-tracker.is-active {
    border-color: rgba(255, 183, 0, 0.7);
    box-shadow: 0 0 14px rgba(255, 183, 0, 0.22);
    color: var(--neon-yellow);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-item .label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-item .value {
    font-family: var(--font-data);
    font-size: 1.4rem;
    font-weight: 700;
}

/* AP 条 */
.ap-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: -8px;
}
.ap-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    transition: width 0.3s var(--ease-decisive);
}

.small-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: -4px;
}

/* 按钮、选择框 */
.cyber-select {
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    outline: none;
    font-size: 0.85rem;
    width: 140px;
    font-family: inherit;
    cursor: pointer;
}
.cyber-select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.cyber-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
    margin: 8px 0;
}

/* 控制行 */
.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.control-row label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.action-section h3 {
    font-family: var(--font-title);
    font-size: 0.9rem;
    color: var(--neon-yellow);
    margin-bottom: 6px;
}
.section-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.45;
}

.btn-pair {
    margin-top: 12px;
}

/* ==========================================
   2D 雷达展开图 (Minimap)
   ========================================== */
.minimap-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        linear-gradient(145deg, rgba(0, 240, 255, 0.045), transparent 35%),
        rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: -6px;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid currentColor;
}

.legend-dot.next {
    color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.22);
}

.legend-dot.threat {
    color: var(--neon-red);
    background: rgba(255, 0, 85, 0.25);
}

.legend-dot.route {
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.25);
}

#minimap-canvas {
    background: transparent;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

/* 任务目标列表 */
.objective-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.objective-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.obj-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 4px rgba(255,255,255,0.2);
}
.obj-dot.active-blue {
    background: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
}
.obj-dot.active-green {
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}
.obj-dot.active-yellow {
    background: var(--neon-yellow);
    box-shadow: 0 0 8px var(--neon-yellow);
}

/* AI 状态面板 */
.ai-status-panel h3 {
    font-family: var(--font-title);
    font-size: 0.9rem;
    color: var(--neon-purple);
    margin-bottom: 10px;
}

#ai-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 6px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    border-left: 3px solid var(--text-dim);
}
.ai-status-row.chaser { border-left-color: var(--neon-red); }
.ai-status-row.ambusher { border-left-color: var(--neon-purple); }
.ai-status-row.guardian { border-left-color: var(--neon-yellow); }

.ai-status-row .ai-state {
    font-weight: bold;
}
.ai-state.alert { color: var(--neon-red); }
.ai-state.patrol { color: var(--neon-yellow); }
.ai-state.lure { color: var(--neon-blue); text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }
.ai-state.rage { color: var(--neon-red); text-shadow: 0 0 8px rgba(255, 0, 85, 0.5); }

/* ==========================================
   按钮样式系统 (Button System)
   ========================================== */
.btn {
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition:
        background 0.2s var(--ease-decisive),
        border-color 0.2s var(--ease-decisive),
        box-shadow 0.2s var(--ease-decisive),
        color 0.2s var(--ease-decisive),
        opacity 0.2s var(--ease-decisive),
        transform 0.2s var(--ease-elastic);
    outline: none;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--neon-blue);
    color: #08090f;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    background: #2d3748;
    color: #4a5568;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--neon-red);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.3);
}
.btn-danger:hover {
    background: #ff3377;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.6);
    transform: translateY(-1px);
}

.btn-risk {
    background: rgba(255, 0, 85, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 0, 85, 0.34);
    box-shadow: none;
}

.btn-risk:hover {
    background: rgba(255, 0, 85, 0.18);
    border-color: rgba(255, 0, 85, 0.58);
    color: #fff;
    transform: translateY(-1px);
}

.btn-action {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    border: 1px solid rgba(0, 240, 255, 0.2);
    font-size: 0.8rem;
    padding: 8px 12px;
}
.btn-action:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-blue);
}

.feel-pulse,
.feel-pulse-good,
.feel-pulse-warn {
    animation-duration: 0.34s;
    animation-timing-function: var(--ease-decisive);
}

.feel-pulse {
    animation-name: feelPulse;
}

.feel-pulse-good {
    animation-name: feelPulseGood;
}

.feel-pulse-warn {
    animation-name: feelPulseWarn;
}

.btn-group {
    display: flex;
    gap: 10px;
}
.btn-size {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}
.btn-size.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

@keyframes feelPulse {
    0% { box-shadow: 0 0 0 rgba(0, 240, 255, 0); transform: translateY(0); }
    45% { box-shadow: 0 0 18px rgba(0, 240, 255, 0.35); transform: translateY(-1px); }
    100% { box-shadow: 0 0 0 rgba(0, 240, 255, 0); transform: translateY(0); }
}

@keyframes feelPulseGood {
    0% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); transform: translateY(0); }
    45% { box-shadow: 0 0 18px rgba(0, 255, 136, 0.36); transform: translateY(-1px); }
    100% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); transform: translateY(0); }
}

@keyframes feelPulseWarn {
    0% { box-shadow: 0 0 0 rgba(255, 183, 0, 0); transform: translateY(0); }
    45% { box-shadow: 0 0 18px rgba(255, 183, 0, 0.34); transform: translateY(-1px); }
    100% { box-shadow: 0 0 0 rgba(255, 183, 0, 0); transform: translateY(0); }
}

/* ==========================================
   字体颜色与发光 (Glow utilities)
   ========================================== */
.neon-title-blue {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    letter-spacing: 2px;
}
.neon-title-green {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    letter-spacing: 2px;
}
.neon-title-purple {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--neon-purple);
    text-shadow: 0 0 8px rgba(189, 0, 255, 0.4);
    letter-spacing: 2px;
}
.neon-title-yellow {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 8px rgba(255, 183, 0, 0.4);
    letter-spacing: 2px;
}

.text-neon-blue { color: var(--neon-blue); text-shadow: 0 0 8px rgba(0, 240, 255, 0.3); }
.text-neon-green { color: var(--neon-green); text-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }
.text-neon-yellow { color: var(--neon-yellow); text-shadow: 0 0 8px rgba(255, 183, 0, 0.3); }

.text-red { color: var(--neon-red); text-shadow: 0 0 12px rgba(255, 0, 85, 0.5); }
.text-green { color: var(--neon-green); text-shadow: 0 0 12px rgba(0, 255, 136, 0.5); }

/* 结算总结 */
.stats-summary {
    font-size: 0.9rem;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 10px 0;
}

.stats-summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.stats-summary div:last-child {
    margin-bottom: 0;
}
.stats-summary .s-val {
    font-family: var(--font-data);
    font-weight: 700;
    color: var(--neon-blue);
}

.catch-sticker {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 14px;
    border: 2px solid rgba(255, 0, 85, 0.76);
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 36%),
        rgba(255, 0, 85, 0.16);
    color: #fff;
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(255, 0, 85, 0.85);
    box-shadow: 0 0 24px rgba(255, 0, 85, 0.26);
    transform: scale(0.92);
}

#gameover-overlay.jump-alert .end-panel.failure {
    animation: catchPanelPop 0.36s cubic-bezier(0.2, 1.4, 0.35, 1);
}

#gameover-overlay.jump-alert .catch-sticker {
    animation: catchStickerPop 0.58s cubic-bezier(0.18, 1.5, 0.4, 1);
}

#gameover-overlay.signal-lost .end-panel.failure {
    animation: signalPanelTear 0.72s var(--ease-decisive) both;
}

#gameover-overlay.signal-lost .glitch-text {
    text-shadow:
        -0.08em 0 rgba(0, 240, 255, 0.7),
        0.08em 0 rgba(255, 0, 85, 0.72),
        0 0 1.4rem rgba(255, 0, 85, 0.36);
}

#gameover-overlay.signal-lost .catch-sticker {
    animation: signalStickerTear 0.72s var(--ease-decisive) both;
}

@keyframes signalPanelTear {
    0% { filter: none; transform: translateY(0) skewX(0deg); }
    18% { filter: contrast(1.9) saturate(1.8) hue-rotate(18deg); transform: translateX(-0.45rem) skewX(-2deg); }
    37% { filter: contrast(1.35) saturate(2.1) hue-rotate(-28deg); transform: translateX(0.35rem) skewX(1.6deg); }
    63% { filter: grayscale(0.18) contrast(1.7); transform: translateX(-0.16rem) skewX(-0.8deg); }
    100% { filter: none; transform: translateY(0) skewX(0deg); }
}

@keyframes signalStickerTear {
    0% { transform: scale(0.92); opacity: 0.78; }
    22% { transform: scale(1.08) rotate(-4deg); opacity: 1; }
    48% { transform: scale(0.96) rotate(3deg); opacity: 0.92; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.failure-review {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

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

.analysis-tone-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.78rem;
}

.analysis-tone-control .cyber-select {
    width: 118px;
}

.failure-analysis {
    border: 1px solid rgba(0, 240, 255, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(0, 240, 255, 0.055), transparent 42%),
        rgba(0, 0, 0, 0.28);
    padding: 13px;
    text-align: left;
    line-height: 1.55;
}

.failure-analysis h3 {
    font-family: var(--font-title);
    color: var(--neon-yellow);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.failure-analysis p {
    color: var(--text-color);
    font-size: 0.86rem;
    margin-bottom: 8px;
}

.failure-analysis ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 8px 0;
}

.failure-analysis li {
    border-left: 2px solid rgba(0, 240, 255, 0.28);
    padding-left: 9px;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.failure-analysis .review-note {
    color: var(--neon-green);
    margin-top: 10px;
}

@keyframes catchPanelPop {
    0% { transform: scale(0.94); filter: brightness(1.4); }
    58% { transform: scale(1.025); filter: brightness(1.12); }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes catchStickerPop {
    0% { transform: scale(0.25) rotate(-8deg); opacity: 0; }
    45% { transform: scale(1.18) rotate(3deg); opacity: 1; }
    72% { transform: scale(0.96) rotate(-1deg); }
    100% { transform: scale(1) rotate(0); }
}

/* ==========================================
   页面自适应处理 (Responsive Design)
   ========================================== */
@media (max-width: 1100px) {
    #game-container {
        grid-template-columns: clamp(15.5rem, 36vw, 18rem) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) clamp(15.5rem, 28vh, 18rem);
    }
    .right-panel {
        grid-column: 1 / span 2;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        height: clamp(15.5rem, 28vh, 18rem);
    }
    .minimap-container {
        width: 200px;
        height: 200px;
    }

    .escape-terminal.right-panel {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .terminal-header {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .level-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comic-panel {
        padding: 22px;
    }

    .comic-strip,
    .finale-comic {
        grid-template-columns: 1fr;
    }

    .story-actions {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Milestone 4: 3D Direct Control Layout
   ========================================== */
#game-container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
    overflow: hidden;
}

#canvas-container {
    grid-column: 1;
    grid-row: 1;
    border-radius: 0;
    border: 0;
}

.top-hud {
    display: none !important;
}

.top-hud-main {
    display: grid;
    grid-template-columns: clamp(2.4rem, 2rem + 1vw, 3.3rem) minmax(0, 1fr);
    gap: clamp(0.7rem, 0.55rem + 0.6vw, 1rem);
    align-items: center;
    min-width: 0;
}

.hud-sticker {
    width: clamp(2.25rem, 1.9rem + 1vw, 3rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 183, 0, 0.42);
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.18), transparent 38%),
        rgba(255, 183, 0, 0.12);
    color: var(--neon-yellow);
    font-family: var(--font-title);
    font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.55rem);
    font-weight: 900;
    box-shadow: 0 0 18px rgba(255, 183, 0, 0.16);
}

.hud-cue {
    margin: 0 0 0.12rem;
    color: var(--neon-blue);
    font-family: var(--font-title);
    font-size: clamp(0.62rem, 0.55rem + 0.22vw, 0.78rem);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.top-hud h2 {
    margin: 0;
    color: #fff;
    font-family: var(--font-title);
    font-size: clamp(0.94rem, 0.82rem + 0.45vw, 1.28rem);
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.top-hud p {
    margin: 0;
}

.top-hud #current-level-goal {
    margin-top: 0.22rem;
    color: rgba(226, 232, 240, 0.76);
    font-size: clamp(0.72rem, 0.66rem + 0.25vw, 0.86rem);
    line-height: 1.35;
}

.top-hud-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.45rem, 0.35rem + 0.35vw, 0.7rem);
}

.top-hud-stats div,
.survival-grid div {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.26);
    padding: clamp(0.45rem, 0.35rem + 0.35vw, 0.68rem);
}

.top-hud-stats span,
.survival-grid span {
    display: block;
    color: var(--text-dim);
    font-size: clamp(0.58rem, 0.52rem + 0.2vw, 0.68rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.top-hud-stats strong,
.survival-grid strong {
    display: block;
    margin-top: 0.12rem;
    font-family: var(--font-data);
    font-size: clamp(0.95rem, 0.82rem + 0.55vw, 1.28rem);
    line-height: 1;
}

.top-hud .ap-bar-container {
    grid-column: 1 / -1;
    margin: -0.15rem 0 0;
}

.meta-toolbar {
    left: clamp(0.8rem, 0.62rem + 0.65vw, 1.3rem);
    top: clamp(0.8rem, 0.62rem + 0.65vw, 1.3rem);
    z-index: 30;
}

.phone-terminal.right-panel {
    display: none !important;
}

.phone-terminal.is-talking {
    box-shadow:
        0 0 clamp(1.2rem, 0.8rem + 2vw, 3rem) rgba(0, 240, 255, 0.18),
        0 0 clamp(2rem, 1.2rem + 3vw, 4.5rem) rgba(255, 0, 161, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.phone-statusbar {
    display: flex;
    align-items: center;
    gap: clamp(0.35rem, 0.25rem + 0.35vw, 0.6rem);
    margin-bottom: clamp(0.12rem, 0.08rem + 0.25vw, 0.35rem);
    font-family: var(--font-data);
    font-size: clamp(0.58rem, 0.52rem + 0.2vw, 0.72rem);
    color: rgba(202, 251, 255, 0.68);
    letter-spacing: 0.06em;
}

.phone-statusbar b,
.phone-statusbar em {
    font-style: normal;
    color: rgba(139, 220, 255, 0.86);
}

.voice-wave-canvas {
    width: min(100%, clamp(9rem, 7rem + 7vw, 16rem));
    height: clamp(1.85rem, 1.45rem + 1vw, 2.65rem);
    margin-top: clamp(0.28rem, 0.18rem + 0.35vw, 0.48rem);
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(255, 0, 161, 0.08)),
        rgba(0, 8, 16, 0.34);
    box-shadow:
        0 0 clamp(0.7rem, 0.4rem + 1vw, 1.4rem) rgba(0, 240, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.phone-terminal.is-collapsed {
    transform: translateX(calc(100% - 1.25rem));
    opacity: 0.82;
}

.phone-notch {
    position: absolute;
    left: -1.45rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 1.65rem;
    height: clamp(4rem, 3.5rem + 2vw, 6rem);
    border: 1px solid rgba(0, 240, 255, 0.32);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    background: rgba(5, 8, 14, 0.86);
    color: var(--neon-blue);
    font-family: var(--font-title);
    font-weight: 900;
    cursor: pointer;
    box-shadow: -0.4rem 0 1.5rem rgba(0, 240, 255, 0.08);
    transition:
        color var(--motion-fast) var(--ease-decisive),
        border-color var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.phone-notch:hover {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.62);
    transform: translateY(-50%) translateX(-0.08rem);
}

.terminal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-command-preview {
    color: var(--neon-green);
    border-left-color: var(--neon-green);
    font-family: var(--font-data);
    overflow-wrap: anywhere;
}

.command-bubble {
    max-width: 100%;
    font-size: 0.76rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.twist-toggle {
    display: none !important;
    position: absolute;
    left: clamp(1rem, 0.75rem + 0.75vw, 1.5rem);
    right: auto;
    bottom: clamp(5.2rem, 4.6rem + 2vh, 6.4rem);
    z-index: 70;
    border: 1px solid rgba(255, 183, 0, 0.34);
    border-radius: 999px;
    background: rgba(5, 8, 14, 0.78);
    color: var(--neon-yellow);
    padding: clamp(0.55rem, 0.45rem + 0.3vw, 0.8rem) clamp(0.8rem, 0.62rem + 0.55vw, 1.2rem);
    font-family: var(--font-title);
    font-size: clamp(0.72rem, 0.65rem + 0.25vw, 0.86rem);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(255, 183, 0, 0.12);
    transition:
        background var(--motion-fast) var(--ease-decisive),
        border-color var(--motion-fast) var(--ease-decisive),
        color var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.twist-toggle:hover,
.twist-toggle.active {
    color: #07090f;
    border-color: rgba(255, 238, 138, 0.74);
    background: var(--neon-yellow);
    transform: translateY(-1px);
}

.tutorial-helper-card {
    position: absolute;
    left: clamp(14px, 2.5vw, 28px);
    bottom: clamp(18px, 3vw, 34px);
    z-index: 18;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    width: min(340px, calc(100vw - 32px));
    padding: 14px 42px 14px 14px;
    border: 1px solid rgba(77, 225, 255, 0.32);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(8, 18, 28, 0.84), rgba(8, 10, 22, 0.62)),
        rgba(5, 8, 16, 0.72);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 24px rgba(77, 225, 255, 0.12);
    transform: translateY(0);
    opacity: 1;
    transition:
        opacity 180ms var(--ease-decisive),
        transform 260ms var(--ease-elastic),
        border-color 180ms var(--ease-decisive);
}

.tutorial-helper-card.is-hidden {
    pointer-events: none;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
}

#game-container.tutorial-vignette #canvas-container canvas {
    /* Retain original colorful materials in Three.js and do not make the cube pitch-black */
    filter: none;
    transition: filter var(--motion-base) var(--ease-decisive);
}

.tutorial-blackout {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at var(--focus-x, 50%) var(--focus-y, 48%),
            transparent 0,
            transparent clamp(2.7rem, 5.8vw, 4.8rem),
            rgba(255, 231, 126, 0.24) clamp(2.9rem, 6.2vw, 5.05rem),
            rgba(255, 183, 0, 0.16) clamp(3.2rem, 6.9vw, 5.65rem),
            rgba(3, 7, 18, 0.58) clamp(4.35rem, 9vw, 7.2rem),
            rgba(1, 3, 9, 0.74) 100%);
    transition: opacity var(--motion-base) var(--ease-decisive);
}

.tutorial-blackout.is-flat {
    background: rgba(2, 6, 16, 0.44);
}

.tutorial-blackout.active {
    opacity: 0.92;
    animation: tutorial-spotlight-breathe 1.35s ease-in-out infinite alternate;
}

.tutorial-blackout.active.is-flat {
    animation: none;
}

@keyframes tutorial-spotlight-breathe {
    from {
        filter: saturate(1) brightness(1);
    }
    to {
        filter: saturate(1.18) brightness(1.08);
    }
}

.tutorial-look-gesture {
    position: absolute;
    left: 50%;
    top: 43%;
    z-index: 24;
    width: clamp(8rem, 15vw, 13rem);
    height: clamp(8rem, 15vw, 13rem);
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 1;
    transition:
        opacity var(--motion-base) var(--ease-decisive),
        transform var(--motion-base) var(--ease-elastic);
}

.tutorial-look-gesture.is-hidden {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.94);
}

.gesture-hand-svg {
    position: absolute;
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.42));
}

.gesture-mouse-svg {
    width: clamp(7rem, 13vw, 11rem);
    height: clamp(5.8rem, 11vw, 9rem);
    filter:
        drop-shadow(0 0 0.55rem rgba(255, 223, 110, 0.62))
        drop-shadow(0 0 1rem rgba(0, 240, 255, 0.36));
}

.gesture-drag-track {
    opacity: 0.96;
    stroke-dasharray: 10 7;
    animation: tutorial-drag-track-flow 1.35s var(--ease-decisive) infinite;
}

.dragging-mouse {
    animation: tutorial-mouse-drag-path 1.95s var(--ease-decisive) infinite;
    transform-origin: 50% 56%;
}

@keyframes tutorial-drag-track-flow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -34;
    }
}

@keyframes tutorial-mouse-drag-path {
    0% {
        transform: translate(-2rem, 0.35rem) rotate(-8deg);
    }
    50% {
        transform: translate(2rem, 0.35rem) rotate(8deg);
    }
    100% {
        transform: translate(-2rem, 0.35rem) rotate(-8deg);
    }
}

.gesture-hand-svg.is-hidden {
    display: none !important;
}

.zooming-mouse {
    transform-origin: 50% 50%;
}

.mouse-wheel {
    animation: mouse-wheel-scroll 1.5s ease-in-out infinite;
}

@keyframes mouse-wheel-scroll {
    0% {
        transform: translateY(-2px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(3px);
        opacity: 1;
    }
    100% {
        transform: translateY(-2px);
        opacity: 0.3;
    }
}

.progress-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 12px rgba(0, 255, 136, 0.32));
}

.progress-ring__circle {
    transition: stroke-dashoffset 80ms var(--ease-decisive);
    stroke-linecap: round;
}

.tutorial-look-gesture.is-complete .progress-ring__circle {
    stroke: var(--neon-yellow) !important;
    filter: drop-shadow(0 0 16px rgba(255, 183, 0, 0.52));
}

.gesture-text {
    position: absolute;
    bottom: -2.4rem;
    font-family: var(--font-data);
    font-size: clamp(0.86rem, 1.05vw, 1.08rem);
    font-weight: 900;
    color: #ffdf6e;
    text-shadow:
        0 0 0.55rem rgba(255, 183, 0, 0.68),
        0 0 0.9rem rgba(0, 240, 255, 0.34);
    letter-spacing: 0;
    white-space: nowrap;
}

@keyframes tutorial-hand-swipe {
    0%, 100% { transform: translateX(-1.8rem) rotate(-8deg); opacity: 0.45; }
    45% { transform: translateX(1.8rem) rotate(8deg); opacity: 1; }
    70% { transform: translateX(1.8rem) rotate(8deg); opacity: 0.35; }
}

.tutorial-dialogue-console {
    position: absolute;
    right: clamp(1rem, 2.4vw, 2.25rem);
    top: clamp(5.6rem, 9vh, 7rem);
    z-index: 1400;
    pointer-events: auto;
    width: min(28rem, calc(100vw - 2rem));
    min-height: auto;
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-left: 4px solid rgba(255, 214, 84, 0.9);
    border-radius: 12px;
    background: rgba(10, 16, 24, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 240, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateX(0) translateY(0);
    opacity: 1;
    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tutorial-dialogue-console.is-hidden {
    pointer-events: none;
    opacity: 0;
    transform: translateX(118%) translateY(0);
}

.tutorial-dialogue-console.is-system {
    border-color: rgba(255, 214, 84, 0.38);
    border-left-color: rgba(255, 214, 84, 0.95);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.42),
        0 0 24px rgba(255, 214, 84, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.tutorial-dialogue-console.is-dawn {
    border-color: rgba(0, 240, 255, 0.24);
    border-left-color: rgba(0, 255, 136, 0.86);
}

.tutorial-dialogue-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 1.4rem;
    height: 1.4rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.tutorial-dialogue-close:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.tutorial-led-mascot {
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 6, 10, 0.85);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.tutorial-dialogue-copy {
    min-width: 0;
}

.tutorial-dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    padding-right: 1rem;
}

.tutorial-speaker-label {
    color: #ffd654;
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tutorial-dialogue-console.is-dawn .tutorial-speaker-label {
    color: #00ff88;
}

.tutorial-time-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    font-family: var(--font-data);
}

.tutorial-dialogue-copy p {
    margin: 0;
    color: #e2f1f9;
    font-size: clamp(1rem, 1.05vw, 1.18rem);
    line-height: 1.45;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.1);
}

.tutorial-dialogue-next {
    position: relative;
    isolation: isolate;
    overflow: visible;
    margin-top: 0.85rem;
    padding: 0.52rem 1.1rem;
    border: 1px solid rgba(255, 214, 84, 0.72);
    border-radius: 6px;
    color: #071019;
    background: rgba(255, 214, 84, 0.94);
    font-family: var(--font-data);
    font-size: 0.92rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        0 0 0 0.18rem rgba(255, 183, 0, 0.14),
        0 0 1.15rem rgba(255, 183, 0, 0.36);
    transition:
        transform 0.18s var(--ease-decisive),
        background-color 0.18s var(--ease-decisive),
        color 0.18s var(--ease-decisive),
        box-shadow 0.18s var(--ease-decisive);
}

.tutorial-dialogue-console.is-system .tutorial-dialogue-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(16rem, 100%);
    padding: 0.68rem 1.45rem;
    border: 2px solid #fff3a8;
    color: #05070b;
    background: #ffd654;
    text-transform: uppercase;
    box-shadow:
        0 0 0 0.24rem rgba(255, 0, 60, 0.24),
        0 0 1.1rem rgba(255, 214, 84, 0.78),
        0 0 2rem rgba(255, 0, 60, 0.32);
    animation: system-confirm-alert 0.72s steps(1, end) infinite;
}

.tutorial-dialogue-console.is-system .tutorial-dialogue-next::before,
.tutorial-dialogue-console.is-system .tutorial-dialogue-next::after {
    content: "";
    position: absolute;
    inset: -0.48rem;
    border-radius: 10px;
    pointer-events: none;
}

.tutorial-dialogue-console.is-system .tutorial-dialogue-next::before {
    z-index: -1;
    border: 2px solid rgba(255, 214, 84, 0.92);
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255, 214, 84, 0.22) 0 0.28rem,
            rgba(255, 0, 60, 0.3) 0.28rem 0.56rem,
            rgba(5, 7, 11, 0.46) 0.56rem 0.84rem
        );
    box-shadow:
        0 0 0.85rem rgba(255, 214, 84, 0.58),
        0 0 1.9rem rgba(255, 0, 60, 0.44);
    animation: system-confirm-frame 0.72s steps(1, end) infinite;
}

.tutorial-dialogue-console.is-system .tutorial-dialogue-next::after {
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.32) 42%,
        rgba(255, 255, 255, 0.72) 50%,
        rgba(255, 255, 255, 0.28) 58%,
        transparent 100%
    );
    mix-blend-mode: screen;
    opacity: 0.62;
    transform: translateX(-125%);
    animation: system-confirm-scan 0.72s linear infinite;
}

.tutorial-dialogue-next:hover {
    border-color: rgba(255, 255, 255, 0.86);
    color: #061018;
    background: #ffe58b;
    transform: translateY(-1px);
    box-shadow:
        0 0 0 0.22rem rgba(255, 183, 0, 0.18),
        0 0 1.55rem rgba(255, 183, 0, 0.52);
}

@keyframes system-confirm-alert {
    0%, 49% {
        color: #05070b;
        background: #ffd654;
        border-color: #fff3a8;
        filter: brightness(1.22) saturate(1.35);
        box-shadow:
            0 0 0 0.24rem rgba(255, 0, 60, 0.24),
            0 0 1.1rem rgba(255, 214, 84, 0.78),
            0 0 2rem rgba(255, 0, 60, 0.32);
    }
    50%, 74% {
        color: #ffffff;
        background: #ff003c;
        border-color: #ffd654;
        filter: brightness(1.32) saturate(1.5);
        box-shadow:
            0 0 0 0.34rem rgba(255, 214, 84, 0.26),
            0 0 1.25rem rgba(255, 0, 60, 0.86),
            0 0 2.35rem rgba(255, 214, 84, 0.42);
    }
    75%, 100% {
        color: #ffd654;
        background: #05070b;
        border-color: #ff003c;
        filter: brightness(1.1) saturate(1.2);
        box-shadow:
            0 0 0 0.2rem rgba(255, 0, 60, 0.38),
            0 0 1.15rem rgba(255, 0, 60, 0.72),
            0 0 2rem rgba(255, 214, 84, 0.26);
    }
}

@keyframes system-confirm-frame {
    0%, 49% {
        transform: scale(1);
        opacity: 0.82;
    }
    50%, 74% {
        transform: scale(1.06);
        opacity: 1;
    }
    75%, 100% {
        transform: scale(0.98);
        opacity: 0.68;
    }
}

@keyframes system-confirm-scan {
    0% {
        transform: translateX(-125%);
        opacity: 0.08;
    }
    36% {
        opacity: 0.72;
    }
    100% {
        transform: translateX(125%);
        opacity: 0.12;
    }
}

.twist-toggle.tutorial-target {
    outline: 4px solid rgba(255, 252, 214, 0.98);
    outline-offset: 4px;
    box-shadow:
        0 0 0 0.38rem rgba(255, 183, 0, 0.2),
        0 0 0 0.72rem rgba(255, 255, 255, 0.08),
        0 0 clamp(1.2rem, 2vw, 2.4rem) rgba(255, 183, 0, 0.76),
        0 0 clamp(1.8rem, 3vw, 3.6rem) rgba(0, 240, 255, 0.24);
    animation: tutorial-target-pulse 0.66s ease-in-out infinite alternate;
}

.btn.tutorial-target,
.kaomoji-btn.tutorial-target,
.float-bubble.tutorial-target,
.tool-bubble-btn.tutorial-target {
    position: relative;
    z-index: 1560 !important;
    outline: 4px solid rgba(255, 252, 214, 0.98);
    outline-offset: 4px;
    box-shadow:
        0 0 0 0.38rem rgba(255, 183, 0, 0.2),
        0 0 0 0.72rem rgba(255, 255, 255, 0.08),
        0 0 2.2rem rgba(255, 183, 0, 0.72),
        0 0 3.2rem rgba(0, 240, 255, 0.24);
    animation: tutorial-target-pulse 0.66s ease-in-out infinite alternate;
}

.floating-toolbox-menu.tutorial-target-shell {
    z-index: 1560;
}

@keyframes tutorial-target-pulse {
    from {
        filter: brightness(1);
    }
    to {
        filter: brightness(1.42) saturate(1.28);
    }
}

.tutorial-ui-arrow {
    position: fixed;
    z-index: 1600;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: #fff3a6;
    color: #071019;
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 900;
    pointer-events: none;
    box-shadow:
        0 0 0 0.34rem rgba(255, 183, 0, 0.3),
        0 0 0 0.72rem rgba(255, 255, 255, 0.1),
        0 0 2.6rem rgba(255, 183, 0, 0.86),
        0 0 4rem rgba(0, 240, 255, 0.18);
    animation: tutorial-ui-arrow-pulse 0.62s ease-in-out infinite alternate;
}

.tutorial-ui-arrow::after {
    content: '';
    position: absolute;
    right: 50%;
    width: clamp(2.5rem, 6vw, 5.8rem);
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 243, 166, 0.9));
    box-shadow: 0 0 16px rgba(255, 183, 0, 0.6);
    transform: translateX(-0.9rem);
}

.tutorial-ui-arrow.points-left::after {
    right: auto;
    left: 50%;
    transform: translateX(-0.9rem);
}

.tutorial-ui-arrow.points-left {
    transform: translateY(-50%) rotate(180deg);
}

.tutorial-ui-arrow.is-hidden {
    display: none;
}

@keyframes tutorial-ui-arrow-pulse {
    from {
        scale: 0.94;
    }
    to {
        scale: 1.06;
    }
}

.tutorial-helper-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(111, 255, 153, 0.45);
    border-radius: 12px;
    color: #8dffb2;
    font-family: var(--font-display);
    font-size: 1.25rem;
    background: rgba(10, 255, 166, 0.1);
    box-shadow: 0 0 18px rgba(34, 255, 170, 0.16);
}

.tutorial-helper-card strong {
    display: block;
    margin-bottom: 3px;
    color: #e8fbff;
    font-size: 0.92rem;
}

.tutorial-helper-card p {
    margin: 0;
    color: rgba(216, 236, 255, 0.72);
    font-size: 0.78rem;
    line-height: 1.55;
}

.tutorial-helper-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    color: rgba(234, 246, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition:
        border-color 160ms var(--ease-decisive),
        color 160ms var(--ease-decisive),
        transform 180ms var(--ease-elastic);
}

.tutorial-helper-close:hover {
    border-color: rgba(77, 225, 255, 0.42);
    color: #ffffff;
    transform: scale(1.08);
}

.esc-console {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 0.5rem + 2vw, 2.5rem);
    background: rgba(2, 4, 8, 0.48);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.28s var(--ease-decisive),
        backdrop-filter 0.28s var(--ease-decisive);
}

.esc-console.active {
    opacity: 1;
    pointer-events: auto;
}

.esc-console-panel {
    width: min(68rem, 94vw);
    max-height: min(42rem, 88vh);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(18rem, 0.72fr);
    gap: clamp(1rem, 0.7rem + 1vw, 1.8rem);
    padding: clamp(1rem, 0.8rem + 1vw, 1.8rem);
    overflow: auto;
    transform: translateY(0.8rem) scale(0.98);
    transition:
        transform 0.32s var(--ease-decisive),
        opacity 0.32s var(--ease-decisive);
}

.esc-console.active .esc-console-panel {
    transform: translateY(0) scale(1);
}

.esc-console-column {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 0.55rem + 0.6vw, 1.1rem);
    min-width: 0;
}

.esc-console-column h2 {
    margin: 0;
    color: #fff;
    font-family: var(--font-title);
    font-size: clamp(1.1rem, 0.9rem + 0.9vw, 1.7rem);
    letter-spacing: 0;
}

.esc-console-column p {
    margin: 0;
    color: rgba(226, 232, 240, 0.76);
    line-height: 1.55;
}

.esc-objectives {
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
}

.survival-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.55rem, 0.42rem + 0.45vw, 0.85rem);
}

.esc-actions .btn {
    width: 100%;
}

@media (max-width: 980px) {
    .crt-prologue {
        grid-template-columns: 1fr;
        min-height: min(720px, calc(100vh - 32px));
    }

    .crt-stage {
        min-height: 180px;
    }

    .top-hud {
        left: clamp(4.6rem, 14vw, 7rem);
        right: clamp(1rem, 3vw, 1.5rem);
        width: auto;
        transform: none;
        grid-template-columns: 1fr;
    }

    .phone-terminal.right-panel {
        width: min(23rem, 86vw);
    }

    .esc-console-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .crt-prologue {
        width: calc(100vw - 20px);
        padding: 1rem;
    }

    .crt-stage {
        display: none;
    }

    .crt-terminal {
        min-height: calc(100vh - 72px);
    }

    .top-hud-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .top-hud #current-level-goal {
        display: none;
    }

    .phone-terminal.right-panel {
        top: 6.5rem;
        width: min(21rem, 88vw);
    }
}

.btn-skip-tutorial {
    margin-top: clamp(6px, 1.2vw, 10px);
    font-size: clamp(10px, 0.8vw, 12px);
    padding: clamp(4px, 0.6vw, 6px) clamp(8px, 1vw, 12px);
    border: 1px solid rgba(77, 225, 255, 0.28);
    border-radius: 6px;
    background: rgba(8, 18, 28, 0.45);
    color: #8bdcff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: background-color 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-skip-tutorial:hover {
    background: rgba(77, 225, 255, 0.16);
    border-color: rgba(77, 225, 255, 0.65);
    color: #ffffff;
}

.btn-skip-tutorial:active {
    background: rgba(77, 225, 255, 0.25);
    transform: scale(0.96);
}

/* M10.3: 彻底净化手机端下半部分，隐藏多余的主角通讯说明、历史聊天记录与走向日志，只保留聊天本身 */
#phone-panel .terminal-panel[data-terminal-panel="comms"] h2,
#phone-panel .terminal-panel[data-terminal-panel="comms"] .section-desc,
#phone-panel .terminal-panel[data-terminal-panel="comms"] .comms-log {
    display: none !important;
}

#phone-panel .terminal-panel[data-terminal-panel="comms"] .comms-choices {
    margin-top: 15px;
}

/* Milestone 11.2: Inspect stage UI elements isolation */
#game-container.inspect-stage .float-bubble,
#game-container.inspect-stage .float-bubble-layer,
#game-container.inspect-stage .tutorial-dialogue-console,
#game-container.inspect-stage #phone-terminal,
#game-container.inspect-stage #phone-panel {
    display: none !important;
}

/* Milestone 11.2: Decoupled Independent Toolbox Menu */
.floating-toolbox-menu {
    position: fixed;
    z-index: 43;
    right: clamp(0.75rem, 1.6vw, 1.5rem);
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.88rem;
    align-items: center;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(-50%) scale(1);
    padding: 0.88rem;
    border: 1px solid rgba(255, 183, 0, 0.34);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 183, 0, 0.12), transparent 42%),
        rgba(2, 8, 16, 0.78);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.36),
        0 0 26px rgba(255, 183, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        opacity var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.floating-toolbox-menu.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(18px) scale(0.88);
}

.tool-bubble-btn {
    position: relative;
    width: clamp(4rem, 3vw + 2.65rem, 5.1rem);
    height: clamp(4rem, 3vw + 2.65rem, 5.1rem);
    border-radius: 16px;
    border: 1px solid rgba(0, 240, 255, 0.34);
    background:
        radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.15), transparent 34%),
        rgba(2, 8, 16, 0.92);
    color: #eef8ff;
    font-size: 1.58rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36), 0 0 10px rgba(0, 240, 255, 0.08);
    transition:
        border-color var(--motion-fast) var(--ease-decisive),
        background var(--motion-fast) var(--ease-decisive),
        box-shadow var(--motion-fast) var(--ease-decisive),
        opacity var(--motion-fast) var(--ease-decisive),
        transform var(--motion-fast) var(--ease-elastic);
}

.tool-bubble-btn:hover {
    border-color: rgba(255, 183, 0, 0.65);
    transform: scale(1.06) translateX(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 183, 0, 0.25);
}

.tool-bubble-btn.active {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.42);
}

.tool-bubble-btn span {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: #ff1d55;
    color: #fff;
    font-size: 0.52rem;
    font-family: var(--font-data);
    font-weight: bold;
    padding: 0.05rem 0.25rem;
    border-radius: 999px;
    border: 1px solid #fff;
}

.tool-bubble-btn:disabled {
    opacity: 0.25;
    pointer-events: none;
}

#console-trust-display.tutorial-target {
    animation: tutorial-trust-pulse 1s infinite alternate;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 183, 0, 0.28);
    box-shadow: 0 0 12px rgba(255, 183, 0, 0.6);
    border: 1px solid rgba(255, 183, 0, 0.8);
}

@keyframes tutorial-trust-pulse {
    0% {
        box-shadow: 0 0 4px rgba(255, 183, 0, 0.4);
        background: rgba(255, 183, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 16px rgba(255, 183, 0, 0.9);
        background: rgba(255, 183, 0, 0.4);
    }
}

/* ==========================================================================
   Milestone 11.5: Scheme G Cozy Handdrawn Chat Window & Red Badge Override
   ========================================================================== */

/* 悬浮球头像化修正 */
.float-bubble.comms-bubble {
    border: none !important;
    background: rgba(10, 25, 47, 0.7) !important;
    box-shadow: 0 0 18px rgba(0, 242, 254, 0.8) !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* 让红角标溢出显示 */
    padding: 0;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.float-bubble.comms-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(0, 242, 254, 1) !important;
}

/* 荧光蓝像素少女 SVG 样式 */
.bubble-avatar-svg {
    width: 82%;
    height: 82%;
    color: #00f2fe; /* 荧光蓝 */
    filter: drop-shadow(0 0 4px #00f2fe);
}

/* macOS 风格亮红色动态角标 */
.float-bubble.comms-bubble .float-bubble-badge {
    background: #ff3b30 !important;
    color: #ffffff !important;
    border: 1.5px solid #ffffff !important;
    font-size: 0.65rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 700 !important;
    min-width: 1.05rem !important;
    height: 1.05rem !important;
    border-radius: 99px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: -0.15rem !important;
    right: -0.15rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    padding: 0 4px !important;
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.float-bubble.comms-bubble .float-bubble-badge.is-hidden {
    display: none !important;
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* 方案 G：手绘手帐本聊天卡片 */
.dawn-chat-window {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: 16.5rem;
    height: 19rem;
    display: flex;
    flex-direction: column;
    z-index: 1350;

    /* 温暖微黄的信纸底色 + 网格衬线 */
    background-color: #faf8f5;
    background-image:
        linear-gradient(rgba(174, 194, 214, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(174, 194, 214, 0.18) 1px, transparent 1px);
    background-size: 16px 16px;

    /* 略微有些手绘铅笔粗糙感的深色木炭边框 + 双阴影 */
    border: 2px solid #3c352e;
    border-radius: 4px;
    box-shadow: 6px 6px 0px rgba(60, 53, 46, 0.15);

    font-family: "PingFang SC", "Microsoft YaHei", "SimHei", cursive;
    color: #332c25;
    overflow: visible;
    pointer-events: auto;
    transition:
        left 80ms linear,
        top 80ms linear,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.dawn-chat-window::after {
    content: "";
    position: absolute;
    left: clamp(1.4rem, var(--chat-anchor-x, 50%), calc(100% - 1.4rem));
    bottom: -0.55rem;
    width: 0.95rem;
    height: 0.95rem;
    border-right: 2px solid #3c352e;
    border-bottom: 2px solid #3c352e;
    background: #faf8f5;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 3px 3px 0 rgba(60, 53, 46, 0.08);
}

.dawn-chat-window.is-below-bubble::after {
    top: -0.55rem;
    bottom: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 2px solid #3c352e;
    border-top: 2px solid #3c352e;
    box-shadow: -3px -3px 0 rgba(60, 53, 46, 0.08);
}

.dawn-chat-window.is-tutorial-active {
    z-index: 1500;
    box-shadow:
        6px 6px 0px rgba(60, 53, 46, 0.15),
        0 0 0 0.28rem rgba(255, 183, 0, 0.14),
        0 0 1.8rem rgba(255, 183, 0, 0.34);
}

.dawn-chat-window.is-following-bubble {
    pointer-events: none;
    opacity: 0.88;
}

/* 拖拽时的折叠状态 */
.dawn-chat-window.is-dragging-collapse {
    opacity: 0 !important;
    pointer-events: none;
    transform: scale(0.85);
}

/* 头部栏 */
.dawn-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 2px dashed rgba(60, 53, 46, 0.25);
    background: rgba(250, 248, 245, 0.6);
}

.dawn-chat-status-indicator {
    font-weight: bold;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

#dawn-chat-name {
    color: #b85c38; /* 温暖红棕色 */
    text-shadow: 1px 1px 0px rgba(0,0,0,0.05);
}

.dawn-status-tag {
    font-size: 0.6rem;
    font-weight: normal;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(60, 53, 46, 0.2);
}

/* 状态颜色的反差感反馈 */
.dawn-status-tag.panic {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.05);
    border-color: rgba(255, 59, 48, 0.25);
}

.dawn-status-tag.worry {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.05);
    border-color: rgba(255, 149, 0, 0.25);
}

.dawn-status-tag.steady {
    color: #34c759;
    background: rgba(52, 199, 89, 0.05);
    border-color: rgba(52, 199, 89, 0.25);
}

/* 关闭按钮 */
.dawn-chat-close-btn {
    border: 1.5px solid #3c352e;
    background: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3c352e;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 1px 1px 0 rgba(60, 53, 46, 0.2);
    transition: transform 0.1s, background-color 0.1s;
}

.dawn-chat-close-btn:hover {
    background-color: #ff3b30;
    color: #ffffff;
    transform: scale(1.05);
}

/* 对话体 */
.dawn-chat-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 10px 6px;
    gap: 8px;
}

.dawn-chat-avatar-column {
    flex-shrink: 0;
}

.dawn-pixel-avatar {
    color: #3c352e; /* 炭灰色小女孩 */
    width: 42px;
    height: 42px;
    filter: drop-shadow(1px 1px 0px rgba(0,0,0,0.1));
}

.dawn-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.dawn-chat-content::-webkit-scrollbar {
    width: 6px;
}
.dawn-chat-content::-webkit-scrollbar-track {
    background: transparent;
}
.dawn-chat-content::-webkit-scrollbar-thumb {
    background: rgba(60, 53, 46, 0.25);
    border-radius: 3px;
}
.dawn-chat-content::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 53, 46, 0.4);
}

.dawn-chat-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 消息手札小气泡 */
.dawn-message-bubble {
    padding: 7px 9px;
    border-radius: 4px;
    font-size: 0.68rem;
    line-height: 1.45;
    border: 1.5px solid #3c352e;
    position: relative;
    word-break: break-all;
    max-width: 90%;
    animation: bubble-fade-in 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes bubble-fade-in {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Dawn (手绘暖色橙气泡) */
.dawn-message-bubble.dawn {
    background: #ffffff;
    align-self: flex-start;
    border-left-width: 4px;
    border-left-color: #ff9500;
    box-shadow: 2px 2px 0px rgba(60, 53, 46, 0.08);
}

/* 玩家表情 (手绘浅蓝气泡) */
.dawn-message-bubble.protagonist {
    background: #f0f7ff;
    align-self: flex-end;
    border-right-width: 4px;
    border-right-color: #007aff;
    box-shadow: -2px 2px 0px rgba(60, 53, 46, 0.08);
}

/* 输入行 */
.dawn-chat-input-row {
    padding: 6px 10px 10px;
    border-top: 2px dashed rgba(60, 53, 46, 0.25);
    background: rgba(250, 248, 245, 0.6);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dawn-kaomoji-dock {
    display: flex;
    gap: 6px;
    justify-content: space-around;
}

.kaomoji-btn {
    flex: 1;
    background: #ffffff;
    border: 1.5px solid #3c352e;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.58rem;
    font-family: inherit;
    color: #3c352e;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 1px 1px 0px #3c352e;
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
}

.kaomoji-btn:hover {
    transform: translateY(-1px);
    box-shadow: 2px 2px 0px #3c352e;
    background-color: #faf8f5;
}

/* 自由聊天输入框（Gemini 对话用） */
.dawn-chat-free-input-container {
    display: flex;
    gap: 6px;
}

#dawn-chat-free-input {
    flex: 1;
    border: 1.5px solid #3c352e;
    background: #ffffff;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.65rem;
    font-family: inherit;
    color: #3c352e;
    outline: none;
}

#dawn-chat-free-input:focus {
    box-shadow: inset 0 0 3px rgba(255, 149, 0, 0.2);
    border-color: #ff9500;
}

#btn-dawn-send-chat {
    background: #ff9500;
    border: 1.5px solid #3c352e;
    color: #ffffff;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.65rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 1.5px 1.5px 0px #3c352e;
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
}

#btn-dawn-send-chat:hover {
    background-color: #e08500;
    transform: translateY(-0.5px);
    box-shadow: 2px 2px 0px #3c352e;
}
