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

:root {
    --green-primary: #8BC34A;
    --green-light: #C5E1A5;
    --green-lighter: #F1F8E9;
    --green-dark: #689F38;
    --green-gradient: linear-gradient(135deg, #A8D86B 0%, #8BC34A 50%, #7CB342 100%);
    --text-dark: #1a1a1a;
    --text-body: #555;
    --text-light: #888;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.1);
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

body {
    font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Full-page section snap */
.snap-section {
    scroll-snap-align: start;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 44px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--green-dark);
    background: var(--green-lighter);
}

.nav-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bg-white);
    background: var(--green-primary);
    border-radius: 50%;
    margin-left: 8px;
    transition: var(--transition);
}

.nav-lang:hover {
    background: var(--green-dark);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 0;
    background: url('../images/首頁背景.png') center/cover no-repeat;
    overflow: hidden;
}

/* Floating elements container */
.hero-floats {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.float-item {
    position: absolute;
    object-fit: contain;
    transition: filter 1s ease, opacity 1s ease, transform 1s ease;
    will-change: transform, filter;
}

.float-item.blurred {
    filter: blur(4px);
    opacity: 0.6;
}

/* Gentle floating animation — each item gets a unique one via JS */
@keyframes floatY {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(2deg); }
}

@keyframes floatY2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(14px) rotate(-2deg); }
}

@keyframes floatY3 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-22px) rotate(3deg); }
}

.float-item:nth-child(odd) { animation: floatY 5s ease-in-out infinite; }
.float-item:nth-child(even) { animation: floatY2 6s ease-in-out infinite; }
.float-item:nth-child(3n) { animation: floatY3 7s ease-in-out infinite; }

/* Center content */
.hero-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 72px 24px 40px;
    transition: filter 0.8s ease, opacity 0.8s ease, transform 0.8s ease;
}

.hero-title {
    font-size: 56px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.hero-title-bold {
    font-weight: 800;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 28px;
    letter-spacing: 2px;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-desc strong {
    color: var(--text-dark);
    font-weight: 700;
}

.hero-enter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 52px;
    background: linear-gradient(135deg, #8bc34a 0%, #4caf50 50%, #66bb6a 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 24px rgba(76, 175, 80, 0.35), 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.hero-enter-btn .btn-text {
    position: relative;
    z-index: 1;
}

.hero-enter-btn .btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.hero-enter-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 36px rgba(76, 175, 80, 0.45), 0 4px 12px rgba(0,0,0,0.12);
}

.hero-enter-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

/* Enter transition — blur & zoom out */
.hero.transitioning .hero-center {
    filter: blur(12px);
    opacity: 0;
    transform: scale(0.95);
}

.hero.transitioning .float-item {
    filter: blur(16px) !important;
    opacity: 0 !important;
    transform: scale(1.1) !important;
}

.hero-wave svg {
    width: 100%;
    height: 80px;
}

/* ===== Advantages ===== */
.advantages {
    padding: 80px 0 100px;
    background: #eef2f7;
    padding-top: 72px;
}

.section-title {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.section-desc {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 56px;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.advantage-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 20px 28px;
    color: var(--text-dark);
    transition: var(--transition);
    border: 1px solid #e8ecf0;
}

.advantage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.advantage-img-wrapper {
    background: #f3f6f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    aspect-ratio: 4 / 3;
}

.advantage-img {
    max-width: 80%;
    max-height: 120px;
    object-fit: contain;
}

.advantage-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-dark);
    text-align: center;
}

.advantage-card p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-body);
}

/* ===== How It Works ===== */
.how-it-works {
    background: var(--bg-white);
    overflow: hidden;
    padding-top: 72px;
}

.how-it-works-inner {
    display: flex;
    min-height: 600px;
}

/* Left side - white background with text */
.step-left {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 60px 80px max(24px, calc((100vw - 1200px) / 2 + 24px));
}

