:root {
    --primary: #00d4ff;
    --primary-dark: #00a8cc;
    --bg-dark: rgba(0, 0, 0, 0.65);
    --bg-darker: rgba(0, 0, 0, 0.85);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --accent: #ff6b35;
    --radius: 12px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-light);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
}

.loading-percent {
    font-size: 14px;
    color: var(--text-muted);
}

.panorama-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#panoramaCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    padding-top: max(12px, env(safe-area-inset-top));
    background: linear-gradient(to bottom, var(--bg-darker) 0%, transparent 100%);
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.top-bar > * {
    pointer-events: auto;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.logo-icon {
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.title-info {
    display: flex;
    flex-direction: column;
}

.main-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.sub-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.top-bar-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.icon-btn:hover, .icon-btn:active {
    background: var(--primary);
    color: #000;
    transform: scale(1.05);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.hotspot-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
}

.hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hotspot.hidden {
    opacity: 0;
    pointer-events: none;
}

.hotspot-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse-ring 2s ease-out infinite;
}

.hotspot-core {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
    position: relative;
    z-index: 2;
}

.hotspot-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--bg-darker);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-light);
    backdrop-filter: blur(5px);
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.scene-thumbnails {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 70px;
    bottom: calc(70px + var(--safe-bottom));
    z-index: 90;
    padding: 10px 15px;
    background: linear-gradient(to top, var(--bg-darker) 0%, transparent 100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.scene-thumbnails.hidden {
    transform: translateY(120%);
    opacity: 0;
}

.thumbnails-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.thumbnails-toggle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: none;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnails-toggle.collapsed {
    transform: rotate(180deg);
}

.thumbnails-toggle svg {
    width: 14px;
    height: 14px;
}

.thumbnails-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumbnails-list::-webkit-scrollbar {
    display: none;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease;
}

.thumbnail-item.active .thumbnail-img {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.thumbnail-img {
    width: 80px;
    height: 55px;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    background: var(--bg-dark);
    position: relative;
}

.thumbnail-img canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-name {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.thumbnail-item.active .thumbnail-name {
    color: var(--primary);
}

.bottom-toolbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 15px calc(10px + var(--safe-bottom));
    background: linear-gradient(to top, var(--bg-darker) 0%, transparent 100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bottom-toolbar.hidden {
    transform: translateY(100%);
    opacity: 0;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toolbar-btn:hover, .toolbar-btn:active {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
}

.toolbar-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.compass {
    position: fixed;
    top: 70px;
    top: calc(70px + env(safe-area-inset-top));
    right: 15px;
    z-index: 80;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 10px;
    font-weight: bold;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.compass.hidden {
    opacity: 0;
    pointer-events: none;
}

.compass svg {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0.5;
}

.scene-name-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 200;
    background: var(--bg-darker);
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.scene-name-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    background: var(--bg-darker);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-light);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.share-qrcode {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 12px;
    text-align: center;
}

.share-tip {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 15px;
}

.share-link {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    font-size: 13px;
    outline: none;
}

.share-link button {
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.share-platforms {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.platform-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.platform-btn:hover {
    transform: translateY(-2px);
}

.platform-btn.wechat { background: #07c160; }
.platform-btn.weibo { background: #e6162d; }
.platform-btn.qq { background: #12b7f5; }

.modal-body p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-body p strong {
    color: var(--text-light);
    font-size: 16px;
}

.modal-body .version {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 12px;
}

.gyro-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.gyro-tip.show {
    opacity: 1;
    visibility: visible;
}

.gyro-tip-content {
    text-align: center;
    padding: 30px;
}

.gyro-tip-content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-light);
}

.gyro-tip-content button {
    padding: 12px 30px;
    border-radius: 25px;
    border: none;
    background: var(--primary);
    color: #000;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

@media (min-width: 768px) {
    .bottom-toolbar {
        justify-content: center;
        gap: 30px;
    }
    
    .scene-thumbnails {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        max-width: 600px;
    }
}

.landscape-tip {
    display: none;
}

@media (max-height: 400px) and (orientation: landscape) {
    .landscape-tip {
        display: flex;
    }
}


