/* =========================================================================
   HSE Plastic - Global Styles
   ========================================================================= */

/* --- 1. CSS Variables / Design Tokens --- */
:root {
    /* Colors */
    --color-primary: #0056b3;
    --color-primary-hover: #004494;
    --color-secondary: #f0f7ff;
    --color-text-dark: #222222;
    --color-text-main: #444444;
    --color-text-light: #777777;
    --color-bg-light: #f8f9fa;
    --color-white: #ffffff;
    --color-border: #e0e0e0;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Global Spacing */
    --spacing-xs: 0.5rem;   /* 8px */
    --spacing-sm: 1rem;     /* 16px */
    --spacing-md: 2rem;     /* 32px */
    --spacing-lg: 4rem;     /* 64px */
    --spacing-xl: 6rem;     /* 96px */

    /* Shadows & Radii */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* --- 2. CSS Reset & Global Rules --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-main);
    color: var(--color-text-main);
    background-color: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 3. Utilities --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.text-center { text-align: center; }
.text-white { color: var(--color-white); }
.bg-light { background-color: var(--color-bg-light); }

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

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 2.25rem;
    color: var(--color-text-dark);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

.title-divider {
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}
.title-divider.divider-light {
    background-color: var(--color-white);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}


/* --- 4. Header & Navigation --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.site-header.header-scrolled {
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    padding: 5px 0;
}

/* --- Navigation Active State --- */
.main-nav a.active::after {
    width: 100% !important;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-img {
    height: 40px;
    /* 占位空框样式 */
    min-width: 140px;
    background-color: #eee;
    border-radius: 4px;
}

.main-nav .nav-list {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--color-text-dark);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-fast);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-dark);
}
.lang-switch:hover {
    color: var(--color-primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-text-dark);
    cursor: pointer;
}

