:root {
    --primary-color: #6B2C91; /* 葡萄紫色 */
    --secondary-color: #8E44AD; /* 淺葡萄紫 */
    --accent-color: #E056FD; /* 亮紫色 */
    --text-color: #2C3E50; /* 深灰色文字 */
    --light-text: #6C7A89; /* 淺灰色文字 */
    --light-bg: #F8F4FF; /* 淺紫背景 */
    --white: #FFFFFF;
    --gradient-bg: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --max-width: 1440px;
    --section-padding: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--white);
}

/* Loading 動畫 */
body.loading {
    overflow: hidden;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--light-bg);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 全域樣式 */
.wrapper {
    width: 100%;
    overflow: hidden;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-bg);
    border-radius: 2px;
}

/* 主視覺區域 */
.hero {
    background: var(--gradient-bg);
    padding: 80px 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/pattern.png') repeat;
    opacity: 0.1;
    pointer-events: none; /* 確保背景圖案不會影響點擊 */
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    position: relative; /* 添加相對定位 */
    z-index: 2; /* 確保內容在背景之上 */
}

.hero-text {
    flex: 1;
    position: relative; /* 添加相對定位 */
    z-index: 3; /* 確保文字和按鈕在最上層 */
}

h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.flavor {
    display: block;
    font-size: 2rem;
    opacity: 0.9;
    margin-top: 10px;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 30px 0;
}

.product-image {
    flex: 1;
    position: relative;
    z-index: 1; /* 確保產品圖片在按鈕之下 */
}

.main-product {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    pointer-events: none; /* 防止圖片干擾按鈕點擊 */
}

/* 核心優勢 */
.core-benefits {
    padding: var(--section-padding) 0;
    background-color: var(--white);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.benefit-item {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(107, 44, 145, 0.1);
}

.benefit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.benefit-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 產品特色 */
.product-features {
    padding: var(--section-padding) 0;
    background-color: var(--light-bg);
}

.features-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 60px;
}

.feature.reverse {
    flex-direction: row-reverse;
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.feature-content ul {
    list-style: none;
}

.feature-content li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}

.feature-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.feature-image {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 適合族群 */
.target-users {
    padding: var(--section-padding) 0;
    background-color: var(--white);
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.user-group {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.user-group:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(107, 44, 145, 0.1);
}

.user-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.user-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 購買資訊 */
.purchase-info {
    padding: var(--section-padding) 0;
    background-color: var(--light-bg);
}

.info-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.info-box {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.info-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.purchase-cta {
    text-align: center;
    margin-top: 60px;
}

.price-tag {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 30px;
}

.buy-button, .buy-now {
    display: inline-block;
    padding: 15px 40px;
    background: var(--gradient-bg);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(107, 44, 145, 0.2);
    position: relative;
    z-index: 5; /* 確保按鈕在最上層 */
}

.buy-button:hover, .buy-now:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(107, 44, 145, 0.3);
}

/* 頁腳 */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 0 40px;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.footer-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    margin-bottom: 60px;
}

.contact h4, .social-links h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    flex-direction: column;
}

.social-link {
    color: var(--white);
    text-decoration: none;
    margin-bottom: 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-link:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* RWD 響應式設計 */
@media screen and (max-width: 1200px) {
    :root {
        --section-padding: 80px;
    }

    .benefits-grid,
    .users-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    h1 {
        font-size: 3rem;
    }

    .feature {
        flex-direction: column;
        text-align: center;
    }

    .feature.reverse {
        flex-direction: column;
    }

    .feature-content li {
        text-align: left;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .section-inner {
        padding: 0 20px;
    }

    .benefits-grid,
    .users-grid,
    .info-container {
        grid-template-columns: 1fr;
    }

    .footer-info {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .social-links {
        align-items: center;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }

    .flavor {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .price-tag {
        font-size: 2rem;
    }
}