/* 基礎樣式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    min-height: 100vh;
    color: #2d3436;
    overflow-x: hidden;
}

/* 頁面容器 */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.6s ease-out;
}

.page.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 480px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 開場頁面樣式 */
.header {
    margin-bottom: 32px;
}

.sleep-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.2;
}

.subtitle {
    font-size: 16px;
    color: #6e6e73;
    font-weight: 400;
}

.intro-text {
    margin: 24px 0 32px;
    padding: 20px;
    background: rgba(253, 203, 110, 0.15);
    border-radius: 16px;
    border-left: 4px solid #fdcb6e;
}

.intro-text p {
    font-size: 16px;
    line-height: 1.5;
    color: #1d1d1f;
}

/* 按鈕樣式 */
.start-btn {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 32px;
    min-width: 200px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(253, 203, 110, 0.3);
}

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

.arrow {
    transition: transform 0.3s ease;
}

.start-btn:hover .arrow {
    transform: translateX(4px);
}

/* 測驗資訊 */
.quiz-info {
    display: flex;
    justify-content: space-around;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #6e6e73;
}

.info-item .icon {
    font-size: 20px;
}

/* 進度條 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #fdcb6e 0%, #e17055 100%);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* 問題頁面樣式 */
.question-header {
    margin-bottom: 32px;
}

.question-number {
    display: inline-block;
    background: rgba(253, 203, 110, 0.2);
    color: #e17055;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.3;
}

/* 選項樣式 */
.options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-btn {
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover {
    border-color: #fdcb6e;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.2);
}

.option-btn.selected {
    border-color: #fdcb6e;
    background: rgba(253, 203, 110, 0.1);
}

.option-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.option-letter {
    width: 32px;
    height: 32px;
    background: #fdcb6e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option-text {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    flex: 1;
}

.option-desc {
    font-size: 14px;
    color: #6e6e73;
    font-style: italic;
}

/* 結果頁面樣式 */
.result-header {
    margin-bottom: 32px;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

#result-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 16px;
    color: #6e6e73;
}

.result-content {
    text-align: left;
}

#result-description {
    font-size: 18px;
    line-height: 1.6;
    color: #2d3436;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(253, 203, 110, 0.1);
    border-radius: 16px;
    border-left: 4px solid #fdcb6e;
}

.result-traits {
    margin-bottom: 32px;
}

.result-traits h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trait-tag {
    background: rgba(253, 203, 110, 0.2);
    color: #e17055;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* CTA區域 */
.cta-section {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.15) 0%, rgba(225, 112, 85, 0.1) 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.cta-text {
    font-size: 16px;
    color: #2d3436;
    margin-bottom: 16px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(253, 203, 110, 0.3);
}

.cta-btn:hover .arrow {
    transform: translateX(4px);
}

.restart-btn {
    background: transparent;
    color: #e17055;
    border: 2px solid #e17055;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.restart-btn:hover {
    background: #e17055;
    color: white;
    transform: translateY(-2px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .sleep-icon, .result-icon {
        font-size: 56px;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 16px;
    }
    
    .info-item {
        flex-direction: row;
        justify-content: center;
    }
    
    .option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .option-letter {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 10px;
    }
    
    .container {
        padding: 24px 20px;
    }
    
    .start-btn {
        min-width: auto;
        width: 100%;
    }
}