/* 太阳系模型样式 - 移动端优化版 */

/* 控制按钮区域 */
.solar-system-controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.solar-system-controls button {
    background: #4eb289;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.solar-system-controls button:hover {
    background: #3a8f6f;
    transform: translateY(-2px);
}

.solar-system-controls button:active {
    transform: translateY(0);
}

.solar-system-controls button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.solar-system-controls button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.solar-system-controls button:active::before {
    width: 100%;
    height: 100%;
}

/* 太阳系容器 */
.solar-system-container {
    width: 100%;
    margin: 20px 0;
    border: 2px solid #4eb289;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    animation: slideDown 0.5s ease;
    box-shadow: 0 8px 32px rgba(78, 178, 137, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 600px;
    }
}

/* 太阳系头部 */
.solar-system-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4eb289;
    position: relative;
}

.solar-system-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4eb289, transparent);
}

.solar-system-header h4 {
    color: #4eb289;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.solar-system-tips {
    color: #ccc;
    font-size: 12px;
    font-style: italic;
    opacity: 0.8;
}

/* iframe 包装器 */
.solar-system-iframe-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    background: #000;
    overflow: hidden;
}

.solar-system-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}

/* 全屏模式样式 */
.solar-system-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    animation: none;
    border: none;
}

.solar-system-fullscreen .solar-system-iframe-wrapper {
    height: calc(100vh - 60px);
}

.solar-system-fullscreen .solar-system-header {
    position: relative;
    z-index: 10000;
}

/* 加载动画 */
.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    color: #4eb289;
    font-size: 16px;
    flex-direction: column;
    gap: 15px;
}

