/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根变量定义 */
:root {
    --primary-color: #1a365d;
    --primary-light: #2d5a87;
    --primary-dark: #0f2a44;
    --secondary-color: #ed8936;
    --secondary-light: #f6ad55;
    --background-color: #f7fafc;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-large: 12px;
    --transition: all 0.3s ease;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
}

/* 简化的标题栏样式 */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 64px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.title-icon {
    font-size: 24px;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 40px;
}

.upload-container {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    padding: 40px;
    text-align: center;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 60px 40px;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(26, 54, 93, 0.02);
}

.upload-area.drag-over {
    border-color: var(--secondary-color);
    background-color: rgba(237, 137, 54, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.upload-area h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 16px;
}

.file-types {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px !important;
}

.upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.upload-btn:active {
    transform: translateY(0);
}

/* 上传进度样式 */
.upload-progress {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--secondary-light));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* 全景查看器区域 */
.viewer-section {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.viewer-container {
    display: flex;
    flex-direction: column;
    height: 80vh;
    min-height: 600px;
}

.panorama-viewer {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

#panoramaCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* 操作提示 */
.viewer-hints {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

.hint-item {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

.hint-icon {
    font-size: 16px;
}

/* 控制面板 */
.control-panel {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.control-group {
    display: flex;
    gap: 12px;
}

.control-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.control-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-icon {
    font-size: 16px;
}

/* 图片信息 */
.image-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.info-item {
    display: flex;
    gap: 8px;
}

.info-label {
    color: var(--text-light);
    font-weight: 500;
    min-width: 80px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* 操作按钮 */
.control-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.action-btn.secondary {
    background: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-heavy);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

.toast-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-brand .brand-text {
        display: none;
    }
    
    .main-content {
        padding: 20px 16px;
    }
    
    .upload-container {
        padding: 24px 16px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-area h3 {
        font-size: 20px;
    }
    
    .viewer-container {
        height: 70vh;
        min-height: 400px;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .control-group {
        justify-content: center;
    }
    
    .image-info {
        text-align: center;
    }
    
    .control-actions {
        justify-content: center;
    }
    
    .viewer-hints {
        position: static;
        flex-direction: row;
        justify-content: center;
        padding: 12px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .hint-item {
        background: transparent;
        padding: 4px 8px;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .toast {
        right: 16px;
        left: 16px;
    }
    
    .toast-content {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 30px 16px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .upload-area h3 {
        font-size: 18px;
    }
    
    .upload-area p {
        font-size: 14px;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-text {
        display: none;
    }
}

/* 全屏模式样式 */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000 !important;
}

.fullscreen-mode .control-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-top: none;
    color: white;
}

.fullscreen-mode .control-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.fullscreen-mode .control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-mode .info-label,
.fullscreen-mode .info-value {
    color: rgba(255, 255, 255, 0.9);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 选择文本样式 */
::selection {
    background: rgba(26, 54, 93, 0.2);
    color: var(--text-primary);
}

/* 焦点样式 */
button:focus,
input:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* 禁用状态 */
.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}