/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', 'Noto Sans TC Fallback', 'PingFang TC', 'Microsoft JhengHei', '微軟正黑體', 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-display: swap;
}

/* Font loading optimization */
@font-face {
    font-family: 'Noto Sans TC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/notosanstc/v35/-nFuOG829Oofr2wohFbTp9ifNAn722rq0MXz76Cy_CpOtma3uNQ.woff2) format('woff2');
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+2CEB0-2EBEF;
}

@font-face {
    font-family: 'Noto Sans TC';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/notosanstc/v35/-nFvOG829Oofr2wohFbTp9iFOSsLA-qupbuxfCOFpOtma3sNQq.woff2) format('woff2');
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+2CEB0-2EBEF;
}

/* Font loading states */
body {
    transition: font-family 0.3s ease;
}

.fonts-loading {
    font-family: 'PingFang TC', 'Microsoft JhengHei', '微軟正黑體', 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fonts-loaded {
    font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', '微軟正黑體', 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* CSS Variables */
:root {
    --primary: #72b3ea;
    --primary-light: #9cc8f0;
    --accent: hsl(28 100% 93%);
    --accent-dark: hsl(24 100% 64%);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #6b7280;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 2rem;
    width: auto;
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

/* 手機版顯示 Banner Logo，隱藏 Wing Logo */
.brand-logo-mobile {
    display: block;
}

.brand-logo-desktop {
    display: none;
}

/* 平板及桌面版顯示 Wing Logo，隱藏 Banner Logo */
@media (min-width: 768px) {
    .brand-logo {
        height: 2.5rem;
    }
    
    .brand-logo-mobile {
        display: none;
    }
    
    .brand-logo-desktop {
        display: block;
    }
}

.nav-menu {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--gray-900);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: hsl(208 100% 65%);
    transform: scale(1.05);
}

.nav-button-link {
    text-decoration: none;
    display: inline-block;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, 
        hsla(206, 100%, 84%, 0.2) 0%, 
        hsla(0, 0%, 100%, 1) 50%, 
        hsla(28, 100%, 93%, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 1rem;
    max-width: 80rem;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 100;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-title-accent {
    color: var(--primary);
    font-weight: 400;
}

.hero-title-bold {
    font-weight: 900;
    /* 使用與您範例相同的掃描漸層動畫 */
    background-image: linear-gradient(
        -45deg,
        var(--primary) 60%,
        var(--primary-light) 70%,
        var(--primary) 80%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: scan-gradient 3s linear infinite;
}

@keyframes scan-gradient {
    from {
        background-position: 200% center;
    }
    to {
        background-position: 0% center;
    }
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

@media (min-width: 640px) {
    .hero-description {
        font-size: 1.5rem;
    }
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
    }
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: hsl(208 100% 65%);
    transform: scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.btn-full {
    width: 100%;
}

/* Button disabled state */
.btn:disabled {
    background: var(--gray-400) !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
    pointer-events: none;
}

.btn:disabled:hover {
    background: var(--gray-400) !important;
    transform: none;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
}

.floating-1 {
    top: 5rem;
    left: 2.5rem;
    width: 5rem;
    height: 5rem;
    background: hsla(208, 100%, 69%, 0.1);
    animation-delay: 0s;
}

.floating-2 {
    bottom: 5rem;
    right: 2.5rem;
    width: 8rem;
    height: 8rem;
    background: hsla(24, 100%, 64%, 0.1);
    animation-delay: 1s;
}

.floating-3 {
    top: 50%;
    right: 5rem;
    width: 4rem;
    height: 4rem;
    background: hsla(28, 100%, 93%, 0.2);
    animation-delay: 0.5s;
}

@keyframes float {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0px);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-10px);
    }
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 48rem;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--gray-50);
}

.about-content {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
}

.about-subtitle {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.about-paragraph {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
}

.feature-dot {
    width: 0.75rem;
    height: 0.75rem;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 1rem;
}

.about-stats {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
}

/* Services Section */
.services {
    background: white;
}

.services-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    max-width: 1000px;
    margin: 0 auto;
}

/* 手機版：一列 */
@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板以上：兩行布局 - 上面2個，下面3個 */
@media (min-width: 768px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }
    
    /* 第一行：兩個卡片，每個佔3格 */
    .service-card:nth-child(1) {
        grid-column: 1 / 4;
    }
    
    .service-card:nth-child(2) {
        grid-column: 4 / 7;
    }
    
    /* 第二行：三個卡片，每個佔2格 */
    .service-card:nth-child(3) {
        grid-column: 1 / 3;
    }
    
    .service-card:nth-child(4) {
        grid-column: 3 / 5;
    }
    
    .service-card:nth-child(5) {
        grid-column: 5 / 7;
    }
}

.service-card {
    border-radius: 1.5rem;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.service-card-1 {
    background: linear-gradient(to bottom right, 
        hsla(208, 100%, 69%, 0.05) 0%, 
        hsla(206, 100%, 84%, 0.1) 100%);
}

.service-card-2 {
    background: linear-gradient(to bottom right, 
        hsla(28, 100%, 93%, 0.2) 0%, 
        hsla(24, 100%, 64%, 0.2) 100%);
}

.service-card-3 {
    background: linear-gradient(to bottom right, 
        hsla(206, 100%, 84%, 0.2) 0%, 
        hsla(28, 100%, 93%, 0.1) 100%);
}

.service-card-4 {
    background: linear-gradient(to bottom right, 
        hsla(24, 100%, 64%, 0.15) 0%, 
        hsla(208, 100%, 69%, 0.15) 100%);
}

.service-card-5 {
    background: linear-gradient(to bottom right, 
        hsla(208, 100%, 69%, 0.1) 0%, 
        hsla(206, 100%, 84%, 0.2) 100%);
}

.service-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
}

.service-icon-1 {
    background: var(--primary);
}

.service-icon-2 {
    background: var(--accent-dark);
}

.service-icon-3 {
    background: var(--primary-light);
}

.service-icon-4 {
    background: var(--accent-dark);
}

.service-icon-5 {
    background: var(--primary);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--gray-600);
    line-height: 1.7;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .partners-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.partner-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.partner-item:hover {
    transform: translateY(-2px);
}

.partner-logo {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-item:hover .partner-image {
    filter: grayscale(0%);
    opacity: 1;
}

/* Contact Section */
.contact {
    background: linear-gradient(to bottom right, 
        hsla(208, 100%, 69%, 0.05) 0%, 
        hsla(28, 100%, 93%, 0.1) 100%);
}

.contact-content {
    max-width: 64rem;
    margin: 0 auto;
}

.contact-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: grid;
    gap: 3rem;
}

@media (min-width: 768px) {
    .contact-card {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    background: hsla(208, 100%, 69%, 0.1);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary);
}

.contact-label {
    font-weight: 500;
    color: var(--gray-900);
}

.contact-value {
    color: var(--gray-600);
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Contact Form */
.contact-form {
    align-self: start;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    transition: border-color 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: none;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 0;
}

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

.footer-brand {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.footer-logo {
    height: 3rem;
    width: auto;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.footer-logo:hover {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(200deg);
    transform: scale(1.05);
}

.footer-tagline {
    color: #9ca3af;
    margin-bottom: 2rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    color: #9ca3af;
    transition: color 0.3s ease;
}

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

.footer-copyright {
    border-top: 1px solid #374151;
    padding-top: 2rem;
}

.footer-copyright p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .service-card,
    .btn,
    .nav-link,
    .social-link {
        transition: all 0.3s ease;
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content,
    .contact-card {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-container {
        gap: 1rem;
    }
}

/* Partners Section */
.partners {
    padding: 5rem 0;
    background: white;
    overflow: hidden;
}

.partners-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.partners-track {
    display: flex;
    animation: carousel-slide 25s linear infinite;
    width: calc(300px * 10); /* 10個項目的總寬度 (5個原始 + 5個重複) */
}

.partner-item {
    flex: 0 0 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.partner-logo {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

@keyframes carousel-slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-300px * 5)); /* 移動5個項目的距離 */
    }
}

/* 暫停動畫當滑鼠懸停時 */
.partners-carousel:hover .partners-track {
    animation-play-state: paused;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .partner-item {
        flex: 0 0 250px;
        padding: 1.5rem;
    }
    
    .partners-track {
        width: calc(250px * 10);
    }
    
    @keyframes carousel-slide {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-250px * 5));
        }
    }
    
    .partner-logo {
        max-width: 150px;
        max-height: 75px;
    }
}

/* FAQ Section */
.faq {
    background: var(--gray-50);
    padding: 5rem 0;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 48rem;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary);
    color: white;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.show {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
}