/* ==========================================================================
/* ==========================================================================
   天津诚悦供应链网站 - 主样式文件
   ========================================================================== */

/* CSS变量定义 - 优化后的设计系统 */
:root {
    /* 颜色系统 */
    --primary-color: #2E86AB;
    --secondary-color: #A23B72;
    --accent-color: #F18F01;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg-color: #FFFFFF;
    --light-bg: #F8F9FA;
    --border-color: #E5E5E5;
    --error-color: #DC3545;
    --success-color: #28A745;
    --warning-color: #FFC107;
    
    /* 字体系统 */
    --font-family-base: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: var(--font-family-base);
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    
    /* 间距系统 */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */
    
    /* 边框和圆角 */
    --border-width: 1px;
    --border-radius-sm: 0.25rem;  /* 4px */
    --border-radius-md: 0.5rem;   /* 8px */
    --border-radius-lg: 0.75rem;  /* 12px */
    --border-radius-xl: 1rem;     /* 16px */
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* 过渡动画 */
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index层级 */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* 全局重置和基础样式 - 优化版本 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 无障碍跳过链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    z-index: var(--z-tooltip);
    font-weight: 600;
    transition: top var(--transition-fast) var(--transition-timing);
}

.skip-link:focus {
    top: 6px;
}

/* 减少动画偏好设置 */
@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 (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow-md: 0 0 0 2px #000000;
    }
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999998;
    padding: var(--spacing-lg) 0;
    transition: all var(--transition-normal) ease;
    transform: translateZ(0);
    backface-visibility: hidden;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-color);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo i {
    font-size: 1.2em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-2xl);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-normal) ease;
    position: relative;
    padding: var(--spacing-sm) 0;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal) ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* 移动端菜单按钮 */
.mobile-menu {
    display: none;
    cursor: pointer;
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    padding: var(--spacing-sm);
    border: none;
    background: none;
    transition: transform var(--transition-normal) ease;
}

.mobile-menu:hover {
    transform: scale(1.1);
}

/* 主要内容区 */
.main-content {
    margin-top: 80px;
    position: relative;
    z-index: 0;
}

/* Hero 区域样式 */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-bg.jpg') center/cover;
    opacity: 0.2;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background-image: url('../images/hero-bg.jpg');
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: var(--spacing-xl);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, var(--font-size-4xl));
    margin-bottom: var(--spacing-lg);
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, var(--font-size-xl));
    margin-bottom: var(--spacing-2xl);
    opacity: 0.9;
    line-height: 1.5;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: var(--spacing-lg) var(--spacing-2xl);
    background: linear-gradient(135deg, var(--accent-color), #E07A00);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(241, 143, 1, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::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 var(--transition-slow) ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover,
.btn:focus {
    background: linear-gradient(135deg, #E07A00, var(--accent-color));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(241, 143, 1, 0.4);
}

.btn:active {
    transform: translateY(0) scale(1.02);
}

/* 节样式 */
.section {
    padding: var(--spacing-2xl) 0;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
    font-weight: 700;
    contain: layout style paint;
}

.section-subtitle {
    text-align: center;
    font-size: var(--font-size-lg);
    color: #666;
    margin: 0 auto var(--spacing-2xl);
    max-width: 600px;
    line-height: 1.6;
}

/* 背景变化 */
.section-alternate {
    background: var(--light-bg);
}

/* 关于我们样式 */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.about-text h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
    font-weight: 600;
}

.about-text p {
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* 服务网格样式 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-2xl);
}

.service-card {
    background: white;
    padding: var(--spacing-2xl) var(--spacing-xl);
    border-radius: var(--border-radius-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: translateX(-100%);
    transition: transform var(--transition-normal) ease;
}

.service-card:hover::before,
.service-card:focus-within::before {
    transform: translateX(0);
}

.service-card:hover,
.service-card:focus-within {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    transition: transform var(--transition-normal) ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    font-weight: 600;
}

.service-card p {
    line-height: 1.6;
    color: #666;
}

/* 联系我们区域特殊优化 */
#contact.section {
    padding: calc(var(--spacing-2xl) * 0.85) 0;
}

/* 联系我们样式 */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start; /* 改为顶部对齐，保持左侧原样式 */
}

