/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 量表头部样式 */
.scale-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.scale-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scale-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.8;
}

.scale-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.scale-info span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* 进度条样式 */
.progress-container {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

/* 题目区域样式 */
.questions-container {
    padding: 40px 30px;
    min-height: 400px;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.question-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4facfe;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    font-weight: 500;
}


.question-card.answered {
    border-color: #4facfe;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

/* 程度点评分样式 */
.rating-container {
    margin-top: 20px;
}

.rating-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.rating-point {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.rating-point:hover {
    background: #e3f2fd;
    border-color: #4facfe;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.rating-point.selected {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.rating-point.selected::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #4facfe;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    padding: 0 10px;
}

.rating-label {
    max-width: 120px;
    text-align: center;
    line-height: 1.3;
}

.question-card.answered {
    border-color: #4facfe;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

/* 选项样式 */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-item {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-label {
    display: block;
    padding: 18px 24px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    position: relative;
    overflow: hidden;
}

.option-label:hover {
    background: #e3f2fd;
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}

.option-input:checked + .option-label {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
}

.option-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.option-input:checked + .option-label::before {
    left: 100%;
}

/* 导航按钮样式 */
.navigation {
    padding: 30px;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 结果页面样式 */
.results-container {
    padding: 40px 30px;
    background: #f8f9fa;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 答题记录页面样式 */
.records-container {
    padding: 40px 30px;
    background: #f8f9fa;
}

.records-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.records-header h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.records-summary {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 4px solid #4facfe;
}

.records-summary h3 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4facfe;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.records-list {
    margin-bottom: 30px;
}

.record-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #4facfe;
    transition: all 0.3s ease;
}

.record-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.record-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.record-answer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.answer-text {
    color: #666;
    font-style: italic;
}

.answer-score {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.record-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 8px;
    display: flex;
    gap: 15px;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.result-card h2 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
}

.score-display {
    margin-bottom: 30px;
}

.score-item {
    display: inline-block;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
}

.score-label {
    margin-right: 10px;
}

.dimension-scores {
    margin-bottom: 30px;
}

.dimension-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #4facfe;
}

.dimension-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.dimension-score {
    font-size: 1.2rem;
    color: #4facfe;
    font-weight: 700;
}

.result-interpretation {
    background: #e3f2fd;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
    line-height: 1.8;
    color: #333;
}

.result-interpretation h3 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    .scale-header {
        padding: 30px 20px;
    }
    
    .scale-header h1 {
        font-size: 2rem;
    }
    
    .scale-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .questions-container {
        padding: 30px 20px;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .question-header {
        margin-bottom: 20px;
    }
    
    .question-text {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .rating-scale {
        padding: 0 5px;
    }
    
    .rating-point {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .rating-labels {
        font-size: 0.8rem;
        padding: 0 5px;
    }
    
    .rating-label {
        max-width: 100px;
    }
    
    .navigation {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        padding: 16px;
    }
    
    .results-container {
        padding: 30px 20px;
    }
    
    .result-card {
        padding: 30px 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card {
    animation: fadeIn 0.5s ease-out;
}

.result-card {
    animation: fadeIn 0.6s ease-out;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
