/* 全局样式 */
:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --accent-color: #38bdf8;
    --text-color: #1e293b;
    --light-text: #64748b;
    --background-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* 排版变量 */
    --header-height: 80px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 所有i标签（图标）与h3在同一行显示，垂直居中 */
i {
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
}

/* 确保flex容器中的i和h3垂直居中对齐 */
.flex.items-center {
    align-items: center;
}

/* 减少包含i和h3的div高度 */
.flex.items-center h3 {
    margin-bottom: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 链接样式 */
a {
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* 按钮样式增强 */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* 卡片样式 */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 列表样式 */
ul, ol {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 动画类 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes rotateIn {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(90deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 确保内容区块默认可见 */
.section-content {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* 动画类应用 */
.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease forwards;
}

.animate-slideDown {
    animation: slideDown 0.3s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.3s ease forwards;
}

.animate-fadeInUp,
.animate-fade-in-up {
    animation: fadeInUp 0.7s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.7s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.7s ease forwards;
}

.animate-pulse {
    animation: pulse 0.5s ease-in-out;
}

.animate-rotateIn {
    animation: rotateIn 0.3s ease forwards;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 图片悬停效果增强 */
.img-hover-zoom img {
    transition: transform 0.5s ease;
    width: 100%;
    height: auto;
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* 表单焦点效果增强 */
.form-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* 按钮动画效果 */
.btn-hover-effect {
    transition: all 0.3s ease;
}

.btn-hover-effect:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-hover-effect:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px -3px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* 响应式辅助类 */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
    
    .mobile-full-width {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none;
    }
}

/* 过渡效果 */
.transition-all {
    transition: all 0.3s ease;
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-500 {
    transition-duration: 500ms;
}

.duration-700 {
    transition-duration: 700ms;
}

/* 视差滚动效果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 阴影效果 */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 透明度和可见性 */
.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/* 变换 */
.translate-y-0 {
    transform: translateY(0);
}

.translate-y-4 {
    transform: translateY(1rem);
}

.translate-y-8 {
    transform: translateY(2rem);
}

.translate-x-0 {
    transform: translateX(0);
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

.scale-105 {
    transform: scale(1.05);
}

/* Z-index */
.z-0 {
    z-index: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

/* 导航栏滚动效果 */
#navbar {
    transition: all 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    transition: all 0.3s ease;
}

/* 导航菜单优化 */
nav a {
    position: relative;
    font-weight: 500;
    letter-spacing: 0.02em;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* 图片悬停效果 */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 表单焦点效果 */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.2);
    border-color: #1a56db;
}

/* 按钮动画 */
button {
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* 加载动画 */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #1a56db;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

/* 页面加载器备援：2秒后自动隐藏，防止JS失败时遮罩挡住页面 */
@keyframes hidePageLoader {
    0% { opacity: 1; pointer-events: auto; }
    99% { opacity: 0; pointer-events: none; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
#page-loader {
    animation: hidePageLoader 2s ease-out forwards;
    animation-delay: 1.5s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计辅助类 */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* 内容动画效果优化 */
.section-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* 保留visible类用于特殊情况 */
.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 标题排版优化 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

/* 段落排版优化 */
p {
    margin-bottom: var(--spacing-md);
    font-size: 1rem;
    line-height: 1.7;
}

/* 卡片排版优化 */
.card {
    padding: var(--spacing-xl);
    border-radius: 12px;
    transition: all 0.4s ease;
    min-height: 100%; /* 确保卡片高度一致 */
    display: flex;
    flex-direction: column;
}

/* 产品卡片优化 */
.product-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card .p-5, .product-card .p-6 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    margin-bottom: var(--spacing-sm);
}

.product-card p {
    flex: 1; /* 让描述文本占据剩余空间 */
    margin-bottom: var(--spacing-md);
    min-height: 60px; /* 设置最小高度，防止内容过短导致布局问题 */
}

/* 按钮优化 */
button, .btn {
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    transition: all 0.3s ease;
}

/* 网格间距优化 */
.grid {
    gap: var(--spacing-lg);
    display: grid;
}

/* 确保多列布局中卡片高度一致 */
.grid > div {
    display: flex;
    flex-direction: column;
}

/* 英文版本响应式字体调整 */
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] h4 {
    line-height: 1.4; /* 英文版标题行高略大，避免文字拥挤 */
}

/* 英文版本卡片内容优化 */
html[lang="en"] .product-card p, html[lang="en"] .card p {
    line-height: 1.7; /* 英文版段落行高优化 */
    font-size: 0.95rem; /* 英文版字体稍小，避免文本过长 */
}

/* 特色产品区域优化 */
.featured-products-section .grid {
    align-items: start;
}

/* 响应式容器优化 */
.container {
    max-width: 1280px;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    /* 排版优化 */
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* 小屏幕下卡片布局优化 */
    .product-card p {
        min-height: 50px;
    }
    
    /* 导航栏优化 */
    #navbar {
        padding: var(--spacing-md);
    }
    
    /* 英雄区域优化 */
    .hero-section {
        padding: var(--spacing-2xl) var(--spacing-md);
    }
    
    /* 移动端菜单优化 */
    #mobile-menu {
        width: 85vw;
        height: 100vh;
        padding: var(--spacing-xl);
        background-color: white;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    #mobile-menu a {
        display: block;
        padding: var(--spacing-md) 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    #mobile-menu a:last-child {
        border-bottom: none;
    }
    
    /* 卡片布局优化 */
    .card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    /* 网格系统优化 */
    .grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* 按钮大小调整 */
    .btn {
        width: 100%;
        padding: var(--spacing-md) var(--spacing-xl);
    }
    
    /* 表单元素优化 */
    input, textarea {
        width: 100%;
        padding: var(--spacing-md);
    }
    
    /* 页脚布局调整 */
    footer .grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* 图片响应式调整 */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 大屏幕优化 */
@media (min-width: 1280px) {
    .container {
        padding: 0;
    }
}

/* 移动端交互优化 */
.touch-friendly {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.touch-friendly:active {
    transform: scale(0.98);
}

/* 防止移动端文本缩放 */
@media (max-width: 768px) {
    html {
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
    }
}

/* 移动端导航按钮优化 */
#mobile-menu-btn {
    z-index: 9999;
    background: transparent;
    border: none;
    padding: var(--spacing-sm);
}

/* 导航栏动画 */
#mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
    overflow: visible;
}

body.menu-open {
    overflow: hidden;
}

/* 卡片悬停效果增强 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 渐变文本 */
.gradient-text {
    background: linear-gradient(90deg, #1a56db, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 阴影效果 */
.shadow-custom {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 分隔线样式 */
.divider {
    position: relative;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

/* 背景图案 */
.bg-pattern {
    background-image: radial-gradient(#1a56db 0.5px, transparent 0.5px), radial-gradient(#1a56db 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #ffffff;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 计数器动画 */
.counter {
    counter-reset: count 0;
    animation: count 2s forwards ease-out;
}

@keyframes count {
    to {
        counter-reset: count var(--value);
    }
}

.counter::after {
    content: counter(count);
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 3D翻转效果 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}