.contact-info h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    font-weight: 600;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: calc(var(--spacing-sm) * 1.2);
    padding: calc(var(--spacing-xs) * 1.3);
    border-radius: var(--border-radius-md);
    transition: background-color var(--transition-normal) ease;
}

.contact-item:hover {
    background-color: rgba(46, 134, 171, 0.05);
}

.contact-item i {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    margin-right: var(--spacing-md);
    width: 20px;
    text-align: center;
}

/* 表单验证样式增强 */
.contact-form {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* 禁用浏览器默认验证样式 */
input:invalid,
textarea:invalid {
    box-shadow: none;
}

input::-webkit-validation-bubble {
    display: none;
}

input::-moz-error-text {
    display: none;
}

/* 移动端优化 */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
}

@media (max-width: 768px) {
    .contact-form {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .contact-form .form-group textarea {
        min-height: 60px; /* 移动端进一步减小 */
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    .contact-form {
        padding: var(--spacing-md);
    }
    
    .contact-form .form-group textarea {
        min-height: 50px; /* 小屏幕更紧凑 */
        max-height: 80px;
    }
}

.form-group {
    margin-bottom: calc(var(--spacing-md) * 1.1);
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-color);
    transition: color var(--transition-normal) ease;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-normal) ease;
    background-color: #f5f5f5;
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ccc;
    background-color: #f8f8f8;
    box-shadow: 0 0 0 1px rgba(204, 204, 204, 0.3);
    transform: none;
}

.form-group input:invalid:not(:focus),
.form-group textarea:invalid:not(:focus) {
    border-color: var(--border-color);
    background-color: #f5f5f5;
}

.form-group input:valid:not(:focus),
.form-group textarea:valid:not(:focus) {
    border-color: var(--border-color);
    background-color: #f5f5f5;
}

.form-group textarea {
    resize: vertical;
    min-height: 55px; /* 适度增加文本框高度 */
    max-height: 85px; /* 适度增加最大高度 */
    font-family: inherit;
    line-height: 1.4;
}

/* 字数统计器 */
.character-counter {
    font-size: var(--font-size-sm);
    color: #666;
    text-align: right;
    margin-top: var(--spacing-xs);
    transition: color var(--transition-fast) ease;
}

.character-counter.warning {
    color: #666;
    font-weight: 500;
}

.character-counter.danger {
    color: #666;
    font-weight: 600;
}

/* 字段帮助信息 */
.field-help {
    font-size: var(--font-size-sm);
    color: #666;
    margin-top: var(--spacing-xs);
    line-height: 1.4;
    opacity: 0.8;
    transition: opacity var(--transition-normal) ease;
}

.form-group:focus-within .field-help {
    opacity: 1;
    color: var(--primary-color);
}

.field-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: var(--spacing-xs);
}

/* 表单進度指示器 */
.form-progress {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: var(--light-bg);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: var(--font-size-sm);
    color: #666;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.progress-text.completed {
    color: var(--success-color);
    font-weight: 600;
}

/* 邮箱提示样式 */
.email-hint {
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-xs);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.email-hint::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.email-hint.success::before {
    background: var(--success-color);
}

.email-hint.warning::before {
    background: var(--warning-color);
}

/* 图片懒加载样式 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

img.error {
    opacity: 0.7;
    filter: grayscale(100%);
}

/* 错误状态样式 */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: var(--error-color) !important;
    background-color: rgba(220, 53, 69, 0.05);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group.error label {
    color: var(--error-color);
}