/* --- 5. Hero Section --- */
.hero-section {
    margin-top: 80px; /* Offset for fixed header */
    height: calc(100vh - 80px);
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

.hero-slider {
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #333; /* Fallback for placeholder */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--color-white);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-text {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

/* Simple Animation Classes */
.animate-up {
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.8s forwards;
}
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

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

/* --- 6. Advantages Section --- */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.advantage-card {
    background: var(--color-white);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.advantage-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.advantage-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background-color: var(--color-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advantage-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.advantage-card h3 {
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.advantage-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* --- 7. About Short Section --- */
.about-flex {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-image-wrapper {
    flex: 1;
}

.about-image {
    width: 100%;
    min-height: 350px;
    background-color: #ddd;
    border-radius: var(--radius-md);
    object-fit: cover;
}
.rounded-shadow {
    box-shadow: var(--shadow-md);
}

.about-content {
    flex: 1;
}

.about-content .section-title {
    margin-bottom: 0.5rem;
}

.about-subtitle {
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* --- 8. Precision Section --- */
.precision-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    padding: 6rem 0;
    background-color: #222;
}

.precision-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 30, 80, 0.7); /* Deep blue overlay */
}

.precision-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.precision-content .section-title {
    color: var(--color-white);
}

.precision-en {
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.8);
}

.precision-desc {
    font-size: 1.15rem;
    line-height: 1.8;
}

/* --- Equipment Carousel --- */
.equip-section {
    padding: var(--spacing-lg) 0;
    overflow: hidden;
}

.equip-container {
    position: relative;
    max-width: 100%;
}

.equip-track {
    display: flex;
    overflow-x: hidden;
    gap: 2rem;
    padding: 1rem 0;
    white-space: nowrap;
}

.equip-item {
    flex: 0 0 450px; /* 放大 50% (原来300px) */
    height: 300px;
    background-color: #eee;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.equip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 9. Products Center --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.product-category-card {
    display: block;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.product-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-category-card .img-box {
    width: 100%;
    height: 220px;
    background-color: #eee;
    overflow: hidden;
}

.product-category-card .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-category-card:hover .img-box img {
    transform: scale(1.05);
}

.product-category-card .info-box {
    padding: 1.5rem;
    text-align: center;
    background-color: var(--color-white);
}

.product-category-card .info-box h4 {
    color: var(--color-text-dark);
    font-size: 1.25rem;
    font-weight: 600;
}

/* --- 10. Footer --- */
.site-footer {
    background-color: #1a1a1a;
    color: #cccccc;
    padding-top: var(--spacing-lg);
}

.pb-40 {
    padding-bottom: 2.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 3rem;
}

.footer-logo-text {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.8;
}

.widget-title {
    color: var(--color-white);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-primary);
}

.footer-links li, .contact-info li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cccccc;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-white);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.contact-info i {
    margin-top: 4px;
    color: var(--color-primary);
}

.qrcode-wrapper {
    width: 120px;
    height: 120px;
    background-color: #fff;
    padding: 10px;
    border-radius: var(--radius-sm);
}

.qrcode-wrapper img {
    width: 100%;
    height: 100%;
}

.footer-bottom {
    background-color: #111111;
    padding: 1.5rem 0;
    border-top: 1px solid #333;
}

.copyright-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.copyright-flex a {
    color: #cccccc;
}
.copyright-flex a:hover {
    color: var(--color-white);
}

/* --- Responsive Design (Media Queries) --- */

@media (max-width: 1024px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 60px;
    }
    .hero-section {
        margin-top: 60px;
        height: auto;
        padding: 6rem 0;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none; /* In a real app, toggle un-hidden class */
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--color-white);
        box-shadow: var(--shadow-md);
        padding: 1rem 0;
    }
    .main-nav.active {
        display: block;
    }
    .main-nav .nav-list {
        flex-direction: column;
        gap: 0;
    }
    .main-nav .nav-list li {
        text-align: center;
    }
    .main-nav a {
        display: block;
        padding: 1rem;
    }
    
    .about-flex {
        flex-direction: column;
        gap: 2rem;
    }
    
    .advantages-grid, .products-grid, .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .copyright-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* --- 11. Internal Pages Common Styles --- */
.page-banner {
    margin-top: 80px;
    height: 300px;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .page-banner {
        margin-top: 60px;
        height: 200px;
    }
}
.banner-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.banner-content {
    position: relative;
    z-index: 2;
}
.banner-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.banner-content p {
    font-size: 1.2rem;
    letter-spacing: 2px;
}
.page-content-wrapper {
    padding: var(--spacing-lg) 0;
}
.breadcrumb {
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
    color: var(--color-text-light);
}
.breadcrumb a {
    color: var(--color-text-main);
}
.breadcrumb a:hover {
    color: var(--color-primary);
}

/* --- Tabs System (Redesigned) --- */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 0; /* No gap, use dividers instead */
    margin-bottom: 3rem;
    border: 1px solid var(--color-border);
    border-width: 1px 0;
    padding: 0;
    flex-wrap: wrap;
    background-color: #fcfcfc;
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    border-right: 1px solid var(--color-border);
    background: transparent;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    min-width: 160px;
    text-align: center;
}

.tab-btn:first-child {
    border-left: 1px solid var(--color-border);
}

.tab-btn:hover {
    background-color: #f0f0f0;
    color: var(--color-primary);
}

.tab-btn.active {
    background-color: #001f3f; /* 深蓝色/藏青色 */
    color: #ffffff;
    font-weight: 600;
}

/* Remove bottom active line from previous version */
.tab-btn.active::after {
    display: none;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block !important; /* Ensure it overrides any other display settings */
}

/* --- Product Cards Grid --- */
.product-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.product-card-item {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding-bottom: 1.5rem;
}

.product-card-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-img {
    height: 250px;
    background-color: #f5f5f5;
    overflow: hidden;
    margin-bottom: 1rem;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.product-name {
    font-size: 1.1rem;
    color: var(--color-text-dark);
    font-weight: 600;
}

@media (max-width: 992px) {
    .product-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-cards-grid {
        grid-template-columns: 1fr;
    }
    .tab-btn {
        min-width: 120px;
        font-size: 0.95rem;
    }
}

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