/* --- START OF FILE view/view.css --- */

:root {
    --ui-bg-color: rgba(20, 20, 20, 0.6);
    --ui-bg-light: rgba(40, 40, 40, 0.8);
    --text-primary: #ffffff;
    --accent-blue: #3498db;
    --border-color: rgba(255, 255, 255, 0.2);
    --right-bar-width: 90px; 
}

* { box-sizing: border-box; }

body, html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0; padding: 0;
    width: 100vw; height: 100vh; 
    background-color: #000; color: var(--text-primary); 
    overflow: hidden; 
    position: fixed; 
    inset: 0;
    -webkit-text-size-adjust: 100%;
}

.view-container { 
    width: 100%; height: 100%; 
    position: relative; 
    overflow: hidden;
}

#pano { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100% !important; 
    height: 100% !important; 
    z-index: 0; 
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transform-origin: 0 0;
}

/* --- 顶部栏 --- */
.view-top-bar { 
    position: absolute; top: 0; left: 0; right: 0; 
    height: calc(60px + env(safe-area-inset-top)); 
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: env(safe-area-inset-top) 24px 0 24px; 
    z-index: 100; pointer-events: none; 
}

.group-title { 
    font-size: 22px; font-weight: 500; color: var(--text-primary); 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); pointer-events: auto; 
}

