/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    text-align: left;
}

.score-rule {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.score-rule h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.score-rule p {
    font-size: 14px;
    color: #666;
    text-align: left;
}

/* 进度条样式 */
.progress-container {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 15px 0 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

.progress-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
    height: 40px;
    padding: 0 10px;
    background-color: transparent;
    border-radius: 0;
    position: relative;
}

.progress-section {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid #e0e0e0;
    overflow: visible;
}

.progress-section:last-child {
    border-right: none;
}

.progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    z-index: 2;
    text-align: center;
}

/* 进度条背景容器 */
.progress-background {
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    z-index: 0;
    overflow: hidden;
}

/* 进度条填充样式 */
.progress-bar-inner {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    background-color: #3498db;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
    z-index: 1;
    max-width: 100%;
}

/* 完成状态样式 */
.progress-section.completed .progress-bar-inner {
    background-color: #27ae60;
}

/* 活跃状态样式 */
.progress-section.active .progress-bar-inner {
    background-color: #3498db;
}

/* 固定板块标题样式 */
.sticky-dimension {
    display: none;
}

.sticky-title {
    margin: 0;
    font-size: 16px;
    color: #3498db;
    font-weight: 600;
    text-align: left;
    border-left: 4px solid #3498db;
    padding-left: 12px;
}

/* 调整main的margin，避免内容被固定元素遮挡 */
.main {
    margin-top: 0;
}

/* 调整dimension-section样式 */
.dimension-section {
    margin-bottom: 30px;
    background-color: #fafafa;
    border-radius: 0;
    padding: 25px 20px;
    box-shadow: none;
    scroll-margin-top: 150px;
    border-bottom: 1px solid #e0e0e0;
}

/* 确保header不被固定元素遮挡 */
.header {
    margin-top: 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.dimension-title {
    font-size: 18px;
    color: #3498db;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: left;
    border-left: 4px solid #3498db;
    padding: 12px 0 12px 12px;
    margin: -25px -20px 20px -20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.question-item {
    margin-bottom: 25px;
    background-color: #fff;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: left;
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.option-item:hover {
    background-color: #e8f4fd;
    border-color: #3498db;
}

.option-item input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.option-item input[type="radio"]:checked + .option-text {
    color: #3498db;
    font-weight: 500;
}

.option-item input[type="radio"]:checked + .option-text::before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
}

.option-text {
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

/* 提交按钮样式 */
.submit-section {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.submit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 结果页面样式 */
.result-card {
    background-color: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: text;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.result-title {
    font-size: 22px;
    color: #2c3e50;
    font-weight: 600;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.score-section {
    text-align: center;
    background-color: #f0f8ff;
    padding: 25px;
    border-radius: 12px;
}

.score-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.score-value {
    font-size: 48px;
    color: #3498db;
    font-weight: bold;
    margin-bottom: 5px;
}

.score-range {
    font-size: 14px;
    color: #999;
}

.level-section {
    text-align: center;
    background-color: #e8f8f5;
    padding: 20px;
    border-radius: 12px;
}

.level-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.level-value {
    font-size: 24px;
    color: #27ae60;
    font-weight: 600;
}

.advice-section {
    background-color: #fff8e1;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #f39c12;
}

.advice-label {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.advice-content {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    text-align: left;
}

.advice-content br {
    margin-bottom: 10px;
}

.note-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #95a5a6;
}

.note-label {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.note-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    text-align: left;
}

.result-footer {
    text-align: center;
    margin-top: 30px;
}

.save-tip {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    font-style: italic;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.restart-btn {
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    display: inline-block;
}

.restart-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .dimension-section {
        padding: 15px;
    }
    
    .question-item {
        padding: 15px;
    }
    
    .question-text {
        font-size: 15px;
    }
    
    .option-item {
        padding: 10px 14px;
    }
    
    .option-text {
        font-size: 13px;
    }
    
    .submit-btn {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .score-value {
        font-size: 40px;
    }
    
    .level-value {
        font-size: 20px;
    }
    
    .advice-content {
        font-size: 13px;
    }
}

/* 长按保存提示 */
.result-card::after {
    content: "长按保存结果"; 
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.result-card:active::after {
    opacity: 1;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

.result-card {
    animation: fadeIn 0.6s ease-out;
}

/* 表单验证样式 */
input:invalid {
    border-color: #e74c3c;
}

input:valid {
    border-color: #27ae60;
}
