/* =========================================
   CSS Variables & Reset
   ========================================= */
:root {
    --bg-main: #0a0f16;
    --bg-alt: #131b26;
    --bg-card: #1c2635;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #f39c12; /* Engineering Orange */
    --accent-hover: #d68910;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隱藏滾動條 */
::-webkit-scrollbar {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important;  /* IE and Edge */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

main {
    animation: fadeInPage 0.8s ease forwards;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

ul {
    list-style: none;
}

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

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
}

.section-padding {
    padding: 8rem 0;
}

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

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

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

.mb-5 {
    margin-bottom: 3rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* =========================================
   Page Loader & Transitions
   ========================================= */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

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

.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: loader-spin 1s linear infinite;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   Typography & Utilities
   ========================================= */
.section-subtitle {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(243, 156, 18, 0.2);
}

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

.btn-outline:hover {
    background-color: var(--text-primary);
    color: var(--bg-main);
    transform: translateY(-3px);
}

/* =========================================
   Header & Navigation
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    padding: 1rem 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 15, 22, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 95%; /* Specific width for header */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    color: var(--accent-color);
    font-size: 2rem;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-wrap: nowrap;
}
.nav-menu ul li {
    flex-shrink: 0;
}

.nav-link {
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 0.25rem;
    color: var(--text-primary);
    white-space: nowrap !important;
    display: block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-contact {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.btn-contact::after {
    display: none;
}

.btn-contact:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .logo {
        max-width: 70%;
        overflow: hidden;
    }
    .logo img {
        height: 32px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff !important;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2100;
    position: relative;
    padding: 10px;
    line-height: 1;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translate(-50%, 15px);
    min-width: 180px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 100;
}

/* Invisible bridge so hover doesn't break */
.dropdown-bridge {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.dropdown-item {
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-radius: 6px;
    white-space: nowrap;
}

.dropdown-item i {
    color: var(--text-secondary);
    font-size: 1rem;
    width: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(243, 156, 18, 0.15);
    color: var(--accent-color);
}

.dropdown-item:hover i {
    color: var(--accent-color);
}

/* Dropdown Cards Container */
.dropdown-cards {
    display: flex;
    gap: 10px;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.dropdown-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    min-width: 140px;
}

.dropdown-card:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.dropdown-card i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.dropdown-card span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.dropdown:hover .fa-chevron-down,
.dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: #000; /* 使用黑色作為基底 */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-top: 120px;
    padding-bottom: 180px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(10, 15, 22, 0.7) 0%, rgba(10, 15, 22, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-features {
    position: absolute;
    bottom: 40px;
    right: 5%;
    left: auto;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    width: 98%;
    max-width: 1800px;
}

/* Ensure fade-up animation functions smoothly with right alignment */
.hero-features.fade-up {
    transform: translateY(30px);
}
.hero-features.fade-up.visible {
    transform: translateY(0);
}

/* Prevent overflow on medium screens (e.g. iPad Pro, small laptops) */
@media (max-width: 1200px) {
    .hero-features {
        width: 95%;
        right: 2.5%;
        left: auto;
        gap: 1rem;
    }
    .feature-card {
        padding: 1.25rem;
        gap: 1rem;
    }
    .feature-card .icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .feature-text h3 {
        font-size: 1.1rem;
    }
    .feature-text p {
        font-size: 0.85rem;
    }
}


/* Hero Features 響應式調整 */
@media (max-width: 992px) {
    .hero-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        width: 92%;
    }
}

@media (max-width: 600px) {
    .hero-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 95%;
        bottom: 20px;
    }
    
    .feature-card {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .feature-card .icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .feature-text h3 {
        font-size: 1rem;
    }
    
    .feature-text p {
        font-size: 0.85rem;
    }
}

.feature-card {
    background: rgba(28, 38, 53, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(28, 38, 53, 0.95);
    border-color: rgba(243, 156, 18, 0.5);
    box-shadow: 0 20px 40px rgba(243, 156, 18, 0.15);
}

.feature-card .icon-wrapper {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.feature-text p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* =========================================
   About Section
   ========================================= */
.about {
    padding-top: 10rem; /* Space for absolute stats */
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
    display: inline-block;
    width: 100%;
}

.about-image img {
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 92%;
    width: 92%;
    height: auto;
}

.experience-badge {
    position: absolute;
    bottom: -25px;
    right: 10px;
    background: var(--accent-color);
    color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 30px rgba(243, 156, 18, 0.3);
}

.experience-badge .number {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1;
}

.experience-badge .text {
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.feature-list {
    margin-top: 2rem;
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feature-list i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* =========================================
   Services Section
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-main);
    padding: 3rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    transform-origin: bottom;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.service-card:hover::before {
    transform: scaleY(1);
}

.service-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* =========================================
   CTA Section
   ========================================= */
.cta-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-main) 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: #06090d;
    padding-top: 5rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.about-col p {
    margin: 1.5rem 0;
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--text-primary);
}

.social-links a:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

.link-col ul li {
    margin-bottom: 0.8rem;
}

.link-col ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-info i {
    color: var(--accent-color);
    margin-top: 5px;
}

.footer-bottom {
    background: #030507;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* =========================================
   Animations
   ========================================= */
.fade-up {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.fade-up.visible {
    opacity: 1;
}

.reveal-left {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.reveal-right {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.reveal-up {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.reveal-left.visible, .reveal-right.visible, .reveal-up.visible {
    opacity: 1;
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 992px) {
    .hero { 
        padding-top: 100px; 
        padding-bottom: 4rem; 
        flex-direction: column;
        justify-content: center;
        height: auto;
        min-height: 100vh;
    }
    .hero-content {
        text-align: center;
        margin: 0 auto 2.5rem auto;
        width: 100%;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero h1 { 
        font-size: 3.2rem; 
        margin-bottom: 1.25rem;
    }
    .hero p {
        margin-bottom: 2rem;
    }
    .page-header h1 { font-size: 2.5rem; }
    .hero-features {
        grid-template-columns: 1fr;
        position: relative;
        bottom: 0;
        transform: none;
        left: 0;
        right: auto;
        margin: 0 auto;
        width: 100%;
    }
    .about-grid { 
        grid-template-columns: 1fr; 
        gap: 5rem; 
    }
    .experience-badge { 
        right: 0; 
        bottom: 0; 
        transform: translate(15%, 15%); 
    }
    .footer-container { grid-template-columns: 1fr 1fr; }
}

/* 移除遮罩層，直接使用選單 */
.nav-overlay {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block !important; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-card);
        padding: 6rem 2rem;
        transition: right 0.4s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 2100;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-menu.active { right: 0; }
    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .hero { 
        padding-top: 90px; 
        padding-bottom: 3rem; 
        background-attachment: scroll;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100vh;
    }
    .hero-content {
        margin: 0 auto 2rem auto;
    }
    .hero h1 { font-size: 2.8rem; }
    .page-header h1 { font-size: 2.2rem; }
    .hero-actions { 
        flex-direction: column; 
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .btn { text-align: center; }
    .footer-container { grid-template-columns: 1fr; gap: 2rem; }
    .about { padding-top: 10rem; }
    .experience-badge {
        right: 1rem;
        bottom: 1rem;
        transform: none;
        padding: 1.5rem;
    }
    .experience-badge .number {
        font-size: 2.5rem;
    }
    .experience-badge .text {
        font-size: 0.8rem;
    }
    
    /* Mobile Dropdown */
    .dropdown-menu {
        position: static;
        transform: none !important;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 1rem;
        display: none;
        width: 100%;
        min-width: 100%;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu,
    .dropdown.active .dropdown-menu {
        display: flex;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-item {
        padding: 0.8rem 1rem;
    }
    
    /* Mobile Dropdown Cards */
    .dropdown-cards {
        flex-direction: column;
        gap: 8px;
        padding: 0.5rem 0;
    }
    
    .dropdown-card {
        padding: 0.8rem;
        min-width: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        text-align: left;
    }
    
    .dropdown-card i {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
    
    .dropdown-card span {
        font-size: 0.9rem;
    }

    /* Footer Links in 2 columns */
    .link-col ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .link-col ul li {
        margin-bottom: 0.5rem;
    }
}

/* =========================================
   Page Header
   ========================================= */
.page-header {
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    padding-top: 80px;
    overflow: hidden;
}

.header-video, .header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.header-bg {
    background-size: cover;
    background-position: center;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
}

/* =========================================
   Timeline Section
   ========================================= */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 50%;
    padding-right: 3rem;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    padding-right: 0;
    padding-left: 3rem;
    text-align: left;
}

.timeline-item:nth-child(odd) {
    text-align: right;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    top: 0;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 4px var(--bg-alt), 0 0 0 6px var(--accent-color);
}

.timeline-item:nth-child(even) .timeline-dot {
    right: auto;
    left: -8px;
}

.timeline-content {
    background: var(--bg-main);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: rgba(243, 156, 18, 0.5);
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.1);
}

.timeline-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.timeline-content h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 3rem !important;
        padding-right: 0 !important;
        text-align: left !important;
    }
    .timeline-dot {
        left: 12px !important;
        right: auto !important;
    }
}

/* =========================================
   Back to Top Button
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border: 2px solid transparent;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--bg-card);
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 25px rgba(243, 156, 18, 0.2);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* =========================================
   Team Section Styles
   ========================================= */
.team-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

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

.value-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

.value-card:hover i {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

.team-social a:hover {
    color: var(--accent-color) !important;
    transform: translateY(-3px);
}
/* =========================================
   Project Grid & Modal Styles
   ========================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    .project-card-content {
        padding: 1.25rem;
    }
}

.project-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.project-card-img {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: var(--bg-main);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1;
}

.project-card-content {
    padding: 1.5rem;
}

.project-card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-card-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.btn-text {
    color: var(--accent-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.project-card:hover .btn-text {
    gap: 12px;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none; /* JS toggles this */
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.project-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 22, 0.95);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: var(--bg-main);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    animation: modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--accent-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    height: 100%;
    overflow-y: auto;
}

.modal-gallery {
    background: #000;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.main-img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-img-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.thumb-nav {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    justify-content: center;
}

.thumb-nav img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
}

.thumb-nav img.active {
    opacity: 1;
    border-color: var(--accent-color);
}

.modal-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.modal-category {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

#modalTitle {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-description h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.modal-description p {
    line-height: 1.8;
    color: var(--text-secondary);
}

@media (max-width: 992px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-info {
        padding: 2rem;
    }
}

/* =========================================
   Contact Page Redesign Styles
   ========================================= */
.btn-req:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4) !important;
    filter: brightness(1.1);
}

@media (max-width: 850px) {
    .contact-content-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    
    .qr-card {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .contact-info-list div {
        font-size: 1.1rem !important;
    }
}

/* =========================================
   Tools Carousel Styles
   ========================================= */
.carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    padding: 2rem 0;
}

.carousel-container {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
    padding: 0 4rem;
}

.carousel-text {
    text-align: left;
}

.icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(243, 156, 18, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.carousel-text h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.carousel-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.carousel-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-main);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 3rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
}

@media (max-width: 992px) {
    .carousel-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 2rem;
        text-align: center;
    }
    
    .carousel-text {
        text-align: center;
    }
    
    .icon-circle {
        margin: 0 auto 1.5rem auto;
    }
    
    .carousel-image img {
        height: 300px;
    }
}

/* =========================================
   Home Project Carousel (Marquee)
   ========================================= */
.home-project-wrapper {
    position: relative;
    padding: 1rem 0;
    overflow: hidden;
    margin: 0 -1rem;
    cursor: grab;
    /* 加入左右邊淡化效果 */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.home-project-track.marquee {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    width: max-content; /* Ensure it takes full width of children */
    animation: marqueeScroll 40s linear infinite;
}

.home-project-wrapper:hover .home-project-track.marquee {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 0.75rem)); } /* Scroll half width (one group) plus half gap */
}

.home-project-card {
    min-width: 300px;
    height: 200px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

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

.home-project-card:hover img {
    transform: scale(1.1);
}

.home-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(10, 15, 22, 0.95));
    color: #fff;
    text-align: left;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.home-project-card:hover .home-card-overlay {
    transform: translateY(0);
}

.home-card-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.home-card-overlay p {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(28, 38, 53, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: var(--accent-color);
    color: var(--bg-main);
}

.carousel-nav.prev { left: 1rem; }
.carousel-nav.next { right: 1rem; }

@media (max-width: 768px) {
    .home-project-card {
        min-width: 260px;
        height: 180px;
    }
}

/* =========================================
   Contact Page Styles
   ========================================= */
.contact-content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    align-items: center;
    margin-top: 4rem;
}

.nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important; /* 強制不換行，確保按鈕在右側 */
}

@media (max-width: 768px) {
    .logo {
        flex: 0 1 70% !important; /* 限制 Logo 寬度佔比 */
        min-width: 0;
    }
    .logo img {
        max-width: 100% !important;
        height: 30px !important;
        object-fit: contain;
    }
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.contact-item > div:first-child {
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-info-text {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    min-width: 0;
}

.contact-info-text a {
    color: inherit;
    transition: var(--transition);
}

.contact-info-text a:hover {
    color: var(--accent-color);
}

@media (max-width: 992px) {
    .contact-content-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .contact-info-list {
        display: inline-flex; /* 讓容器根據內容縮放 */
        flex-direction: column;
        align-items: flex-start; /* 強制所有項目左對齊，確保圖示排成直線 */
        text-align: left;
        margin: 0 auto; /* 整個區塊在頁面置中 */
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .contact-item {
        justify-content: flex-start;
        width: 100%;
    }

    .qr-card {
        margin: 0 auto;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .contact-info-text {
        font-size: clamp(0.75rem, 3.5vw, 1.05rem) !important;
    }
    
    .contact-item {
        gap: 0.8rem !important;
    }

    /* 縮小圖示以騰出空間給文字 */
    .contact-item > div:first-child {
        width: 22px !important;
        height: 22px !important;
        font-size: 1.1rem !important;
    }
    
    .container {
        padding: 0 1rem !important;
    }
}

@media (max-width: 400px) {
    .contact-info-text {
        font-size: clamp(0.65rem, 3.2vw, 0.95rem) !important;
    }
    
    .contact-item {
        gap: 0.5rem !important;
    }
}

/* =========================================
   Proposal Form Styles
   ========================================= */
.proposal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.proposal-header {
    text-align: center;
    margin-bottom: 3rem;
}

.proposal-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #e67e22 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.3);
}

.proposal-icon-wrapper i {
    color: #fff;
    font-size: 2rem;
}

.proposal-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.proposal-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.proposal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.form-group label i {
    color: var(--accent-color);
}

.form-group label span {
    color: #e74c3c;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-alt);
    transition: var(--transition);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.6;
}

.proposal-submit-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent-color) 0%, #e67e22 100%);
    color: #fff;
    padding: 1.2rem 4rem;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.35);
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.45);
}

/* Responsive Proposal Form */
@media (max-width: 768px) {
    .proposal-card {
        padding: 2rem 1.2rem;
    }
    
    .proposal-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .proposal-header h2 {
        font-size: 1.75rem;
    }
    
    .proposal-header p {
        font-size: 0.9rem;
    }
    
    .btn-submit {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .proposal-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .proposal-icon-wrapper i {
        font-size: 1.5rem;
    }

    /* Hero Features Mobile Optimization: Single Row, No Truncation */
    .hero-features {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        width: 96% !important;
        position: relative !important;
        bottom: 0 !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        margin: 25px auto 0 auto !important;
        max-width: 100% !important;
    }
    
    .hero-features .feature-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 0.75rem 0.5rem !important;
        gap: 0.5rem !important;
        border-radius: 12px !important;
    }
    
    .hero-features .feature-card .icon-wrapper {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 1rem !important;
        margin: 0 !important;
    }
    
    .hero-features .feature-card p {
        display: none !important; /* Hide descriptions to fit all cards on a single page */
    }
    
    .hero-features .feature-text h3 {
        font-size: 0.85rem !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    /* Page Header Title Mobile Split */
    .section-main-title {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.25rem !important;
        font-size: 2.0rem !important; /* Slightly smaller for flawless mobile rendering */
        line-height: 1.3 !important;
    }
    
    .section-main-title .title-separator {
        display: none !important; /* Hide vertical separator on mobile */
    }
    
    .section-main-title .title-part-1,
    .section-main-title .title-part-2 {
        display: block !important;
        white-space: nowrap !important;
    }
}

/* Section Main Title Desktop Defaults */
.section-main-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
