* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 60px 20px 40px 20px;
    padding-bottom: 40px;
}

.page.active {
    display: block;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 兑换码页面样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.redeem-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    letter-spacing: 4px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #ff4757;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
    min-height: 20px;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    width: 50%;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.notice {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.notice p {
    margin-bottom: 5px;
}

/* 答题页面样式 */
.test-header {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.question-container {
    margin-bottom: 30px;
}

.question-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-title {
    font-size: 16px;
    color: #667eea;
    font-weight: 600;
}

.btn-submit {
    padding: 8px 20px;
    font-size: 14px;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    background: #fff;
    color: #667eea;
}

.btn-submit:hover:not(:disabled) {
    background: #667eea;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.question-text {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 25px;
    min-height: 60px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 500;
}

.option-item.option-image {
    align-items: center;
}

.option-img-thumb {
    max-width: 160px;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.option-label {
    min-width: 50px;
    font-weight: 600;
    color: #667eea;
}

.option-text {
    flex: 1;
    font-size: 16px;
}

.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.navigation-buttons button {
    flex: 1;
}

.test-notice {
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* 结果页面样式 */
.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-header h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.result-notice {
    font-size: 12px;
    color: #999;
}

.score-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.score-item {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #fff;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.score-value {
    font-size: 28px;
    font-weight: 600;
}

.factor-table-container {
    overflow-x: auto;
    margin-bottom: 25px;
}

.factor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.factor-table thead {
    background: #f8f9fa;
}

.factor-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.factor-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.factor-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-normal {
    background: #d4edda;
    color: #155724;
}

.status-mild {
    background: #fff3cd;
    color: #856404;
}

.status-moderate {
    background: #ffeaa7;
    color: #d63031;
}

.status-severe {
    background: #ffcccc;
    color: #c0392b;
}

.factor-explanation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 13px;
    line-height: 1.8;
    color: #666;
}

.result-interpretation {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.result-interpretation h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.result-interpretation p {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 12px;
}

.result-actions {
    display: flex;
    gap: 15px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    box-sizing: border-box;
}

.result-actions button {
    flex: 1;
}

/* 结果页面容器需要底部padding，避免内容被固定按钮遮挡 */
#resultPage .container {
    padding-bottom: 100px;
}

/* 个性化安抚卡片 */
.comfort-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.comfort-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comfort-card h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.comfort-status {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.comfort-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    min-height: 60px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .score-value {
        font-size: 24px;
    }
    
    .factor-table {
        font-size: 12px;
    }
    
    .factor-table th,
    .factor-table td {
        padding: 8px 4px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease;
}

