body { 
    margin: 0; 
    overflow: hidden; 
    background: #000; 
    font-family: 'Arial Black', sans-serif; 
}

canvas {
    display: block;
}

/* ==========================================
   阳光房原有 UI 样式
========================================== */

.y2k-marquee {
    position: fixed;
    bottom: 20px;
    left: -2%;
    width: 104%;
    background: #FF1493;
    border-top: 4px dashed #FFD700;
    border-bottom: 4px dashed #FFD700;
    color: #FFD700;
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    padding: 10px 0;
    z-index: 5;
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.8);
    text-shadow: 2px 2px 0px #000;
    transform: rotate(-2deg); 
}

.y2k-marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.floating-cart {
    position: fixed;
    right: 30px;
    bottom: 100px;
    font-size: 35px;
    background: #00F5FF;
    border: 4px solid #000;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 6px 6px 0px #FF1493;
    z-index: 6;
    cursor: pointer;
    animation: floatCart 2s ease-in-out infinite;
    transition: transform 0.2s;
}

.floating-cart:hover {
    transform: scale(1.1);
}

.floating-cart .badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #FF4500;
    color: white;
    font-size: 14px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 10px;
    border: 2px solid #000;
}

@keyframes floatCart {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

/* ==========================================
   情绪提取器面板及背景样式
========================================== */

.dispenser-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.image-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 8;
    background: #000;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    animation: intenseFlicker 3s infinite;
    transition: background-image 0.2s ease-in-out;
}

@keyframes intenseFlicker {
    0% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.2);
        transform: scale(1);
    }

    5% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.2);
    }

    6% {
        opacity: 0.9;
        filter: brightness(1.5) contrast(1.5);
        transform: scale(1.02);
    }

    7% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.2);
        transform: scale(1);
    }

    45% {
        opacity: 0.7;
    }

    46% {
        opacity: 0.2;
        filter: brightness(1.2);
    }

    47% {
        opacity: 0.8;
        filter: brightness(2) contrast(2);
    }

    48% {
        opacity: 0.7;
    }

    80% {
        opacity: 0.7;
    }

    81% {
        opacity: 0.5;
        filter: brightness(0.8);
        transform: scale(1.01) skewX(2deg);
    }

    83% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.2);
        transform: scale(1) skewX(0deg);
    }

    100% {
        opacity: 0.7;
        filter: brightness(0.6) contrast(1.2);
    }
}

.cinematic-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.12'/%3E%3C/svg%3E");

    pointer-events: none;
    mix-blend-mode: overlay;
}

.cinematic-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: radial-gradient(circle, transparent 30%, rgba(0,0,0,0.95) 120%);
    pointer-events: none;
}

/* ==========================================
   提取器 UI 面板
========================================== */

#y2k-ui {
    font-family: 'Press Start 2P', monospace; 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 90%;
    max-width: 550px;

    background: rgba(192, 192, 192, 0.95);
    border: 3px solid;
    border-color: #fff #808080 #808080 #fff;

    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.6), -8px -8px 0px rgba(0, 0, 0, 0.4);
    z-index: 10;

    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.title-bar {
    background: linear-gradient(90deg, #8B0000, #FF0000);
    padding: 8px 10px;
    color: white;
    font-size: 12px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-btns span {
    background: #c0c0c0;
    color: black;
    padding: 2px 6px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    cursor: pointer;
}

.title-bar-btns span:active {
    border-color: #000 #fff #fff #000;
}

.content {
    padding: 25px 30px;
    background-image: radial-gradient(#666 1px, transparent 1px);
    background-size: 4px 4px;
    text-align: center;
}

#main-title {
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

h2.glitch-title {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ==========================================
   3D 视窗 + 视频层
========================================== */

#model-viewport {
    width: 100%;
    height: 320px;
    margin: 0 auto 25px auto;
    background: transparent; 
    border: 4px solid;
    border-color: #808080 #fff #fff #808080;
    position: relative;
    overflow: hidden;
    cursor: grab;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.9); 
}

/* 让 three.js 的 canvas 固定在底层 */
#model-viewport canvas {
    position: absolute !important;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}

/* 短剧小视频：强制盖在 3D canvas 上面 */
#inner-video {
    position: absolute;
    top: 0;
    right: 0;

    width: 45%;
    height: 100%;
    object-fit: cover;

    z-index: 80 !important;
    opacity: 0;
    display: block;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.3s ease-in-out;

    border-left: 2px solid #00FFFF;
    box-shadow: -5px 0 15px rgba(0,255,255,0.4);
    filter: contrast(1.2) saturate(1.2);
    background: #000;
}

#inner-video.visible {
    opacity: 1;
    visibility: visible;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 30px;
    height: 30px;

    background: rgba(0, 0, 0, 0.7);
    color: #00FFFF;
    border: 2px solid #00FFFF; 

    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer; 
    z-index: 100;
    font-size: 14px;

    box-shadow: 2px 2px 0px #FF00FF;
    transition: all 0.2s;
    user-select: none;
}

