/**
 * 京禾科技官方網站 - 主樣式表
 * Design Reference: yankey.com style
 */

/* ============================================
   CSS Variables & Root Styles
   ============================================ */
:root {
    /* 主色調 */
    --primary-color: #1a365d;
    --primary-light: #2d4a7c;
    --primary-dark: #0f2341;

    /* 強調色 */
    --accent-color: #3182ce;
    --accent-light: #63b3ed;
    --accent-dark: #2563eb;

    /* 中性色 */
    --text-color: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;

    /* 背景色 */
    --bg-white: #ffffff;
    --bg-light: #f7fafc;
    --bg-gray: #edf2f7;
    --bg-dark: #1a202c;

    /* 邊框 */
    --border-color: #e2e8f0;
    --border-light: #edf2f7;

    /* 陰影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    /* 字體 */
    --font-primary: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Inter', 'Noto Sans TC', sans-serif;

    /* 間距 */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* 圓角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* 過渡 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Header高度 */
    --header-height: 80px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--accent-dark);
}

ul,
ol {
    list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-color);
    margin-bottom: var(--space-md);
}

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

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--space-md);
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-accent {
    color: var(--accent-color);
}

.text-muted {
    color: var(--text-muted);
}

/* ============================================
   Layout & Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-light));
    border-radius: var(--radius-full);
}

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

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    z-index: 1000;
    transition: all var(--transition-base);
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-light);
}

.header .container {
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.logo img {
    height: 45px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    transition: color var(--transition-fast);
    border-radius: var(--radius-md);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

/* Dropdown */
.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.dropdown-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-color);
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--accent-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    transition: all var(--transition-base);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    max-height: 900px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: var(--header-height);
}

/* Hero Swiper */
.hero-swiper {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.85) 0%, rgba(49, 130, 206, 0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    color: var(--bg-white);
    padding: var(--space-2xl);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--bg-white);
    margin-bottom: var(--space-lg);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 48px;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--bg-white);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--bg-white);
    border-color: var(--bg-white);
}

.btn-outline:hover {
    background: var(--bg-white);
    color: var(--primary-color);
}

.btn-outline-dark {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-dark:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-lg {
    padding: var(--space-md) var(--space-2xl);
    font-size: 1.1rem;
    min-height: 56px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

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

.card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

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

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

.card-body {
    padding: var(--space-lg);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

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

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-md);
}

/* Product Card */
.product-card .card-body {
    text-align: center;
}

.product-card .card-title {
    font-size: 1rem;
}

.product-card .brand-name {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Services Section
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.service-card {
    background: var(--bg-white);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.service-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-color));
    border-radius: var(--radius-xl);
    font-size: 2rem;
}

.service-icon svg,
.service-icon img {
    width: 40px;
    height: 40px;
    fill: var(--bg-white);
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.service-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   Brands Section
   ============================================ */
.brands-slider {
    display: flex;
    gap: var(--space-xl);
    overflow-x: auto;
    padding: var(--space-lg) 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.brands-slider::-webkit-scrollbar {
    display: none;
}

.brand-item {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.brand-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.brand-item img {
    max-height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition-base);
}

.brand-item:hover img {
    filter: grayscale(0);
    opacity: 1;
}

/* ============================================
   News Section
   ============================================ */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
}

.news-card {
    display: flex;
    flex-direction: column;
}

.news-card .card-image {
    aspect-ratio: 16 / 9;
}

.news-date {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.news-category {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-light);
    color: var(--bg-white);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    background: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.about-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.about-text h2 {
    margin-bottom: var(--space-lg);
}

.about-text p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--bg-white);
}

.contact-section h2 {
    color: var(--bg-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--bg-white);
}

.contact-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: var(--space-xs);
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Contact Form */
.contact-form {
    background: var(--bg-white);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-md);
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: var(--bg-white);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
}

.footer-brand {
    margin-bottom: var(--space-lg);
}

.footer-brand .logo-text {
    color: var(--bg-white);
    font-size: 1.75rem;
}

.footer-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-top: var(--space-md);
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bg-white);
    margin-bottom: var(--space-lg);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-light);
}

.footer-bottom {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-color);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: var(--bg-white);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {

    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

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

    /* Mobile Navigation */
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: var(--space-lg);
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: all var(--transition-base);
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link {
        padding: var(--space-md);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: var(--space-lg);
        display: none;
    }

    .nav-item.open .dropdown {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: var(--space-lg);
    }

    .hero-buttons {
        flex-direction: column;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }

    .stat-number {
        font-size: 1.75rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

/* AOS-like animation classes */
[data-aos] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Utilities
   ============================================ */
.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--space-sm);
}

.mb-2 {
    margin-bottom: var(--space-md);
}

.mb-3 {
    margin-bottom: var(--space-lg);
}

.mb-4 {
    margin-bottom: var(--space-xl);
}

.mb-5 {
    margin-bottom: var(--space-2xl);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--space-sm);
}

.mt-2 {
    margin-top: var(--space-md);
}

.mt-3 {
    margin-top: var(--space-lg);
}

.mt-4 {
    margin-top: var(--space-xl);
}

.mt-5 {
    margin-top: var(--space-2xl);
}

.py-1 {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.py-2 {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.py-3 {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}

.py-4 {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.py-5 {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-1 {
    gap: var(--space-sm);
}

.gap-2 {
    gap: var(--space-md);
}

.gap-3 {
    gap: var(--space-lg);
}

.bg-white {
    background: var(--bg-white);
}

.bg-light {
    background: var(--bg-light);
}

.bg-dark {
    background: var(--bg-dark);
}

.bg-primary {
    background: var(--primary-color);
}