/* ========================================
   VR 全景漫游 - 样式文件
   ======================================== */

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

body {
    overflow: hidden;
    background-color: #000;
    touch-action: none;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    display: block;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: opacity 0.5s;
}

#loading h2 {
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 20px;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: #4CAF50;
    transition: width 0.2s;
}

#loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: #aaa;
}

.ui-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 30px;
    z-index: 100;
    text-align: center;
    pointer-events: none;
}

#header h1 {
    margin: 0;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#site-subtitle {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.8;
}

#controls-group {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 20px;
    user-select: none;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#btn-cache.rotating i {
    animation: spin 1s linear infinite;
}

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

#info-modal,
#cache-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 400px;
    max-width: 90%;
    padding: 25px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

#info-modal.show,
#cache-modal.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

#info-modal h2,
#cache-modal h2 {
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    font-size: 20px;
}

#info-modal p,
#cache-modal p {
    line-height: 1.6;
    font-size: 14px;
    color: #ddd;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover {
    color: #fff;
}

#cache-modal button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

#cache-modal button:hover {
    opacity: 0.9;
}

#cancel-cache {
    background: #666;
    color: #fff;
}

#confirm-cache {
    background: #4CAF50;
    color: #fff;
}

#scene-selector {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 140px;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

#scene-selector::-webkit-scrollbar {
    display: none;
}

.scene-item {
    flex: 0 0 auto;
    width: 100px;
    margin-right: 15px;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.scene-item:hover {
    transform: scale(1.05);
}

.scene-item.active {
    border-color: #4CAF50;
    transform: scale(1.1);
}

.scene-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scene-item .label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 5px 5px;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 768px) {
    #header h1 { font-size: 18px; }
    #site-subtitle { font-size: 12px; }
    #scene-selector { height: 100px; bottom: 10px; }
    .scene-item { width: 80px; margin-right: 10px; }
    #controls-group { right: 10px; top: auto; bottom: 160px; transform: none; flex-direction: row; }
    .ctrl-btn { width: 36px; height: 36px; font-size: 18px; }
    #info-modal, #cache-modal { width: 90%; padding: 20px; }
}