/* Right side - background image */
.step-right {
    flex: 0 0 50%;
    max-width: 50%;
    background-image: url('../images/運作機制-背景圖.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px max(24px, calc((100vw - 1200px) / 2)) 40px 40px;
    position: relative;
}

/* Slide text content */
.step-slides {
    position: relative;
    min-height: 220px;
    margin-bottom: 40px;
}

.step-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.step-slide.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.step-label {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 16px;
    font-weight: 700;
}

.step-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.step-desc {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.8;
    max-width: 420px;
}

/* Progress bar indicators */
.step-indicators {
    display: flex;
    gap: 12px;
    max-width: 320px;
}

.step-indicator {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.indicator-fill {
    width: 0;
    height: 100%;
    background: var(--text-dark);
    border-radius: 2px;
}

/* Step images */
.step-images {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-phone-img {
    position: absolute;
    max-width: 90%;
    max-height: 480px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.step-phone-img.active {
    position: relative;
    opacity: 1;
    transform: scale(1);
}

/* ===== Products ===== */
.products {
    background: #eef2f7;
    padding: 80px 0 100px;
    padding-top: 72px;
}

.products-header {
    text-align: center;
    margin-bottom: 48px;
}

.products-header .section-title {
    margin-bottom: 28px;
}

.product-tabs {
    display: inline-flex;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    gap: 0;
    border: 1px solid #e0e4e8;
}

.product-tab {
    padding: 10px 28px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-family: inherit;
}

.product-tab:hover {
    color: var(--text-dark);
}

.product-tab.active {
    background: var(--text-dark);
    color: #fff;
}

.products-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.product-panel {
    display: none;
}

.product-panel.active {
    display: block;
}

.product-inner {
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 48px;
    border: 1px solid #e8ecf0;
}

.product-img-wrapper {
    flex: 0 0 340px;
    background: linear-gradient(180deg, #e8f5e0 0%, #f0f7eb 100%);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.product-img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.product-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.product-desc-zh {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 8px;
    line-height: 1.6;
}

.product-desc-en {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.6;
}

.product-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: var(--green-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

.btn-disabled {
    display: inline-block;
    padding: 12px 32px;
    background: #ccc;
    color: #888;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: not-allowed;
    user-select: none;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1.5px solid #ccc;
    color: var(--text-dark);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--green-primary);
    color: var(--green-dark);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .product-inner {
        flex-direction: column;
        padding: 28px;
        gap: 28px;
    }

    .product-img-wrapper {
        flex: none;
        width: 100%;
        min-height: 240px;
    }

    .product-tab {
        padding: 8px 18px;
        font-size: 13px;
    }
}

/* ===== APP Download ===== */
.app-download {
    background: var(--bg-white);
    padding-top: 72px;
}

.app-download-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.app-download-info {
    flex: 1;
}

.app-download-desc {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.8;
    margin-top: 20px;
    margin-bottom: 8px;
}

.app-download-desc-en {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 36px;
}

.app-download-buttons {
    display: flex;
    gap: 14px;
}

.download-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex: 1;
    min-width: 0;
}

.download-badge:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

.download-badge-img {
    width: 100%;
    height: auto;
    display: block;
}

.app-download-phone {
    flex: 0 0 auto;
    margin-right: -120px;
}

.app-phone-img {
    max-height: 520px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
    .app-download-inner {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .app-download-info .section-title {
        text-align: center !important;
    }

    .app-download-buttons {
        justify-content: center;
    }

    .app-phone-img {
        max-height: 380px;
    }
}

/* ===== FAQ ===== */
.faq {
    padding-top: 72px;
    background: #eef2f7;
}

.faq .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.faq-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border: 1.5px solid #e0e4e8;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item.active {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 1px var(--green-primary);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: inherit;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--green-dark);
}

.faq-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.8;
}

/* Remove old carousel dots - no longer needed */
.carousel-dots {
    display: none;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--green-primary);
    width: 28px;
    border-radius: 5px;
}

/* ===== Footer ===== */
.footer {
    background: #eaf4d8;
    padding: 0 0 32px;
    border-top: none;
}

.footer-warning {
    background: #eaf4d8;
    padding: 56px 24px 40px;
    text-align: center;
}

.footer-warning-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: 0.04em;
}

.footer-inner {
    text-align: center;
    color: var(--text-body);
}

.footer-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.footer-logo-img {
    height: 56px;
    width: auto;
}

.footer-license {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.8;
    margin-bottom: 32px;
}

.footer-license strong {
    color: var(--text-dark);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-body);
}

.contact-item strong {
    color: var(--text-dark);
}

.footer-hours {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.6;
}

.footer-address {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 20px;
    margin-top: 24px;
}

.footer-copyright {
    font-size: 12px;
    color: #5a7a5a;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-legal-links a {
    font-size: 12px;
    color: var(--text-body);
    text-decoration: underline;
    transition: var(--transition);
}

.footer-legal-links a:hover {
    color: var(--green-dark);
}

.footer-divider {
    color: rgba(0,0,0,0.25);
    font-size: 12px;
}

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

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 34px;
    }

}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 24px;
        gap: 4px;
        border-bottom: 1px solid #eee;
        box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    }

    .nav.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        width: 100%;
    }

    .nav-lang {
        margin: 12px 0 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-title {
        font-size: 32px;
    }

    .float-item {
        width: 80px !important;
    }

    .section-title {
        font-size: 28px;
    }

    .advantages-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .how-it-works-inner {
        flex-direction: column;
        min-height: auto;
    }

    .step-left {
        flex: none;
        max-width: 100%;
        padding: 60px 24px 40px;
    }

    .step-right {
        flex: none;
        max-width: 100%;
        min-height: 400px;
    }

    .step-phone-img {
        max-height: 360px;
    }

    .step-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 26px;
    }

    .float-item {
        width: 60px !important;
    }

    .advantages {
        padding: 60px 0;
    }

    .step-right {
        min-height: 300px;
    }

    .step-phone-img {
        max-height: 280px;
    }
}