/* --- 音乐按钮 --- */
.music-button { 
    position: absolute;
    right: 20px;
    top: calc(15px + env(safe-area-inset-top));
    width: 36px; height: 36px;
    cursor: pointer; user-select: none; 
    opacity: 0.9; transition: opacity 0.2s; pointer-events: auto; 
    display: flex; align-items: center; justify-content: center;
    background: transparent; 
}
.music-button:hover { opacity: 1; transform: scale(1.1); }
.music-button img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.music-button.playing { animation: spin 3s linear infinite; opacity: 1; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- 返回按钮 (左上角) --- */
.return-btn {
    position: absolute;
    left: 20px;
    top: calc(15px + env(safe-area-inset-top));
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 110;
    pointer-events: auto;
    transition: transform 0.2s;
    /* 【新增】默认不显示 (针对PC) */
    display: none; 
}

@media (max-width: 1024px) {
    /* 在移动端/平板端显示返回按钮 */
    .return-btn {
        display: block; 
    }
}
.return-btn:hover { transform: scale(1.1); }
.return-btn img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

/* --- 左侧栏 (调整位置) --- */
.view-left-bar { 
    position: absolute; left: 0; top: 55%; 
    transform: translateY(-50%); 
    display: flex; flex-direction: column; gap: 15px; z-index: 100; pointer-events: auto; 
    /* 调整padding让图标更靠左 */
    padding-left: calc(10px + env(safe-area-inset-left)); 
}

/* --- 功能按钮样式 (增加底色) --- */
.action-button { 
    width: 44px; height: 44px; 
    background-color: rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: transform 0.2s, background-color 0.2s; user-select: none; 
    backdrop-filter: blur(4px);
}
.action-button:hover { 
    transform: scale(1.1); 
    background-color: rgba(0, 0, 0, 0.6); 
    border-color: rgba(255, 255, 255, 0.5);
}
.action-button img {
    width: 65%; 
    height: 65%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* --- 右侧栏 --- */
.view-right-column {
    position: absolute; right: 0; top: 0; bottom: 0; width: var(--right-bar-width);
    display: flex; align-items: center; justify-content: center; z-index: 99;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    pointer-events: none;
    padding-right: env(safe-area-inset-right);
}
.view-right-column.collapsed { 
    transform: translateX(calc(var(--right-bar-width) - 20px)); 
}

.view-right-bar {
    width: 100%; max-height: 70vh; display: flex; flex-direction: column; align-items: center;
    gap: 15px; padding: 15px 0; overflow-y: auto; scrollbar-width: none;
    transition: opacity 0.3s ease, visibility 0.3s ease; 
    background-color: var(--ui-bg-color); backdrop-filter: blur(5px);
    pointer-events: auto;
    border-radius: 10px 0 0 10px;
    visibility: visible;
    opacity: 1;
}
.view-right-bar::-webkit-scrollbar { display: none; }
.view-right-column.collapsed .view-right-bar { opacity: 0; visibility: hidden; pointer-events: none; }

.scene-thumb-item {
    width: 70px; height: 70px; border-radius: 10px; overflow: hidden; cursor: pointer;
    border: 3px solid transparent; transition: border-color 0.2s, transform 0.2s;
    flex-shrink: 0; user-select: none; position: relative; background-color: #333;
}
.scene-thumb-item:hover { transform: scale(1.1); }
.scene-thumb-item.active { border-color: var(--accent-blue); }
.scene-thumb-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.scene-thumb-title {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 5px 2px;
    background-color: rgba(0, 0, 0, 0.5); color: var(--text-primary); font-size: 12px;
    text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

.thumbs-toggle-button {
    position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%);
    width: 32px; height: 60px; background-color: var(--ui-bg-color);
    border: 1px solid var(--border-color); border-right: none; color: var(--text-primary);
    border-radius: 15px 0 0 15px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 20px; font-weight: bold; padding-right: 4px;
    z-index: 100; pointer-events: auto;
}
.thumbs-toggle-button:hover { background-color: var(--ui-bg-light); }

.view-bottom-bar { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    height: calc(120px + env(safe-area-inset-bottom)); 
    display: flex; align-items: center; z-index: 100; 
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); 
    padding: 0 10px env(safe-area-inset-bottom) 10px; 
    pointer-events: none; 
}

.group-selector-wrapper { display: flex; justify-content: flex-start; align-items: center; gap: 12px; padding: 10px 60px 10px 14px; overflow-x: auto; scrollbar-width: none; width: 100%; height: 100%; cursor: grab; pointer-events: auto; }
.group-selector-wrapper::-webkit-scrollbar { display: none; }
.group-selector-wrapper.grabbing { cursor: grabbing; user-select: none; }
.group-selector-item { width: 130px; height: 85px; flex-shrink: 0; position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all 0.25s ease; user-select: none; background-color: #333; }
.group-selector-item:hover { transform: translateY(-6px); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.group-selector-item.active { border-color: var(--accent-blue); transform: translateY(-2px) scale(1.02); }
.group-selector-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.group-selector-name { position: absolute; bottom: 0; left: 0; width: 100%; padding: 6px; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); color: var(--text-primary); font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scroll-arrow.right { display: none; align-items: center; justify-content: center; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; background-color: var(--ui-bg-color); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 50%; cursor: pointer; z-index: 105; font-size: 16px; user-select: none; transition: background-color 0.2s; pointer-events: auto; }
.scroll-arrow.right:hover { background-color: var(--ui-bg-light); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: auto; height: auto;
    max-width: 90vw; max-height: 90vh;
    background-color: #2a2a2a;
    border-radius: 12px;
    position: relative; color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#modal-body { flex: 1; overflow: hidden; position: relative; width: 100%; }

.modal-close {
    position: absolute; top: 10px; right: 15px;
    font-size: 28px; font-weight: bold; color: #aaa;
    cursor: pointer; z-index: 1002; text-shadow: 0 0 3px #000;
    transition: color 0.2s; line-height: 1;
}
.modal-close:hover { color: white; }

.modal-content.intro-mode { width: 600px; height: 70vh; background-color: #2a2a2a; }
@media (max-width: 768px) { .modal-content.intro-mode { width: 90%; height: 80%; } }
.intro-scroll-container { padding: 30px; overflow-y: auto; height: 100%; }
.intro-title { font-size: 22px; font-weight: bold; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.15); text-align: center; color: var(--accent-blue); }
.modal-text-content { line-height: 1.8; font-size: 15px; white-space: pre-wrap; word-break: break-word; color: #ddd; }

.modal-content.video-mode { background: transparent; border: none; box-shadow: none; }
.modal-content.video-mode video { max-width: 90vw; max-height: 80vh; display: block; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.modal-content.video-mode .modal-close { top: -35px; right: 0; color: white; font-size: 32px; }

.modal-content.gallery-mode { 
    width: 100vw; height: 100vh; max-width: 100%; max-height: 100%; 
    background: transparent; border: none; border-radius: 0; box-shadow: none; 
    pointer-events: none; 
}
.modal-content.gallery-mode #modal-body { 
    padding: 0; margin: 0; width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
}
.modal-content.gallery-mode .modal-close { 
    top: 20px; right: 30px; width: 40px; height: 40px; 
    background: rgba(0,0,0,0.5); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    pointer-events: auto; z-index: 20; 
}

#photo-gallery { 
    width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
    pointer-events: auto; 
    position: relative;
}

.photo-gallery-slider { 
    display: flex; height: 100%; width: 100%; 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    align-items: center; 
}

.photo-gallery-slide { 
    flex-shrink: 0; width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
    padding: 0; 
    position: relative;
}

.image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.photo-gallery-image { 
    max-width: 95vw; max-height: 90vh; 
    width: auto; height: auto; 
    object-fit: contain; 
    box-shadow: 0 0 30px rgba(0,0,0,0.8); 
    border-radius: 4px; 
    cursor: default;
    transition: transform 0.3s ease, cursor 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.photo-gallery-image[data-zoom]:not([data-zoom="1"]) { cursor: grab; }
.photo-gallery-image[data-zoom]:not([data-zoom="1"]):active { cursor: grabbing; }

.zoom-controls {
    position: absolute; bottom: 20px; right: 20px;
    display: flex; gap: 8px; z-index: 10; pointer-events: auto;
}

.zoom-btn {
    width: 40px; height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%; color: white;
    font-size: 18px; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; user-select: none;
}
.zoom-btn:hover { background: rgba(0, 0, 0, 0.9); border-color: rgba(255, 255, 255, 0.6); transform: scale(1.1); }
.zoom-btn:active { transform: scale(0.95); }
.zoom-reset { font-size: 16px; }

.gallery-nav { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    width: 60px; height: 60px; 
    background-color: rgba(0, 0, 0, 0.3); 
    color: white; border: none; border-radius: 50%; 
    font-size: 30px; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    z-index: 10; transition: all 0.2s; pointer-events: auto; 
}
.gallery-nav:hover { background-color: rgba(255, 255, 255, 0.15); }
.gallery-nav.prev { left: 30px; }
.gallery-nav.next { right: 30px; }

.gallery-counter { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); 
    background-color: rgba(0, 0, 0, 0.6); color: white; 
    padding: 6px 18px; border-radius: 20px; font-size: 14px; 
    z-index: 10; letter-spacing: 1px; pointer-events: auto; 
}

@media (max-width: 768px) {
    .zoom-controls { bottom: 15px; right: 15px; }
    .zoom-btn { width: 36px; height: 36px; font-size: 16px; }
    .zoom-reset { font-size: 14px; }
    .gallery-nav { width: 50px; height: 50px; font-size: 24px; }
    .gallery-nav.prev { left: 15px; }
    .gallery-nav.next { right: 15px; }
    .gallery-counter { bottom: 20px; font-size: 12px; padding: 4px 12px; }
}

.photo-gallery-image::selection { background: transparent; }
.photo-gallery-image::-moz-selection { background: transparent; }