/* --- 基础变量与重置 --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --dark: #1f2937;
    --gray: #585d66;
    --light: #f9fafb;
    --white: #ffffff;
    --secondary: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 导航栏 (全局通用) --- */
.header-actions { display: flex; align-items: center; gap: 16px; }

.header { position: fixed; top: 0; left: 0; right: 0; height: 80px; background: rgba(255, 255, 255, 0.98); border-bottom: 1px solid #e5e7eb; z-index: 1000; display: flex; align-items: center; }
.header-inner { width: 100%; display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; color: #111827; text-decoration: none; }
.logo-icon { width: 180px; height: 38px; background: url("img/yuanli-logo.svg"); display: flex; align-items: center; justify-content: center; background-size: contain; background-repeat: no-repeat; }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--gray); font-weight: 500; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* --- 桌面端下拉导航 --- */
.nav-dropdown { position: relative; height: 80px; display: flex; align-items: center; cursor: pointer; }
.dropdown-menu { 
    position: absolute; 
    top: 80px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 210px; 
    height: 130px; 
    background-color: var(--white); 
    border: 1px solid #e5e7eb; 
    border-top: 2px solid var(--primary); 
    display: none; 
    flex-direction: column; 
    z-index: 1100; 
    border-radius: 0; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.nav-dropdown:hover .dropdown-menu { display: flex; }
.dropdown-menu a { 
    color: var(--dark) !important; 
    font-weight: 400 !important; 
    text-decoration: none; 
    display: flex; 
    align-items: center;
    justify-content: center;
    flex: 1;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.3s, color 0.3s !important; 
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover { background-color: #f3f4f6; color: var(--primary) !important; }

/* 中英文切换 */
.lang-switch { display: flex; gap: 4px; background: #f3f4f6; border-radius: 20px; padding: 4px; }
.lang-switch button { background: transparent; border: none; padding: 4px 12px; border-radius: 16px; cursor: pointer; color: var(--gray); font-size: 14px; font-weight: 600; transition: 0.3s; }
.lang-switch button.active { background: var(--white); color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* 移动端菜单 */
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--gray); }
.mobile-menu { display: none; position: absolute; top: 80px; left: 0; right: 0; background: var(--white); padding: 10px 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); z-index: 1000; }
.mobile-menu.active { display: flex; flex-direction: column; }
.mobile-menu a { padding: 12px 0; text-decoration: none; color: var(--dark); font-weight: 500; border-bottom: 1px solid #f3f4f6; }

/* --- 首页轮播图 --- */
.hero { margin-top: 80px; position: relative; height: 600px; overflow: hidden; background: #111827; }
.hero-slider { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease-in-out; display: flex; align-items: center; z-index: 1; will-change: opacity; }
.slide.active { opacity: 1; z-index: 10; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -2; }
.slide.active .hero-bg { animation: slowZoom 16s ease-in-out infinite; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.4)); z-index: -1; }
.hero-content { position: relative; max-width: 800px; color: var(--white); padding: 0 20px; z-index: 2; }
.hero h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 24px; font-weight: 800; }
.hero h1 .highlight { color: #60a5fa; }
.hero p { font-size: 1.25rem; color: #e2e8f0; margin-bottom: 40px; }

.slider-controls { position: absolute; top: 50%; width: 100%; display: flex; justify-content: space-between; transform: translateY(-50%); z-index: 20; padding: 0 20px; pointer-events: none; }
.slider-controls button { pointer-events: auto; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; font-size: 20px; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px); transition: 0.3s; }
.slider-controls button:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.slider-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 20; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: 0.3s; }
.dot.active { background: white; transform: scale(1.3); }

@keyframes slowZoom {
    0% { transform: scale(1) translateX(0); }
    50% { transform: scale(1.05) translateX(-1.1%); }
    100% { transform: scale(1) translateX(0); }
}

/* --- 独立页面顶部 Banner (全局通用) --- */
.page-banner { margin-top: 80px; padding: 100px 0; background: linear-gradient(135deg, var(--dark), #374151); color: white; text-align: center; }
.page-banner h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; }
.page-banner p { color: #9ca3af; font-size: 1.1rem; }

/* --- 通用组件 (全局) --- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 32px; background: var(--primary); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 1.1rem; transition: 0.3s; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3); cursor: pointer; border: none; }
.btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.section { padding: 64px 0; }
.bg-light { background: var(--light); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-subtitle { display: block; color: var(--secondary); font-weight: 600; text-transform: uppercase; font-size: 2.2rem; margin-bottom: 8px; letter-spacing: 2px; }
.section-title { font-size: 0.95rem; font-weight: 400; color: #41424D; letter-spacing: 1px; }

/* --- 首页卡片样式 --- */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 32px; margin-top: -22px; }
.grid-2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: -22px; }

.card { background: var(--white); padding: 32px; border-radius: 16px; border: 1px solid #f3f4f6; transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: relative; will-change: transform; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); border-color: #bfdbfe; }
.card-icon { width: 56px; height: 56px; background: #eff6ff; color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.card h3 { font-size: 1.25rem; margin-bottom: 12px; font-weight: 700; color: #111827; position: absolute; top: 43px; left: 100px; }
.card p { color: var(--gray); font-size: 1rem; line-height: 1.5; margin-top: 12px; }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: -22px; }
.product-item { border-radius: 12px; overflow: hidden; box-shadow: 0 3px 15px rgba(0,0,0,0.1); transition: transform 0.3s; background: var(--white); }

.product-item img { width: 100%; height: 220px; object-fit: cover; display: block; }
.product-info { padding: 20px; }
.product-info h3 { font-size: 18px; margin-bottom: 10px; color: #333; }
.product-info p { color: var(--gray); font-size: 14px; }

.app-card { position: relative; border-radius: 16px; overflow: hidden; height: 320px; cursor: pointer; }
.app-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.7s ease; will-change: transform; }
.app-card:hover .app-img { transform: scale(1.1); }
.app-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(15,23,42,0.9), transparent); }
.app-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 24px; color: var(--white); }
.app-content h3 { font-size: 24px; margin-bottom: 8px; transform: translateY(10px); transition: transform 0.3s; }
.app-content .hover-link { opacity: 0; font-size: 14px; transition: opacity 0.3s; display: block; }
.app-card:hover .app-content h3 { transform: translateY(0); }
.app-card:hover .app-content .hover-link { opacity: 1; }