.loading-spinner {
    border: 3px solid #333;
    border-top: 3px solid #4eb289;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .solar-system-controls {
        margin: 15px 0;
        gap: 8px;
    }

    .solar-system-controls button {
        padding: 12px 16px;
        font-size: 13px;
        min-width: 100px;
        border-radius: 25px;
        font-weight: 500;
    }

    .solar-system-container {
        margin: 15px 0;
        border-radius: 15px;
        box-shadow: 0 4px 20px rgba(78, 178, 137, 0.3);
    }

    .solar-system-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 15px;
    }

    .solar-system-header h4 {
        font-size: 15px;
    }

    .solar-system-tips {
        font-size: 11px;
        line-height: 1.4;
    }

    .solar-system-iframe-wrapper {
        height: 400px;
    }

    .solar-system-fullscreen .solar-system-iframe-wrapper {
        height: calc(100vh - 70px);
    }

    .loading-animation {
        height: 400px;
        font-size: 14px;
    }

    .loading-spinner {
        width: 35px;
        height: 35px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .solar-system-controls {
        flex-direction: column;
        gap: 6px;
    }

    .solar-system-controls button {
        width: 100%;
        max-width: 280px;
        padding: 14px 20px;
        font-size: 14px;
        min-width: auto;
    }

    .solar-system-container {
        border-radius: 12px;
        margin: 10px 0;
    }

    .solar-system-header {
        padding: 10px 12px;
    }

    .solar-system-header h4 {
        font-size: 14px;
    }

    .solar-system-tips {
        font-size: 10px;
    }

    .solar-system-iframe-wrapper {
        height: 300px;
    }

    .solar-system-fullscreen .solar-system-iframe-wrapper {
        height: calc(100vh - 60px);
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .solar-system-controls {
        flex-direction: row;
        gap: 6px;
    }

    .solar-system-controls button {
        width: auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .solar-system-iframe-wrapper {
        height: calc(100vh - 120px);
    }

    .solar-system-header {
        padding: 8px 15px;
    }

    .solar-system-header h4 {
        font-size: 14px;
    }

    .solar-system-tips {
        font-size: 10px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .solar-system-controls button:hover {
        background: #4eb289;
        transform: none;
    }

    .solar-system-controls button:active {
        background: #3a8f6f;
        transform: scale(0.95);
    }

    .solar-system-controls button {
        padding: 14px 18px;
        font-size: 15px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .solar-system-container {
        border-width: 1px;
    }

    .solar-system-header {
        border-bottom-width: 1px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .solar-system-container {
        background: #0a0a0a;
        border-color: #4eb289;
    }

    .solar-system-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    }

    .loading-animation {
        background: radial-gradient(circle at center, #0a0a0a 0%, #000 100%);
    }
}

/* 无障碍访问优化 */
@media (prefers-reduced-motion: reduce) {
    .solar-system-container {
        animation: none;
    }

    .solar-system-controls button {
        transition: none;
    }

    .loading-spinner {
        animation: none;
    }

    .loading-text {
        animation: none;
    }
}

/* 打印样式 */
@media print {
    .solar-system-controls {
        display: none;
    }

    .solar-system-container {
        break-inside: avoid;
        border: 1px solid #666;
    }

    .solar-system-iframe-wrapper {
        height: 400px;
        background: #f0f0f0;
    }

    .solar-system-iframe-wrapper::after {
        content: '太阳系3D模型 - 请在电子设备上查看交互效果';
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: #666;
        font-size: 16px;
    }
}

/* 性能优化 */
.solar-system-container * {
    box-sizing: border-box;
}

.solar-system-iframe-wrapper {
    contain: layout style paint;
    will-change: transform;
}

.solar-system-fullscreen {
    contain: layout style paint;
    will-change: transform;
}

/* 加载状态优化 */
.loading-animation {
    contain: layout style paint;
}

.loading-spinner {
    contain: layout style paint;
    will-change: transform;
}

/* 按钮状态指示 */
.solar-system-controls button.active {
    background: #FFD700;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.solar-system-controls button.loading {
    background: #666;
    cursor: wait;
    pointer-events: none;
}

.solar-system-controls button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* 错误状态 */
.solar-system-error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    background: #1a1a1a;
    color: #ff6b6b;
    font-size: 16px;
    flex-direction: column;
    gap: 15px;
}

.solar-system-error .error-icon {
    font-size: 48px;
    opacity: 0.7;
}

.solar-system-error .error-message {
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .solar-system-error {
        height: 400px;
        font-size: 14px;
    }

    .solar-system-error .error-icon {
        font-size: 36px;
    }
}

/* 移动端太阳系按钮特殊样式 */
@media (max-width: 768px) {
    .solar-system-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .solar-system-controls button {
        transition: all 0.3s ease;
    }
    
    /* 移动端新标签页按钮特殊效果 */
    .solar-system-controls button[onclick="openSolarSystemNewTab()"] {
        background: linear-gradient(135deg, #4eb289, #5bc29a) !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 15px rgba(78, 178, 137, 0.3) !important;
        position: relative;
        overflow: hidden;
    }
    
    .solar-system-controls button[onclick="openSolarSystemNewTab()"]:hover {
        background: linear-gradient(135deg, #5bc29a, #6cd4ab) !important;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(78, 178, 137, 0.4) !important;
    }
    
    .solar-system-controls button[onclick="openSolarSystemNewTab()"]:active {
        transform: translateY(0);
    }
    
    /* 移动端隐藏其他按钮 */
    .mobile-device #loadSolarSystemBtn,
    .mobile-device #unloadSolarSystemBtn,
    .mobile-device #fullscreenBtn {
        display: none !important;
    }
    
    /* 移动端隐藏太阳系容器 */
    .mobile-device #solarSystemContainer {
        display: none !important;
    }
}

/* 桌面端按钮样式保持不变 */
@media (min-width: 769px) {
    .desktop-device .solar-system-controls button[onclick="openSolarSystemNewTab()"] {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 10px 15px !important;
        font-size: 14px !important;
        font-weight: normal !important;
        border-radius: 5px !important;
        box-shadow: none !important;
        background: #4eb289 !important;
    }
}

/* 移动端提示信息优化 */
@media (max-width: 768px) {
    .project-description {
        text-align: center;
        padding: 20px 15px;
    }
    
    .project-description p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 添加移动端专用提示 */
    .project-description::after {
        content: "\A💡 移动端建议在新标签页中体验完整功能";
        white-space: pre;
        display: block;
        margin-top: 15px;
        padding: 10px;
        background: rgba(78, 178, 137, 0.1);
        border: 1px solid rgba(78, 178, 137, 0.3);
        border-radius: 8px;
        font-size: 12px;
        color: #5bc29a;
        text-align: center;
    }
}