/* SoulPlanet模块样式 - 包含home.html的所有样式 */

/* 毛玻璃UI样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    /* 星空背景 - 深蓝色渐变 + 星星动画 */
    background: radial-gradient(2px 2px at 20px 30px, #eee, transparent), radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent), radial-gradient(1px 1px at 90px 40px, #fff, transparent), radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent), radial-gradient(2px 2px at 160px 30px, #ddd, transparent), linear-gradient(135deg, #0c0c1e 0%, #1a1a3e 25%, #2d1b69 50%, #1a1a3e 75%, #0c0c1e 100%);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px, 200px 200px, 400% 400%;
    background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px, 0% 50%;
    animation: twinkle 4s ease-in-out infinite, gradientShift 20s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 星空闪烁动画 */
@keyframes twinkle {
    0%,
    100% {
        background-position: 0 0, 50px 50px, 100px 100px, 150px 150px, 200px 200px, 0% 50%;
    }
    50% {
        background-position: 10px 10px, 60px 60px, 110px 110px, 160px 160px, 210px 210px, 0% 50%;
    }
}

/* 动态背景动画 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 星空主题浮动背景元素 */
body::before,
body::after {
    content: "";
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    /* 星空主题光晕效果 */
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 25s ease-in-out infinite;
    z-index: -1;
}

body::before {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

/* 流星效果 */
@keyframes shooting-star {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(100vh + 100px)) rotate(45deg);
        opacity: 0;
    }
}

/* 添加流星元素 */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, transparent, #fff, transparent);
    border-radius: 50%;
    animation: shooting-star 3s linear infinite;
    animation-delay: 2s;
    z-index: 0;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* 星空装饰元素 */
.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star-field::before,
.star-field::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 25px 25px, #fff, transparent), radial-gradient(1px 1px at 50px 50px, #fff, transparent), radial-gradient(1px 1px at 75px 75px, #fff, transparent), radial-gradient(1px 1px at 100px 100px, #fff, transparent), radial-gradient(1px 1px at 125px 125px, #fff, transparent), radial-gradient(1px 1px at 150px 150px, #fff, transparent), radial-gradient(1px 1px at 175px 175px, #fff, transparent), radial-gradient(1px 1px at 200px 200px, #fff, transparent);
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite;
}

.star-field::after {
    background-image: radial-gradient(1px 1px at 10px 10px, #fff, transparent), radial-gradient(1px 1px at 30px 30px, #fff, transparent), radial-gradient(1px 1px at 60px 60px, #fff, transparent), radial-gradient(1px 1px at 90px 90px, #fff, transparent), radial-gradient(1px 1px at 120px 120px, #fff, transparent), radial-gradient(1px 1px at 150px 150px, #fff, transparent), radial-gradient(1px 1px at 180px 180px, #fff, transparent), radial-gradient(1px 1px at 210px 210px, #fff, transparent);
    background-size: 220px 220px;
    animation-delay: 2s;
}

/* 主要内容区域 */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 40px);
    position: relative;
}

/* 透明3D展示容器 */
.module-container {
    /* 透明背景，让星空背景显示 */
    background: transparent;
    border: none;
    border-radius: 24px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: calc(100vh - 80px);
}

.module-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 移除高光效果，让星空背景完全显示 */
    background: transparent;
    border-radius: 24px;
    z-index: 1;
    pointer-events: none;
}

.module-container:hover {
    transform: translateY(-5px);
    /* 简化悬停效果 */
    background: rgba(255, 255, 255, 0.05);
}

/* 3D展示区域 */
.food-globe-container {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: transparent; /* 移除背景色，让body的渐变背景显示 */
    border: none; /* 移除边框 */
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main {
        padding: 20px;
    }
    .module-container {
        height: calc(100vh - 40px);
    }
}

@media (max-width: 768px) {
    .module-container {
        padding: 20px;
    }
}

/* SoulPlanet模块样式 */
.soul-planet-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: transparent; /* 使用透明背景，让body的渐变背景显示 */
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.soul-planet-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Three.js Canvas */
.soul-planet-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    /* 性能优化 */
    will-change: transform;
    backface-visibility: hidden;
}

/* 简化加载状态 */
.soul-planet-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
    z-index: 100;
    /* 简化背景 */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
}

