/* 兼容性修复 - 仅包含必要的修复，不影响布局 */

/* 1. 修复iOS 100vh问题 */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* 2. 防止移动端横向滚动 */
html {
    overflow-x: hidden;
}

/* 3. 自定义滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(193, 155, 92, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-brown);
}

/* 4. iOS表单元素样式统一 */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
    -webkit-appearance: none;
    border-radius: 8px;
}

/* 5. 移动端点击高亮移除 */
button,
.btn,
a {
    -webkit-tap-highlight-color: transparent;
}

/* 6. 文本选择颜色 */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* 7. 焦点样式优化 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 8. 打印样式 */
@media print {
    .navbar,
    .footer,
    .mobile-menu-toggle,
    .hero-background,
    .progress-bar,
    button[style*="position: fixed"] {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* 9. 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
}

/* 10. 减少动画偏好 */
@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;
    }
}

/* 11. 安全区域适配（iPhone X及以上） */
@supports (padding: max(0px)) {
    .navbar .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* 12. 防止iOS字体大小调整导致缩放 */
@media (max-width: 768px) {
    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }
}