:root {
    /* 柔和的色彩系統 */
    --primary-color: #667eea;
    --primary-light: #764ba2;
    --secondary-color: #f093fb;
    --accent-color: #4facfe;

    /* 中性色調 */
    --dark-color: #2d3748;
    --dark-light: #4a5568;
    --light-color: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;

    /* 成功/警告色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* 字體 */
    --font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 間距 */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* 圓角 - 更加圓潤 */
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 50px;

    /* 陰影 - 更柔和 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

    /* 漸層 */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    --gradient-soft: linear-gradient(135deg, #f093fb, #f5576c);

    /* 動畫 */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--gray-50);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* 按鈕系統 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--light-color);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--light-color);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--light-color);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--light-color);
}

.btn-outline {
    background: var(--light-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--light-color);
    transform: translateY(-2px);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.1rem;
}

/* 導航欄 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-desktop {
    display: flex;
    gap: var(--space-xl);
}

/* 內部導航連結和外部導航連結共用樣式 */
.nav-desktop a,
.nav-desktop .nav-link-external {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-desktop a:hover,
.nav-desktop .nav-link-external:hover {
    color: var(--primary-color);
}

.nav-desktop a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
}

/* 手機分頁式選單 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--light-color);
    transform: translateX(-100%);
    transition: var(--transition-normal);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
}

.mobile-nav-content {
    flex: 1;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* 手機版內部導航連結和外部導航連結共用樣式 */
.mobile-nav-content a,
.mobile-nav-content .mobile-nav-link-external {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition-normal);
}

.mobile-nav-content a:hover,
.mobile-nav-content .mobile-nav-link-external:hover {
    background: var(--gradient-primary);
    color: var(--light-color);
    transform: translateX(8px);
}

/* 主要內容區 */
.main-content {
    margin-top: 80px;
}

/* 首頁區塊 */
.hero {
    padding: var(--space-3xl) 0;
    background: var(--gradient-secondary);
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="100" fill="rgba(255,255,255,0.1)"/><circle cx="800" cy="300" r="150" fill="rgba(255,255,255,0.1)"/><circle cx="300" cy="700" r="80" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--light-color);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

/* 分頁內容 */
.page {
    display: none;
    padding: var(--space-3xl) 0;
}

.page.active {
    display: block;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gray-500);
    margin-bottom: var(--space-2xl);
}

/* 產品卡片 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.product-card {
    background: var(--light-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-badge {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: var(--gradient-secondary);
    color: var(--light-color);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--dark-color);
}

.product-price {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.price-item {
    background: var(--gray-50);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.price-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-features {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.product-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    color: var(--gray-700);
}

.product-features li i {
    color: var(--success-color);
    margin-top: 2px;
}

/* 產品過濾器 */
.product-filter {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--light-color);
    color: var(--gray-500);
    border: 2px solid var(--gray-200);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 500;
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: var(--light-color);
    border-color: transparent;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: var(--light-color);
    border-color: transparent;
}

/* 聯絡方式 */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.contact-card {
    background: var(--light-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.contact-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 2rem;
    color: var(--light-color);
}

.contact-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.contact-description {
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* Modal - 修復遮擋問題 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: var(--space-lg);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--light-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: var(--space-xl);
    flex: 1;
    overflow-y: auto;
    /* 修復：確保內容可以滾動且不被遮擋 */
    min-height: 0;
}

.modal-footer {
    padding: var(--space-xl);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    flex-shrink: 0;
}

/* 頁腳 */
.footer {
    background: var(--dark-color);
    color: var(--light-color);
    padding: var(--space-2xl) 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--light-color);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .page-title {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-filter {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        max-width: 200px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .product-price {
        flex-direction: column;
    }

    .price-item {
        min-width: unset;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-md);
    }

    /* 手機版Modal優化 */
    .modal {
        padding: var(--space-md);
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-lg);
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* 隱藏/顯示元素 */
.hidden {
    display: none !important;
}

/* 產品詳情樣式 */
.product-detail {
    display: none;
}

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

.detail-section {
    margin-bottom: var(--space-xl);
}

.detail-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--dark-color);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--space-sm);
}

.detail-features {
    list-style: none;
}

.detail-features li {
    margin-bottom: var(--space-md);
    color: var(--gray-700);
    line-height: 1.6;
}

.detail-pricing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.pricing-option {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.pricing-label {
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--dark-color);
}

.pricing-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.pricing-description {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.detail-notice {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning-color);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--gray-700);
}

/* 載入動畫 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 改善滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}