/* CSS Reset and Cross-Browser Compatibility */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Custom styles for manufacturing website */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Navigation hover effects */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Product card hover effects */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Stats counter animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Form styling */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading animation */
.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive image scaling */
.responsive-image {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Fix anchor scrolling for fixed navigation */
html {
    scroll-padding-top: 80px; /* Adjust based on your navigation height */
}

/* Ensure sections have proper spacing for fixed nav */
section[id] {
    scroll-margin-top: 80px; /* Same as scroll-padding-top */
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Custom animations for product items */
.product-item {
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.product-item.hidden {
    opacity: 0;
    transform: translateY(20px);
}

/* Mobile menu styles */
.mobile-menu {
    transition: all 0.3s ease;
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Section spacing */
.section-padding {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
}

/* Custom gradient backgrounds */
.gradient-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.gradient-dark {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar (Webkit browsers only) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Cross-browser compatibility fixes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Flexbox fallbacks */
.flex {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.grid {
    display: -ms-grid;
    display: grid;
}

/* Transform with vendor prefixes */
.transform {
    -webkit-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
}

/* Transition with vendor prefixes */
.transition {
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Animation with vendor prefixes */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

/* Gradient backgrounds with vendor prefixes */
.gradient-blue {
    background: -webkit-linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    background: -o-linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.gradient-dark {
    background: -webkit-linear-gradient(135deg, #111827 0%, #374151 100%);
    background: -o-linear-gradient(135deg, #111827 0%, #374151 100%);
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
}

/* Box shadow with vendor prefixes */
.shadow-lg {
    -webkit-box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Border radius with vendor prefixes */
.rounded-lg {
    -webkit-border-radius: 0.5rem;
    border-radius: 0.5rem;
}

/* Fix for older browsers */
.fallback-bg {
    background-color: #1e3a8a; /* Fallback for gradient */
}

/* Responsive image fixes */
.object-cover {
    -o-object-fit: cover;
    object-fit: cover;
    font-family: 'object-fit: cover;'; /* IE fix */
}

/* Grid layout fallbacks */
@supports not (display: grid) {
    .grid {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .md\\:grid-cols-2 > * {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 50%;
        flex: 0 0 50%;
    }
    
    .md\\:grid-cols-3 > * {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 33.333%;
        flex: 0 0 33.333%;
    }
    
    .md\\:grid-cols-4 > * {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 25%;
        flex: 0 0 25%;
    }
}

/* Animation classes */
.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lazy loading placeholder */
.lazy-placeholder {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom form validation styles */
.form-input:invalid {
    border-color: #ef4444;
}

.form-input:valid {
    border-color: #10b981;
}

/* Focus styles for accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000;
    }
    
    .text-gray-400 {
        color: #333;
    }
    
    .bg-gray-50 {
        background-color: #f0f0f0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Browser-specific fixes */
/* IE and Edge specific fixes */
.browser-ie .grid,
.browser-edge .grid {
    display: -ms-grid;
    display: grid;
}


/* 针对Edge的特定hack */
@supports (-ms-ime-align: auto) {
    /* Edge专属修复 */
    .nav-item {
        margin: 0 8px !important;
        white-space: nowrap;
    }
    
    .header-container {
        min-width: 1200px;
        overflow-x: hidden;
    }
}

/* Safari specific fixes */
.browser-safari .transform {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Firefox specific fixes */
.browser-firefox .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Feature detection fallbacks */
.no-css-grid .grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.no-css-grid .md\\:grid-cols-2 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 50%;
    flex: 0 0 50%;
}

.no-css-grid .md\\:grid-cols-3 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 33.333%;
    flex: 0 0 33.333%;
}

.no-css-grid .md\\:grid-cols-4 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 25%;
    flex: 0 0 25%;
}

/* No flexbox fallback */
.no-flexbox .flex {
    display: block;
}

.no-flexbox .justify-between {
    text-align: center;
}

.no-flexbox .items-center {
    vertical-align: middle;
}

/* No IntersectionObserver fallback */
.no-intersection-observer img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.no-intersection-observer img[data-src].loaded {
    opacity: 1;
}

/* Print optimization */
@media print {
    .no-print {
        display: none !important;
    }
    
    .bg-gradient-to-r {
        background: #1e3a8a !important;
    }
    
    .text-blue-200 {
        color: #000 !important;
    }
    
    .shadow-lg, .shadow-xl {
        box-shadow: none !important;
    }
    
    .transform {
        transform: none !important;
    }
}

/* High DPI screen optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .hover\\:shadow-xl:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
    
    .hover\\:bg-blue-700:hover {
        background-color: #1d4ed8;
    }
    
    .hover\\:text-blue-600:hover {
        color: #2563eb;
    }
}

/* Performance optimizations */
@media (prefers-reduced-data: reduce) {
    img:not([data-critical]) {
        display: none;
    }
    
    .bg-gradient-to-r {
        background: #1e3a8a;
    }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000;
    }
    
    .text-gray-400 {
        color: #333;
    }
    
    .bg-gray-50 {
        background-color: #f0f0f0;
    }
    
    .border-gray-200 {
        border-color: #000;
    }
}

/* Focus management for better accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* 专业导航栏布局优化 - 现代UI设计最佳实践 */
.site-header {
    position: fixed !important;
    width: 100% !important;
    z-index: 50 !important;
    top: 0 !important;
    left: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1) !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

.navbar-container {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    width: 100% !important;
}

.navbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 72px !important;
    gap: 40px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e40af !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    flex-shrink: 0 !important;
    margin-right: auto !important;
}

.navbar-brand:hover {
    color: #3b82f6 !important;
}

.navbar-nav {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 32px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    max-width: 100% !important;
}

.navbar-nav.hidden.md\:block {
    display: flex !important;
}

.nav-item {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    position: relative !important;
}

.navbar-tools {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

/* 确保导航栏始终显示，不隐藏 */
.site-header {
    transform: translateY(0) !important;
}

/* 强制布局样式 */
.navbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}

.navbar-brand {
    flex-shrink: 0 !important;
    margin-right: auto !important;
}

.navbar-nav {
    flex: 1 !important;
    justify-content: center !important;
    display: flex !important;
}

.navbar-tools {
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

/* 专业导航链接样式 */
.nav-link {
    text-decoration: none !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    color: #374151 !important;
    position: relative !important;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #1e40af !important;
    transform: translateY(-1px) !important;
}

.nav-link.active {
    color: #1e40af !important;
    background: rgba(59, 130, 246, 0.12) !important;
}

.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 16px !important;
    right: 16px !important;
    height: 2px !important;
    background: #3b82f6 !important;
    border-radius: 1px !important;
}

/* 下拉菜单优化 */
.nav-item .relative.group {
    position: relative !important;
}

.nav-item .absolute {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
}

.nav-item:hover .absolute {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.navbar-tools {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-shrink: 0 !important;
}

/* 专业语言选择器样式 */
.language-selector {
    position: relative !important;
    display: inline-block !important;
}

.language-selector button {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.language-selector button:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px) !important;
}

.language-dropdown {
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    background: white !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    border-radius: 12px !important;
    padding: 8px 0 !important;
    min-width: 180px !important;
    z-index: 1001 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-8px) !important;
    transition: all 0.3s ease !important;
}

.language-selector:hover .language-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.language-dropdown a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    text-decoration: none !important;
    color: #374151 !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.language-dropdown a:last-child {
    border-bottom: none !important;
}

.language-dropdown a:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #1e40af !important;
}

/* 响应式优化 */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 20px !important;
    }
    
    .navbar-nav {
        gap: 24px !important;
    }
    
    .nav-link {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        min-height: 64px !important;
        gap: 20px !important;
    }
    
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .navbar-nav {
        gap: 16px !important;
    }
    
    .nav-link {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* 滚动效果增强 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    animation: fadeInDown 0.6s ease-out;
}

/* 移动端菜单按钮优化 */
.mobile-menu-button {
    display: none !important;
    background: none !important;
    border: none !important;
    padding: 8px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.mobile-menu-button:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

@media (max-width: 768px) {
    .mobile-menu-button {
        display: block !important;
    }
    
    .navbar-nav.hidden.md\:block {
        display: none !important;
    }
}

/* 专业阴影和深度效果 */
.site-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

/* 微交互增强 */
.nav-link {
    position: relative !important;
    overflow: hidden !important;
}

.nav-link::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent) !important;
    transition: left 0.6s ease !important;
}

.nav-link:hover::before {
    left: 100% !important;
}
.site-header {
    position: fixed !important;
    width: 100% !important;
    z-index: 50 !important;
    top: 0 !important;
    left: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1) !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(0) !important; /* 确保不隐藏 */
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

.navbar-container {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    width: 100% !important;
}

.navbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 72px !important;
    gap: 40px !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: row !important;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e40af !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    flex-shrink: 0 !important;
    margin-right: auto !important;
}

.navbar-brand:hover {
    color: #3b82f6 !important;
}

.navbar-nav {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 32px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    max-width: 100% !important;
}

.navbar-nav.hidden.md\:block {
    display: flex !important;
}

.nav-item {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    position: relative !important;
}

.navbar-tools {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

/* 专业导航链接样式 */
.nav-link {
    text-decoration: none !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    color: #374151 !important;
    position: relative !important;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #1e40af !important;
    transform: translateY(-1px) !important;
}

.nav-link.active {
    color: #1e40af !important;
    background: rgba(59, 130, 246, 0.12) !important;
}

.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 16px !important;
    right: 16px !important;
    height: 2px !important;
    background: #3b82f6 !important;
    border-radius: 1px !important;
}

/* 响应式优化 */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 20px !important;
    }
    
    .navbar-nav {
        gap: 24px !important;
    }
    
    .nav-link {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        min-height: 64px !important;
        gap: 20px !important;
    }
    
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .navbar-nav {
        gap: 16px !important;
    }
    
    .nav-link {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* 滚动效果增强 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    animation: fadeInDown 0.6s ease-out;
}

/* 专业阴影和深度效果 */
.site-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}
```