/* 可访问性改进样式 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2ECC71;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* 屏幕阅读器专用内容 */
.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;
}

/* 触摸目标最小尺寸 (WCAG 2.1 AA标准) */
@media (hover: none) and (pointer: coarse) {
    .btn, .social-btn, button {
        min-height: 48px;
        min-width: 48px;
        padding: 14px 16px;
    }
    
    input, select, textarea {
        min-height: 48px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    input:focus, select:focus, textarea:focus, button:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .form-group input,
    .form-group select {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .status-message.success {
        background: #1e4620;
        color: #a7d3a7;
        border-color: #2d5f30;
    }
    
    .status-message.error {
        background: #4a1215;
        color: #f5a3a3;
        border-color: #6b1b20;
    }
}

/* 减少动画 (尊重用户偏好) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 响应式字体大小 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
}

/* 焦点可见性改进 */
:focus-visible {
    outline: 3px solid #2ECC71;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 加载状态可访问性 */
.loading-overlay[aria-hidden="true"] {
    display: none;
}

/* 语言切换器可访问性 */
.lang-btn[aria-expanded="true"] + .lang-menu {
    display: block;
}

.lang-option:focus {
    background: #f7f9fb;
    outline: 2px solid #2ECC71;
    outline-offset: -2px;
}