.soul-planet-loading .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.soul-planet-loading p {
    font-size: 1.1rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.soul-planet-loading .loading-progress {
    font-size: 0.9rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 简化错误状态 */
.soul-planet-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff6b6b;
    /* 简化背景 */
    background: rgba(255, 107, 107, 0.2);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    z-index: 100;
}

.soul-planet-error h3 {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.soul-planet-error button {
    margin-top: 15px;
    padding: 12px 24px;
    /* 拟物风格按钮 */
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 107, 107, 0.2) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.soul-planet-error button:hover {
    transform: translateY(-2px);
    /* 拟物风格悬停效果 */
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.3), 0 2px 4px rgba(255, 107, 107, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.4) 0%, rgba(255, 107, 107, 0.3) 100%);
}

/* 简化控制面板 */
.soul-planet-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    /* 简化背景 */
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.soul-planet-controls h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.soul-planet-controls button {
    margin: 5px;
    padding: 10px 18px;
    /* 拟物风格按钮 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.soul-planet-controls button:hover {
    transform: translateY(-2px);
    /* 拟物风格悬停效果 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
}

/* 简化信息面板 */
.soul-planet-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    /* 简化背景 */
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    color: #ffffff;
    font-size: 0.9rem;
}

.soul-planet-info h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.soul-planet-info .info-item {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
}

.soul-planet-info .info-label {
    color: rgba(255, 255, 255, 0.8);
}

.soul-planet-info .info-value {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .soul-planet-container {
        height: 400px;
    }

    .soul-planet-controls {
        top: 10px;
        right: 10px;
        padding: 10px;
    }

    .soul-planet-controls button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .soul-planet-info {
        bottom: 10px;
        left: 10px;
        padding: 10px;
        font-size: 0.8rem;
    }

    /* 移动端返回按钮优化 */
    .back-home-button {
        top: 10px;
        left: 10px;
    }

    .back-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .back-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .soul-planet-container {
        height: 300px;
    }

    .soul-planet-controls {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px;
        text-align: center;
    }

    .soul-planet-info {
        position: relative;
        bottom: auto;
        left: auto;
        margin: 10px;
        text-align: center;
    }

    /* 小屏幕返回按钮优化 */
    .back-home-button {
        top: 8px;
        left: 8px;
    }

    .back-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .back-icon {
        width: 14px;
        height: 14px;
    }

    .back-text {
        display: none; /* 在小屏幕上只显示图标 */
    }
}

/* 星球颜色主题 */
.planet-color-red {
    --planet-color: #ff6b6b;
}

.planet-color-orange {
    --planet-color: #ffa726;
}

.planet-color-green {
    --planet-color: #66bb6a;
}

.planet-color-blue {
    --planet-color: #42a5f5;
}

.planet-color-purple {
    --planet-color: #ab47bc;
}

/* 动画效果 */
@keyframes planetGlow {
    0%,
    100% {
        box-shadow: 0 0 20px var(--planet-color, #42a5f5);
    }
    50% {
        box-shadow: 0 0 30px var(--planet-color, #42a5f5), 0 0 40px rgba(255, 255, 255, 0.3);
    }
}

@keyframes planetPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 选中状态 */
.planet-selected {
    animation: planetPulse 1s ease-in-out infinite;
}

/* 悬停效果 */
.planet-hover {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* 防止交互冲突 */
.food-globe-container {
    pointer-events: auto !important;
    z-index: 10;
}

/* 防止模态框遮挡 */
.modal {
    z-index: 20;
}

/* 确保文字标签容器正确显示 */
.soul-planet-container {
    position: relative;
    z-index: 1;
}

/* 优化文字渲染 */
.soul-planet-container canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 高质量渲染模式 */
.soul-planet-container.high-quality canvas {
    image-rendering: auto;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

/* 文字标签容器优化 */
.text-label-container {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

/* 确保文字清晰度 */
.soul-planet-container {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: none;
}

/* 拟物风格返回首页按钮 */
.back-home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    /* 简化背景 */
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    /* 简化悬停效果 */
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    text-decoration: none;
}

.back-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.back-btn:hover .back-icon {
    transform: translateX(-2px);
}

.back-text {
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

/* 调试按钮样式优化 */
.soul-planet-debug-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.soul-planet-debug-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