/* 首页关于区块 */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-img-wrap { position: relative; }
.about-img { width: 100%; height: 450px; border-radius: 24px; background-size: cover; background-position: center; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.exp-badge { position: absolute; bottom: -30px; right: -30px; background: var(--primary); color: var(--white); padding: 30px; border-radius: 20px; box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3); }
.exp-num { font-size: 40px; font-weight: bold; line-height: 1; margin-bottom: 4px; }
.exp-text { font-size: 14px; opacity: 0.9; }
.about-content h2 { font-size: 36px; color: var(--secondary); margin-bottom: 24px; }
.about-content p { font-size: 16px; color: var(--dark); margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 40px 0; }
.stat-item { border-left: 3px solid var(--primary); padding-left: 20px; }
.stat-num { font-size: 32px; font-weight: bold; color: var(--primary); line-height: 1; margin-bottom: 8px; }
.stat-name { font-size: 15px; font-weight: 500; }
.btn-dark { background: var(--secondary); color: var(--white); border: 2px solid var(--secondary); }
.btn-dark:hover { background: #000; }

/* --- 页脚 (全局) --- */
.footer { background: #111827; color: #9ca3af; padding: 80px 0 24px; border-top: 1px solid #1f2937; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 48px; margin-bottom: 48px; }
.footer h3 { color: white; margin-bottom: 24px; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 12px; font-size: 14px;}
.footer a { color: #9ca3af; text-decoration: none; transition: 0.3s;font-size: 14px;}
.footer a:hover { color: white; }
.footer-bottom { border-top: 1px solid #1f2937; padding-top: 24px; text-align: center; font-size: 0.875rem; }
.footer p{font-size: 14px;}
/* --- 响应式 (全局) --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .hero { height: 500px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .grid-2 { grid-template-columns: 1fr; gap: 20px; }
    .product-grid { grid-template-columns: 1fr; gap: 20px; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .exp-badge { bottom: -20px; right: 0; padding: 20px; }
    .section-subtitle { font-size: 1.8rem; }
    .card h3 { position: static; margin-top: 12px; margin-left: 0; }
    .card-icon { margin-bottom: 12px; }
}
/* --- 项目应用子导航栏（与产品中心样式一致）--- */

.app-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.app-categories li a {
    display: inline-block;
    padding: 8px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: #4b5563;
    background-color: #f3f4f6;
    border-radius: 40px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.app-categories li a:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}
/* 可根据需要添加 active 状态*/

/* 项目应用卡片网格 - 4列 */
.grid-4-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 20px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .grid-4-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .grid-4-cards {
        grid-template-columns: 1fr;
    }
}

/* --- 生产线及设备轮播样式 --- */

.production-section {
    padding: 64px 0 100px 0;
    background: var(--white);
}
.carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 50px;
}
.carousel-wrapper {
    overflow: hidden;
    border-radius: 16px;
}
.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.carousel-item {
    flex: 0 0 calc(33.33% - 20px);
    margin-right: 23px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.carousel-item:last-child {
    margin-right: 0;
}
.carousel-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
/* 纯色半透明背景 + 无模糊、无渐变，避免残影 */
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 12px 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover {
    background: var(--primary);
}
.prev-btn {
    left: 0;
}
.next-btn {
    right: 0;
}
/* 响应式 */
@media (max-width: 992px) {
    .carousel-item {
        flex: 0 0 calc(50% - 20px);
    }
}
@media (max-width: 640px) {
    .carousel-item {
        flex: 0 0 calc(100% - 20px);
    }
    .carousel-container {
        padding: 0 30px;
    }
}