/* 基本樣式設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.main-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 導航選單樣式 */
.nav-container {
    width: 200px;
    background-color: #34495e;
    color: white;
    padding: 1rem;
    overflow-y: auto;
    transition: transform 0.3s;
}

.nav-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #2c3e50;
}

.nav-item.active {
    background-color: #3498db;
}

/* 3D 手機展示容器 */
.phone-viewer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 資訊面板樣式 */
.info-panel {
    width: 300px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    overflow-y: auto;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.info-panel h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

.spec-item {
    display: flex;
    margin-bottom: 0.5rem;
}

.spec-label {
    font-weight: bold;
    width: 100px;
    color: #34495e;
}

.spec-value {
    flex: 1;
}

/* 控制面板樣式 */
.control-panel {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background-color: #2c3e50;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.control-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.control-btn:hover {
    background-color: #2980b9;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background-color: #e74c3c;
}

/* 頁尾樣式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem 1rem;
    text-align: center;
    font-size: 0.8rem;
}

/* 載入中指示器 */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #3498db;
}

.loader-spinner {
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 響應式設計 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .nav-container {
        width: 100%;
        max-height: 150px;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .nav-item {
        flex: 0 0 auto;
        margin-right: 0.5rem;
        margin-bottom: 0;
    }
    
    .info-panel {
        width: 100%;
        max-height: 30%;
    }
}

@media (max-width: 768px) {
    .control-panel {
        padding: 0.5rem;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        margin: 0 0.3rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
}

/* 滑鼠提示樣式 */
.tooltip {
    position: absolute;
    background-color: #2c3e50;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}

.tooltip.show {
    opacity: 1;
}