.nav-btn:active {
    box-shadow: 0px 0px 0px #FF00FF;
    transform: translateY(-50%) translate(2px, 2px);
}

.nav-btn:hover {
    background: #00FFFF;
    color: #000;
}

.nav-left {
    left: 10px;
}

.nav-right {
    right: 10px;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;

    z-index: 90;
    pointer-events: none;
    opacity: 0.6;
}

.hud-text {
    position: absolute;
    color: #00FFFF;
    font-size: 8px;
    z-index: 110;
    pointer-events: none;
    text-shadow: 0 0 5px #000;
    transition: all 0.3s;
}

.hud-top-left {
    top: 10px;
    left: 10px;
    color: #FF0000;
}

.hud-top-right {
    top: 10px;
    right: 10px;
}

.hud-bottom-left {
    bottom: 10px;
    left: 10px;
}

.hud-bottom-right {
    bottom: 10px;
    right: 10px;
    color: #FFFF00;
}

.blink {
    animation: blinker 0.5s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #FF0000;
    z-index: 95;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.c-tl {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.c-tr {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
}

.c-bl {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
}

.c-br {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: 30px;
    height: 30px;

    z-index: 96;
    pointer-events: none;
    opacity: 0.3;
    transition: left 0.3s;
}

.crosshair::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;

    width: 30px;
    height: 1px;

    background: #FF0000;
}

.crosshair::after {
    content: '';
    position: absolute;
    top: 0;
    left: 14px;

    width: 1px;
    height: 30px;

    background: #FF0000;
}

/* ==========================================
   Loader + Button
========================================== */

.warning-marquee {
    background: #000;
    color: #FF0000;
    font-size: 8px;
    padding: 5px;
    margin-bottom: 15px;
    border: 2px solid #808080;
}

#loader-container {
    position: relative;
    width: 100%;
    margin: 0 auto 30px auto;
}

.loader-track {
    width: 100%;
    height: 20px;
    background: #000;
    border: 3px solid;
    border-color: #fff #808080 #808080 #fff;
    position: relative;
}

.loader-fill {
    height: 100%;
    background: repeating-linear-gradient(-45deg, #00FFFF, #00FFFF 10px, #111 10px, #111 20px);
    width: 0%;
    animation: loadProgress 4s infinite linear;
    transition: background 0.5s ease;
}

.loader-icon {
    position: absolute;
    top: -22px;
    left: 0%;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    pointer-events: none;
    animation: iconProgress 4s infinite linear;
}

.loader-icon canvas {
    display: block;
    outline: none;
    filter: drop-shadow(0px 0px 8px #000);
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes iconProgress {
    0% {
        left: 0%;
    }

    100% {
        left: 100%;
    }
}

.loader-text {
    color: #FFFF00;
    font-size: 10px;
    margin-top: 10px;
    text-shadow: 1px 1px 0px #000;
}

.btn-container {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.y2k-btn {
    flex: 1;
    padding: 15px 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    border: 3px solid #000;
    transition: all 0.1s;
    height: 46px;
}

.buy-btn {
    background: #FF1493;
    color: #FFFFFF;
    text-shadow: 1px 1px 0px #000;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    padding: 0;
}

.buy-btn span {
    display: block;
    transform: translateY(2px);
    position: relative;
    z-index: 2;
}

.detail-btn {
    background: #FFFF00;
    color: #000;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

.exit-btn {
    background: #e0e0e0;
    color: #000;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

.y2k-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #000;
}

/* ==========================================
   动效 + 信息弹窗
========================================== */

@keyframes shake {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translate(calc(-50% - 2px), calc(-50% - 2px)) rotate(-1deg);
    }

    20%, 40%, 60%, 80% {
        transform: translate(calc(-50% + 2px), calc(-50% + 2px)) rotate(1deg);
    }
}

.shaking {
    animation: shake 0.2s infinite !important;
}

.glitch-bg .image-bg-container {
    filter: invert(1) hue-rotate(90deg) contrast(1.5);
}

#sys-msg {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    background: #00FFFF;
    padding: 20px;
    border: 4px solid #000;

    font-size: 12px;
    z-index: 10000;
    line-height: 1.8;

    box-shadow: 8px 8px 0px #FF00FF;
    text-align: center;
    min-width: 250px;
}

@keyframes msgPop {
    0% {
        transform: translate(-50%, -20px) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
}

.show-anim {
    animation: msgPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.ingredient-list {
    text-align: left;
    margin-top: 10px;
    width: 100%;
}

.ing-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px dashed #000;
    padding: 6px 0;
    opacity: 0;
    animation: slideInRight 0.4s forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(30px) skewX(-10deg);
        opacity: 0;
    }

    to {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
}