:root {
            --primary: #f0f0f0;
            --accent: #ffb86c; /* Subtle warm accent for tech */
            --bg-dark: #080504; /* Very deep warm black */
            --bg-light: #16110e; /* Deep warm chocolate/charcoal */
            --text-dim: #7a7a7a;
        }

        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: 'Inter', -apple-system, sans-serif;
            background: radial-gradient(circle at 50% 50%, var(--bg-light) 0%, var(--bg-dark) 100%);
            color: var(--primary);
        }

        /* Ambient Glow Layer */
        .ambient-glow {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 84vw;
            height: 84vw;
            max-width: 1080px;
            max-height: 1080px;
            /* Sunset Amber & Copper gradient fade (range increased by 20%, slower decay) */
            background: radial-gradient(circle, rgba(255, 184, 108, 0.6) 0%, rgba(255, 184, 108, 0.4) 35%, rgba(46, 28, 12, 0.8) 65%, rgba(8, 5, 4, 0) 90%);
            border-radius: 50%;
            z-index: 0;
            pointer-events: none;
            /* Only animate opacity, which is fully GPU accelerated and does not trigger repaint */
            opacity: 0.5;
            animation: glowPulse 10s ease-in-out infinite alternate;
            will-change: opacity;
        }

        @keyframes glowPulse {
            0% {
                opacity: 0.3;
            }
            100% {
                opacity: 0.7;
            }
        }

        /* 3D Canvas Container */
        #canvas-container {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: 1;
        }

        /* UI Overlay */
        #ui-layer {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: 10;
            pointer-events: none; /* Let clicks pass through to 3D canvas */
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 40px;
            box-sizing: border-box;
        }

        /* Background Huge Text */
        .bg-text {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            font-size: 28vw;
            font-weight: 900;
            color: rgba(255, 255, 255, 0.02);
            z-index: 0;
            white-space: nowrap;
            letter-spacing: -0.05em;
            pointer-events: none;
            user-select: none;
        }

        /* Header / Logo */
        .header {
            display: flex;
            justify-content: flex-end;
            align-items: flex-start;
        }

        .meta-info {
            font-size: 0.85rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
            text-align: right;
        }

        .title-container {
            position: absolute;
            top: 48%;
            left: 5%;
            transform: translateY(-50%);
            max-width: 480px;
        }

        h1 {
            position: relative;
            top: -24px;
            font-size: 3.2rem;
            font-weight: 800;
            line-height: 1.1;
            margin: 0 0 15px 0;
            background: linear-gradient(180deg, #fff 0%, #a0a0a0 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            white-space: nowrap;
        }

        .description {
            font-size: 0.9rem;
            color: #8a8a8a;
            line-height: 1.8;
        }

        /* Specs Panel */
        .specs-panel {
            position: absolute;
            top: 50%;
            right: 5%;
            transform: translateY(-50%);
            width: 260px;
        }

        .spec-item {
            display: flex;
            justify-content: space-between;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding: 12px 0;
            font-size: 0.85rem;
        }

        .spec-label { color: var(--text-dim); }
        .spec-value { font-weight: 700; text-align: right; }

        /* Gallery Button */
        .gallery-btn {
            margin-top: 40px;
            width: 100%;
            padding: 12px 0;
            background: rgba(255,255,255,0.03);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255,184,108,0.2);
            border-radius: 6px;
            color: var(--accent);
            font-family: 'Inter', -apple-system, sans-serif;
            font-size: 0.85rem;
            letter-spacing: 2px;
            cursor: pointer;
            pointer-events: auto;
            transition: all 0.3s ease;
            text-align: center;
        }

        .gallery-btn:hover {
            border-color: rgba(255,184,108,0.6);
            box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 15px rgba(255,184,108,0.15);
            text-shadow: 0 0 8px rgba(255,184,108,0.5);
            background: rgba(255,255,255,0.06);
        }

        /* Gallery Overlay */
        #gallery-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.92);
            backdrop-filter: blur(15px);
            z-index: 1000;
            display: none;
            flex-direction: column;
            pointer-events: auto;
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .gallery-header {
            padding: 30px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }

        .gallery-title {
            color: var(--accent);
            font-weight: 700;
            letter-spacing: 2px;
            font-size: 0.9rem;
        }

        .gallery-close, .lightbox-close, .lightbox-prev, .lightbox-next {
            background: transparent;
            border: none;
            color: #fff;
            font-size: 1.5rem;
            cursor: pointer;
            transition: color 0.3s, transform 0.3s;
        }

        .gallery-close:hover, .lightbox-close:hover {
            color: var(--accent);
            transform: scale(1.1) rotate(90deg);
        }

        .lightbox-prev:hover, .lightbox-next:hover {
            color: var(--accent);
            transform: scale(1.2);
        }

        .gallery-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 40px;
        }

        .gallery-grid {
            max-width: 1100px;
            margin: 0 auto;
            column-count: 2;
            column-gap: 20px;
        }

        .gallery-item {
            break-inside: avoid;
            margin-bottom: 20px;
            cursor: pointer;
            overflow: hidden;
            border-radius: 8px;
            position: relative;
        }

        .gallery-item img {
            width: 100%;
            display: block;
            transition: transform 0.5s ease, opacity 0.3s;
        }

        .gallery-item:hover img {
            transform: scale(1.03);
            opacity: 0.9;
        }

        /* Lightbox */
        #lightbox {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.98);
            z-index: 1100;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        #lightbox-img {
            max-width: 100vw;
            max-height: 100vh;
            object-fit: contain;
            user-select: none;
        }

        .lightbox-close { position: absolute; top: 30px; right: 40px; z-index: 20; }

        .lightbox-prev, .lightbox-next {
            position: absolute;
            top: 0;
            height: 100%;
            width: 30%;
            background: transparent;
            border: none;
            color: transparent; /* 默认隐藏 */
            font-size: 4rem;
            cursor: pointer;
            transition: color 0.3s;
            z-index: 10;
            display: flex;
            align-items: center;
        }

        .lightbox-prev {
            left: 0;
            justify-content: flex-start;
            padding-left: 50px;
        }

        .lightbox-next {
            right: 0;
            justify-content: flex-end;
            padding-right: 50px;
        }

        .lightbox-prev:hover, .lightbox-next:hover {
            color: var(--accent); /* 滑动到区域时显示 */
            text-shadow: 0 0 15px rgba(255,184,108,0.5);
        }

        /* Interaction Prompt */
        .prompt {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.9rem;
            color: var(--text-dim);
            letter-spacing: 1px;
            pointer-events: none;
            text-align: center;
        }

        .mouse-icon {
            width: 20px; height: 30px;
            flex-shrink: 0;
            border: 2px solid var(--text-dim);
            border-radius: 12px;
            position: relative;
        }

        .prompt-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
        .prompt-copy span { white-space: nowrap; }

        .mouse-wheel {
            width: 4px; height: 6px;
            background: var(--text-dim);
            border-radius: 2px;
            position: absolute;
            top: 4px; left: 50%;
            transform: translateX(-50%);
            animation: scroll 1.5s infinite;
        }

        @keyframes scroll {
            0% { top: 4px; opacity: 1; }
            100% { top: 14px; opacity: 0; }
        }

        /* Loading Screen */
        #loader {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: var(--bg-dark);
            z-index: 100;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #fff;
            transition: opacity 0.8s ease;
        }

        .progress-bar {
            width: 200px; height: 2px;
            background: rgba(255,255,255,0.1);
            margin-top: 20px;
            position: relative;
            overflow: hidden;
        }

        .progress-fill {
            position: absolute;
            top: 0; left: 0; height: 100%;
            width: 0%;
            background: var(--accent);
            transition: width 0.1s;
        }

        /* Error Message Overlay */
        #cors-error {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(10, 5, 5, 0.95);
            z-index: 9999;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #fff;
            text-align: center;
            padding: 20px;
            backdrop-filter: blur(10px);
        }
        #cors-error h2 { color: #ff5555; font-size: 2rem; margin-bottom: 20px; }
        #cors-error p { font-size: 1.2rem; line-height: 1.8; color: #ccc; max-width: 600px; }
        #cors-error code { background: #333; padding: 4px 8px; border-radius: 4px; color: #ffb86c; }

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button { min-height: 44px; min-width: 44px; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.bg-text { width: 100%; overflow: hidden; text-align: center; }
.prompt { background: transparent; border: 0; font: inherit; }
#canvas-container { left: 0; top: 0; width: 100%; height: 100%; pointer-events: auto; }
.header { position: relative; z-index: 2; }
.title-container, .specs-panel { z-index: 2; }
.prompt { z-index: 3; }
#model-status { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; padding: 20px; text-align: center; z-index: 2; }
#model-status[hidden] { display: none; }
#load-model { padding: 12px 20px; border: 1px solid var(--accent); border-radius: 8px; background: #251c15; color: #ffcf9a; cursor: pointer; }
#canvas-container canvas { display: block; max-width: 100%; cursor: grab; }
#canvas-container canvas:active { cursor: grabbing; }
.gallery-item { display: block; width: 100%; padding: 0; border: 0; background: #17110d; }
.gallery-close, .lightbox-close { min-width: 44px; min-height: 44px; }
@media (max-width: 1180px) {
    html, body { height: auto; min-height: 100%; overflow: visible; }
    .ambient-glow { position: fixed; }
    .bg-text { display: none; }
    #ui-layer { position: relative; height: auto; padding: 24px; gap: 28px; pointer-events: auto; }
    .header { gap: 16px; flex-wrap: wrap; }
    .meta-info { font-size: .75rem; }
    .title-container, .specs-panel { position: static; transform: none; width: 100%; max-width: 760px; margin: 0 auto; }
    h1 { top: -14px; font-size: 2.4rem; white-space: normal; }
    .description { font-size: 1rem; }
    .description br { display: none; }
    .description span { display: block; margin-top: 16px; }
    #canvas-container { position: relative; inset: auto; order: 0; width: 100%; height: 440px; }
    .prompt { position: static; transform: none; align-self: center; }
    .gallery-scroll { padding: 16px; }
    .gallery-header { padding: 16px; }
    .gallery-title { font-size: 1rem; }
    .lightbox-close { top: 12px; right: 12px; }
}
@media (max-width: 480px) {
    #ui-layer { padding: 18px; }
    #canvas-container { height: 330px; }
    .gallery-grid { column-count: 1; }
    .lightbox-prev, .lightbox-next { padding: 12px; width: 20%; color: #ffb86c; font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.header { pointer-events: auto; }

/* Use the entire viewport, then fit the camera to this new canvas size. */
html.is-immersive, html.is-immersive body { overflow: hidden; }
html.is-immersive #canvas-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}
html.is-immersive .header { pointer-events: none; }
html.is-immersive .title-container,
html.is-immersive .specs-panel { pointer-events: none; }
html.is-immersive .prompt {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 32px);
    transform: translateX(-50%);
    z-index: 21;
    color: #b0a294;
}