.field-error {
    color: var(--error-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.field-error::before {
    content: '●';
    font-size: var(--font-size-xs);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功状态样式 */
.form-group.success input,
.form-group.success textarea {
    border-color: var(--success-color) !important;
    background-color: rgba(40, 167, 69, 0.05);
}

.form-group.success label {
    color: var(--success-color);
}

.field-success {
    color: var(--success-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.field-success::before {
    content: '✓';
    font-weight: bold;
    font-size: var(--font-size-sm);
}

/* 加载状态样式 */
.loading {
    display: none;
    text-align: center;
    padding: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 500;
    position: relative;
}

.loading.show {
    display: block;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 按钮禁用状态优化 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(241, 143, 1, 0.2) !important;
}

.btn:disabled::before {
    animation: none;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(46, 134, 171, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--spacing-sm);
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 按钮增强 */
.btn {
    display: inline-block;
    padding: var(--spacing-lg) var(--spacing-2xl);
    background: linear-gradient(135deg, var(--accent-color), #E07A00);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(241, 143, 1, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn::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 var(--transition-slow) ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover:not(:disabled),
.btn:focus:not(:disabled) {
    background: linear-gradient(135deg, #E07A00, var(--accent-color));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(241, 143, 1, 0.4);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(1.02);
}

/* 消息提示样式 */
.message {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-md) 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideIn 0.3s ease-out;
}

.message-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--success-color);
}

.message-success::before {
    content: '✓';
    font-weight: bold;
    font-size: var(--font-size-lg);
}

.message-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--error-color);
}

.message-error::before {
    content: '⚠️';
    font-size: var(--font-size-lg);
}

.message-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--warning-color);
}

.message-warning::before {
    content: '⚠️';
    font-size: var(--font-size-lg);
}

.message-info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.3);
    color: var(--info-color);
}

.message-info::before {
    content: 'i';
    font-weight: bold;
    font-size: var(--font-size-lg);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--info-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 新闻样式 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-2xl);
}

.news-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal) ease;
    cursor: pointer;
}

.news-card:hover,
.news-card:focus {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.news-image {
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal) ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: var(--spacing-xl);
}

.news-date {
    color: var(--accent-color);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.news-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    line-height: 1.4;
    font-weight: 600;
}

.news-card p {
    color: #666;
    line-height: 1.6;
}

/* 页脚样式 */
.footer {
    background: var(--text-color);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-section h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-lg);
    color: var(--accent-color);
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 1.8;
    transition: color var(--transition-normal) ease;
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-xl);
    border-top: 1px solid #555;
    color: #999;
}

/* 语言切换器样式 */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: var(--spacing-lg);
    z-index: 999999;
}

.language-toggle {
    display: flex;
    align-items: center;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-normal) ease;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
}

.language-toggle:hover {
    border-color: var(--primary-color);
    background: white;
}

.language-toggle i {
    margin-right: var(--spacing-sm);
    color: var(--primary-color);
}

.language-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 150px;
    z-index: 9999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal) ease;
    pointer-events: none;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.language-option {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
    border-bottom: 1px solid var(--border-color);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.language-option.active {
    background: var(--primary-color);
    color: white;
}

.language-flag {
    margin-right: var(--spacing-sm);
    font-size: var(--font-size-base);
}

/* 工具类 */
.loading {
    display: none;
    text-align: center;
    padding: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 500;
}

.loading.show {
    display: block;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm);
    text-decoration: none;
    z-index: 10000;
    border-radius: var(--border-radius-sm);
    transition: top var(--transition-normal) ease;
}

