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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 页面切换 */
.page {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-top: 15px;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 600;
}

.header p {
    color: #666;
    font-size: 1em;
}

/* 卡片样式 */
.card {
    background: #fafafa;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

/* 警告框 */
.warning {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    font-size: 0.9em;
}

.warning strong {
    color: #e65100;
}

.warning ul {
    margin: 8px 0 0 18px;
    color: #e65100;
}

/* 因子网格 */
.factors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.factor-item {
    background: #4caf50;
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85em;
    font-weight: 500;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-submit {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    min-width: 120px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #a6acaf 0%, #1c2833 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(189, 195, 199, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d84315 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:disabled, .btn-secondary:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* 首页开始测试按钮特殊样式 */
.start-test-container {
    text-align: center;
    margin: 30px 0;
}

#start-test {
    padding: 16px 40px;
    font-size: 1.2em;
    min-width: 180px;
    border-radius: 30px;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

#start-test:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* 测试页面样式 */
.test-header {
    margin-bottom: 25px;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    height: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    background: #4caf50;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.question-counter {
    text-align: center;
    font-size: 1em;
    color: #666;
    font-weight: 500;
}

/* 问题样式 */
.question-section {
    text-align: center;
}

#question-container {
    font-size: 1.1em;
    margin-bottom: 25px;
    color: #333;
    line-height: 1.6;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.question-text {
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 500;
}

.question-factor {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* 选项样式 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.option-btn {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.option-btn:hover {
    border-color: #2196f3;
    background: #f5f5f5;
}

.option-btn.selected {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

.option-label {
    display: block;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 4px;
}

.option-desc {
    display: block;
    font-size: 0.85em;
    color: #666;
}

.option-btn.selected .option-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* 结束测试按钮样式 */
#end-test-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 120px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#end-test-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d84315 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.3);
}

/* 测试限制样式 */
.test-restriction {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.test-restriction h2 {
    color: #856404;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.restriction-info {
    color: #856404;
    font-size: 1.1em;
    line-height: 1.6;
}

.restriction-info p {
    margin-bottom: 15px;
}

.next-time {
    font-size: 1.3em;
    font-weight: bold;
    color: #d35400;
    background: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid #ffeaa7;
    display: inline-block;
    margin: 10px 0;
}

/* 结果页面样式 */
.result-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.result-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
    font-weight: 600;
}

.result-header p {
    color: #666;
    font-size: 1em;
    margin: 0;
}

.score-card {
    text-align: center;
    background: white;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e8e8;
}

.score-card p {
    margin: 8px 0;
    color: #666;
    font-size: 1.1em;
}

.score-value {
    font-size: 3.5em;
    font-weight: bold;
    line-height: 1;
    color: #4caf50;
    margin: 15px 0;
}

#average-score {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.assessment {
    font-size: 1.1em;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.result-summary {
    margin-top: 20px;
}

.positive-items-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.positive-items-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.positive-items-info p {
    margin: 8px 0;
    font-size: 1em;
    color: #333;
}

.positive-items-info strong {
    color: #2c3e50;
}

/* 因子评分表格 */
.factor-scores {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 结果解释部分样式 */
.result-explanation {
    background: #f8f9fb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.result-explanation h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.result-explanation h4 {
    color: #444;
    margin: 10px 0 15px 0;
    font-size: 1.1em;
}

.result-explanation p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: justify;
}

.result-explanation p:last-child {
    margin-bottom: 0;
}

/* 分级标准列表样式 */
.level-criteria {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.level-criteria li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    line-height: 1.6;
    color: #555;
}

/* 不同等级的点样式 */
.level-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 5px;
}

.level-slight {
    background-color: #4CAF50;
}

.level-minor {
    background-color: #8BC34A;
}

.level-moderate {
    background-color: #FF9800;
}

.level-severe {
    background-color: #F44336;
}

.factor-scores h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

/* 因子评分表格 */
.factor-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.factor-table th, .factor-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.factor-table th {
    background-color: #f8f9fa;
    color: #666;
    font-weight: 600;
    font-size: 0.9em;
}

.factor-table td {
    color: #333;
}

/* 评分等级样式 */
.level-minor {
    color: #28a745;
    background-color: #e8f5e8;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    display: inline-block;
}

.level-moderate {
    color: #ff9800;
    background-color: #fff3e0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    display: inline-block;
}

.level-severe {
    color: #e53935;
    background-color: #ffebee;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    display: inline-block;
}

/* 详细分析 */
.detailed-analysis {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    
}

.recommendations {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.detailed-analysis h3, .recommendations h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 建议内容样式优化 */
#recommendation-content {
    line-height: 1.7;
}

#recommendation-content p {
    color: #555;
    margin-bottom: 15px;
    text-align: justify;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #764ba2;
}

#recommendation-content p:last-child {
    margin-bottom: 0;
}

/* 建议板块中的列表样式优化 */
#recommendation-content ol, #recommendation-content ul {
    margin: 0 0 15px 25px;
    padding-left: 15px;
}

#recommendation-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    position: relative;
}

/* 确保有序列表序号与内容对齐 */
#recommendation-content ol {
    list-style-position: outside;
    padding-left: 20px;
}

.factor-analysis-item {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.factor-analysis-item:last-child {
    margin-bottom: 0;
}

.factor-analysis-item h4 {
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.factor-analysis-item h4 span {
    font-weight: normal;
    color: #666;
}

.factor-analysis-item p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.factor-analysis-item strong {
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .page {
        padding: 20px;
        margin-top: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary, .btn-submit {
        width: 100%;
        max-width: 300px;
    }
    
    /* 首页开始测试按钮特殊响应式样式 */
    #start-test {
        width: auto;
        max-width: none;
        margin: 0 auto;
        display: block;
    }
    
    .factors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 结果页面表格响应式 */
    .factor-table {
        font-size: 0.9em;
    }
    
    .factor-table th, .factor-table td {
        padding: 8px 4px;
    }
    
    /* 评分等级标签在手机上调整 */
    .level-minor, .level-moderate, .level-severe {
        padding: 2px 8px;
        font-size: 0.8em;
    }
    
    /* 因子分析项在手机上调整 */
    .factor-analysis-item {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .factor-analysis-item h4 {
        font-size: 1em;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    .factor-analysis-item h4 span {
        font-size: 0.9em;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    #question-container {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .factors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-value {
        font-size: 2.5em;
    }
    
    .card {
        padding: 15px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .page {
        box-shadow: none;
        margin: 0;
    }
    
    .btn-primary, .btn-secondary, .btn-submit {
        display: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .option-btn {
        border-width: 3px;
    }
    
    .progress-bar, .progress-container {
        border: 1px solid #333;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}