/*
 * 银发友好度检测工具页面样式
 */

.senior-tester-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.senior-header {
    text-align: center;
    margin-bottom: 30px;
}

.senior-header h1 {
    color: #fb6c00;
    font-size: 32px;
    margin-bottom: 10px;
}

.senior-header .subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    background: #fff5e6;
    color: #fb6c00;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.test-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #fb6c00;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
}

.submit-button {
    background: #fb6c00;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #ff8930;
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #fb6c00;
    text-decoration: none;
}

.back-button:hover {
    color: #ff8930;
}

/* 评分卡片 */
.score-card {
    background: #ffffff;
    color: #333;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #fb6c00;
}

.score-main {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
}

.score-circle {
    text-align: center;
}

.score-number {
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 10px;
    color: #fb6c00;
}

.score-label {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

.score-grade {
    flex: 1;
    min-width: 200px;
}

.grade-badge {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    padding: 15px 25px;
    border-radius: 8px;
    display: inline-block;
    min-width: 80px;
}

/* 根据等级设置不同的背景色，确保对比度 */
.grade-badge[data-grade="A"] {
    background: #e8f5e9;
    color: #2e7d32;
}

.grade-badge[data-grade="B"] {
    background: #fff3e0;
    color: #e65100;
}

.grade-badge[data-grade="C"] {
    background: #fffde7;
    color: #f57f17;
}

.grade-badge[data-grade="D"] {
    background: #fce4ec;
    color: #c2185b;
}

.grade-badge[data-grade="F"] {
    background: #ffebee;
    color: #c62828;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    font-size: 14px;
}

.breakdown-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.breakdown-item:hover {
    background: #fff5e6;
    border-color: #fb6c00;
}

.breakdown-label {
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.breakdown-value {
    font-size: 24px;
    font-weight: bold;
    color: #fb6c00;
}

/* 雷达图容器 */
.radar-chart-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.radar-chart-container h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

#radarChart {
    max-height: 400px;
}

/* 检测结果列表 */
.results-list {
    display: grid;
    gap: 15px;
}

.result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-item.pass {
    border-left: 4px solid #4caf50;
}

.result-item.fail {
    border-left: 4px solid #f44336;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-icon {
    font-size: 24px;
}

.result-icon.pass {
    color: #4caf50;
}

.result-icon.fail {
    color: #f44336;
}

.result-score {
    font-size: 20px;
    font-weight: bold;
    color: #fb6c00;
}

.result-description {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.result-wcag {
    font-size: 12px;
    color: #999;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* 改进建议 */
.suggestions-box {
    background: #fff5e6;
    border-left: 4px solid #fb6c00;
    padding: 25px;
    border-radius: 8px;
}

.suggestions-box h3 {
    color: #fb6c00;
    margin-bottom: 20px;
}

.suggestion-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

.suggestion-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.suggestion-text {
    color: #666;
    line-height: 1.6;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 30px;
    border: 2px solid #fb6c00;
    border-radius: 6px;
    background: white;
    color: #fb6c00;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #fb6c00;
    color: white;
}

.action-btn.primary {
    background: #fb6c00;
    color: white;
}

.action-btn.primary:hover {
    background: #ff8930;
    border-color: #ff8930;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading i {
    font-size: 48px;
    color: #fb6c00;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 无障碍优化样式 */
.form-input:focus {
    outline: 3px solid #fb6c00;
    outline-offset: 2px;
    border-color: #fb6c00;
}

.form-input.error {
    border-color: #f44336;
    border-width: 3px;
}

.submit-button:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn:focus {
    outline: 3px solid #fb6c00;
    outline-offset: 2px;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 确保所有交互元素都有足够的点击区域 */
button, 
a:not(.back-button),
.form-input {
    min-height: 44px;
}

button,
a:not(.back-button) {
    min-width: 44px;
}

/* 返回按钮特殊处理 */
.back-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .score-card {
        background: #ffffff;
        border-width: 3px;
        border-color: #000000;
    }
    
    .score-number {
        color: #000000;
    }
    
    .breakdown-label {
        color: #000000;
    }
    
    .breakdown-value {
        color: #000000;
    }
    
    .result-item {
        border-width: 2px;
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* 减少动画（尊重用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading i {
        animation: none;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .senior-tester-container {
        padding: 20px 15px;
    }
    
    .test-form {
        padding: 20px 15px;
    }
    
    .senior-header h1 {
        font-size: 24px;
    }
    
    .score-main {
        flex-direction: column;
    }
    
    .score-number {
        font-size: 48px;
    }
    
    .score-breakdown {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    #radarChart {
        max-height: 300px;
    }
}