.skip-link:focus {
    top: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.required {
    color: var(--error-color);
}

/* 图片优化 */
img {
    loading: lazy;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

img[loading="eager"] {
    loading: eager;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 性能优化样式 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    will-change: transform;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 图片懒加载优化 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[data-src].loaded {
    opacity: 1;
}

/* 预加载关键资源 */
.preload-image {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* 更新通知样式 */
.update-notification {
    animation: slideInRight 0.3s ease-out;
}

.update-notification .update-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.update-notification .btn {
    align-self: flex-start;
    margin-right: 8px;
}

.update-notification .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 性能优化：减少重绘和回流 */
.hero-content h1,
.hero-content p,
.btn,
.service-card,
.contact-item {
    will-change: transform;
}

.hero-content h1:hover,
.hero-content p:hover,
.btn:hover,
.service-card:hover,
.contact-item:hover {
    will-change: auto;
}

/* 优化滚动性能 */
.navbar.scrolled {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 优化动画性能 */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        animation: fadeIn 0.6s ease-out;
    }
    
    .slide-up {
        animation: slideUp 0.8s ease-out;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 移动端优化 */
@media (max-width: 768px) {
    /* 触摸友好的按钮尺寸 */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 表单输入框优化 */
    .form-group input,
    .form-group textarea,
    .form-group select {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px 16px;
    }
    
    /* 移动端导航优化 */
    .mobile-menu {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* 触摸反馈 */
    .btn:active,
    .service-card:active,
    .contact-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* 移动端消息提示优化 */
    .message {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
    
    /* 移动端更新通知优化 */
    .update-notification {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero {
        background-image: url('../images/hero-bg@2x.jpg');
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 400px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .nav-content {
        flex-wrap: wrap;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: var(--spacing-lg) 0;
        gap: var(--spacing-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path var(--transition-normal) ease;
        box-shadow: var(--shadow-lg);
        z-index: 9999;
    }

    .nav-menu.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .mobile-menu {
        display: block;
    }

    .language-switcher {
        order: -1;
        margin-left: 0;
        margin-right: var(--spacing-md);
    }

    .hero h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .hero p {
        font-size: clamp(0.875rem, 4vw, 1.125rem);
        padding: 0 var(--spacing-sm);
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .services-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    /* 移动端表单优化 - 关键改进 */
    .contact-form {
        padding: var(--spacing-lg) var(--spacing-md);
        margin-top: var(--spacing-md);
    }
    
    .form-group {
        margin-bottom: var(--spacing-md); /* 减少间距 */
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: var(--spacing-md) var(--spacing-sm); /* 减少内边距 */
        font-size: var(--font-size-sm);
    }
    
    .form-group textarea {
        min-height: 80px; /* 减少文本域高度 */
        resize: none; /* 禁用手动调整大小 */
    }
    
    /* 简化表单进度指示器 */
    .form-progress {
        margin: var(--spacing-sm) 0;
        padding: var(--spacing-sm);
    }
    
    .progress-bar {
        height: 4px; /* 减少进度条高度 */
    }
    
    /* 简化字段帮助信息 */
    .field-help {
        font-size: var(--font-size-xs);
        line-height: 1.3;
        margin-top: var(--spacing-xs);
    }
    
    /* 优化字符计数器 */
    .character-counter {
        font-size: var(--font-size-xs);
    }
    
    /* 简化消息样式 */
    .message {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
    
    .language-toggle {
        padding: 6px 12px;
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: var(--spacing-lg);
    }
    
    .btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
    
    .service-card {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    /* 超小屏幕表单极简优化 */
    .contact-form {
        padding: var(--spacing-md);
        border-radius: var(--border-radius-md);
    }
    
    .form-group {
        margin-bottom: var(--spacing-sm); /* 进一步减少间距 */
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: var(--spacing-sm);
        font-size: var(--font-size-sm);
        border-width: 1px; /* 减少边框宽度 */
    }
    
    .form-group textarea {
        min-height: 60px; /* 进一步减小文本域 */
    }
    
    .form-group label {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-xs);
    }
    
    /* 隐藏进度指示器以节省空间 */
    .form-progress {
        display: none;
    }
    
    /* 简化帮助信息 */
    .field-help {
        display: none; /* 在最小屏幕上隐藏帮助信息 */
    }
    
    .field-meta {
        justify-content: flex-end; /* 只显示字符计数器 */
    }
    
    /* 优化按钮尺寸 */
    .contact-form .btn {
        width: 100%;
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }
    
    /* 优化错误消息 */
    .field-error {
        font-size: var(--font-size-xs);
    }
    
    .message {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .mobile-menu,
    .btn,
    .language-switcher {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }

    .hero {
        background: none;
        color: black;
        page-break-inside: avoid;
    }
    
    .section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #800080;
        --accent-color: #FF6600;
        --text-color: #000000;
        --bg-color: #FFFFFF;
        --border-color: #000000;
    }
    
    .btn {
        border: 2px solid #000000;
    }
    
    .service-card,
    .news-card,
    .contact-form {
        border: 2px solid #000000;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --light-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    .navbar {
        background: rgba(26, 26, 26, 0.95);
    }
    
    .service-card,
    .news-card,
    .contact-form {
        background: var(--light-bg);
        color: var(--text-color);
    }
}
.phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.phone-row select {
  flex: 0 0 90px;
  text-align: center;
  text-align-last: center;
  -moz-text-align-last: center;
}
.phone-row input[type="tel"] {
  flex: 1 1 auto;
}