:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --dark-bg: #0A0A0C;
    --light-bg: #F5F5F7;
    --footer-bg: #F8F9FB;
    /* Lighter footer background */
    --text-main: #1D1D1F;
    --text-muted: #86868B;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar & Header */
header.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 5px 0;
    position: relative;
    transition: var(--transition);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color);
}

/* Language Switcher */
.lang-switcher select {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.lang-switcher select:hover {
    border-color: var(--primary-color);
}

/* Hero Section & Carousel */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: var(--dark-bg);
}

.carousel-inner {
    position: relative;
    height: 100%;
    width: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    display: flex;
    align-items: center;
    z-index: 1;
    transition: opacity 2.5s ease-in-out, transform 8s linear;
    transform: scale(1);
}

.slide.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 100%);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 4;
    max-width: 850px;
}

.hero-content h1,
.hero-content p,
.hero-content .hero-btns {
    opacity: 0;
    transform: translateY(40px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide.active .hero-content h1 {
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards 0.3s;
}

.slide.active .hero-content p {
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards 0.5s;
}

.slide.active .hero-content .hero-btns {
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards 0.7s;
}

.hero h1 {
    font-size: clamp(2.2rem, 8vw, 4.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 25px;
    color: var(--white);
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 300;
    margin-bottom: 40px;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.9);
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 5;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* Carousel Arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.carousel-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

@media (max-width: 768px) {
    .carousel-btn {
        display: none;
        /* Hide arrows on mobile for better UX */
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 34px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    margin-right: 15px;
    box-shadow: 0 8px 15px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    background: #0062cc;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 122, 255, 0.35);
}

.btn-secondary {
    border: 2px solid var(--white);
    color: var(--white);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--text-main);
    transform: translateY(-2px);
}

/* Subpage Header */
.subpage-header {
    height: 45vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    position: relative;
    color: var(--white);
    padding-top: 80px;
    overflow: hidden;
}

.about-bg {
    background: url('img/about-bg.png') no-repeat center center/cover;
}

.products-bg {
    background: url('img/products-bg.png') no-repeat center center/cover;
}

.news-bg {
    background: url('img/news-bg.png') no-repeat center center/cover;
}

.contact-bg {
    background: url('img/contact-bg.png') no-repeat center center/cover;
}

.subpage-header h1 {
    font-size: clamp(2rem, 6vw, 3.2rem);
    margin-bottom: 15px;
    font-weight: 800;
}

/* Sections */
.section {
    padding: clamp(60px, 8vw, 100px) 0;
}

.bg-light {
    background-color: var(--light-bg);
}

.section-header h2 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 800;
}

.underline {
    width: 60px;
    height: 5px;
    background: var(--primary-color);
    margin: 18px auto 0;
    border-radius: 3px;
}

/* Grid Systems */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    align-items: center;
}

.stat-item {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: var(--transition);
}

.stat-item h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--white);
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
    border: 1px solid var(--primary-color);
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.card-icon {
    height: 60px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.card-icon img {
    max-height: 100%;
    max-width: 150px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.card:hover .card-icon img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Vertical Timeline Style */
.timeline-vertical {
    position: relative;
    max-width: 1000px;
    margin: 60px auto;
    padding: 40px 0;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--primary-color) 10%, var(--primary-color) 90%, transparent);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    margin-bottom: 40px;
    z-index: 2;
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    top: 30px;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 4px solid var(--white);
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

.timeline-item.left .timeline-dot {
    right: -9px;
}

.timeline-item.right .timeline-dot {
    left: -9px;
}

.timeline-year {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-content {
    background: var(--white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .timeline-vertical::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 60px;
    }

    .timeline-dot {
        left: 21px !important;
    }
}

/* Milestone Grid (Replacing Hollow Timeline) */
.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.milestone-item {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.milestone-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.milestone-item::after {
    content: attr(data-year);
    position: absolute;
    bottom: -15px;
    right: 15px;
    font-size: 6rem;
    font-weight: 800;
    color: rgba(0, 122, 255, 0.04);
    pointer-events: none;
    line-height: 1;
}

.milestone-date {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.milestone-date::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--primary-color);
}

.milestone-item h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 700;
    z-index: 1;
}

.milestone-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    z-index: 1;
}

.story-timeline {
    padding: 80px 0;
    position: relative;
}

/* Central structure line */
.story-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom, transparent, transparent 10px, var(--primary-color) 10px, var(--primary-color) 20px);
    opacity: 0.1;
    transform: translateX(-50%);
}

.story-block {
    display: flex;
    align-items: center;
    gap: 80px;
    margin-bottom: 100px;
    position: relative;
    z-index: 2;
}

.story-block:nth-child(even) {
    flex-direction: row-reverse;
}

.story-visual {
    flex: 1;
    position: relative;
}

.story-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--primary-color), #00d2ff);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 122, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--white);
    overflow: hidden;
}

.story-img {
    width: 100%;
    height: auto;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: block;
    transition: var(--transition);
}

.story-img:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.story-content {
    flex: 1;
    position: relative;
    padding: 40px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.story-year-badge {
    position: absolute;
    top: -20px;
    left: 30px;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
    z-index: 5;
    letter-spacing: 1px;
}

.story-block:nth-child(even) .story-year-badge {
    left: auto;
    right: 30px;
}

.story-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    position: relative;
}

.story-content h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    margin-top: 15px;
}

.story-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 2;
}

@media (max-width: 992px) {
    .story-block {
        flex-direction: column !important;
        gap: 30px;
        margin-bottom: 80px;
    }

    .story-year-bg {
        font-size: 6rem;
        top: -30px;
    }
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-nav-group h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-links-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links-modern a {
    background: var(--white);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links-modern a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.footer-contact-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-contact-info p {
    margin-bottom: 8px;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile & Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: var(--transition);
}

@media (max-width: 992px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .navbar-right nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    header.navbar nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px 0;
        display: none;
        flex-direction: column;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    header.navbar nav.active {
        display: flex;
    }

    header.navbar nav ul {
        flex-direction: column;
    }

    header.navbar nav ul li {
        margin: 10px 0;
        margin-left: 0 !important;
    }
}