* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
    overflow: hidden;
    color: #fff;
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 视频全屏背景 */
#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#video.active {
    opacity: 1;
}

/* 手势文字显示 */
#gesture-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 64px;
    font-weight: bold;
    text-align: center;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease, font-size 0.3s ease;
    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 100, 200, 0.6);
    pointer-events: none;
    color: #fff;
    -webkit-text-stroke: 2px rgba(255, 100, 180, 0.8);
    white-space: nowrap;
}

#gesture-text.visible {
    opacity: 1;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        filter: brightness(1.2);
    }
}

/* 星型磨砂玻璃UI */
#star-ui {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 220px;
    height: 220px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#star-ui::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    clip-path: polygon(
        50% 0%,
        61% 35%,
        98% 35%,
        68% 57%,
        79% 91%,
        50% 70%,
        21% 91%,
        32% 57%,
        2% 35%,
        39% 35%
    );
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    animation: starGlow 3s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.05),
            0 0 30px rgba(100, 200, 255, 0.1);
    }
    50% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.1),
            0 0 50px rgba(100, 200, 255, 0.3);
    }
}

/* 星角高亮粒子效果 */
#star-ui::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.8) 0%, transparent 15%),
        radial-gradient(circle at 98% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 12%),
        radial-gradient(circle at 79% 91%, rgba(255, 255, 255, 0.6) 0%, transparent 12%),
        radial-gradient(circle at 21% 91%, rgba(255, 255, 255, 0.6) 0%, transparent 12%),
        radial-gradient(circle at 2% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 12%);
    animation: cornerGlow 2s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes cornerGlow {
    0% {
        opacity: 0.5;
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
    }
}

.star-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    width: 140px;
}

.star-content h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.status-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.status-item .label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-item .value {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* 控制按钮 */
#controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(100, 200, 255, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
}

/* 手势说明 */
#gesture-guide {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 100;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.gesture-icon {
    font-size: 18px;
}

/* 响应式 */
@media (max-width: 768px) {
    #star-ui {
        width: 160px;
        height: 160px;
        top: 10px;
        right: 10px;
    }

    .star-content {
        width: 100px;
        padding: 15px;
    }

    .star-content h2 {
        font-size: 11px;
    }

    .status-item .label {
        font-size: 8px;
    }

    .status-item .value {
        font-size: 10px;
    }

    #gesture-guide {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90%;
        gap: 10px;
        padding: 10px 15px;
    }

    .guide-item {
        font-size: 10px;
    }

    #video {
        width: 120px;
        height: 90px;
    }

    #gesture-text {
        font-size: 48px;
    }
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(100, 200, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
