/* ========================================
   諦豐科技 Wedify - 主要樣式表
   現代化90後風格設計
======================================== */

/* CSS Variables */
:root {
    /* 主要顏色 - 漸變紫藍色調 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    
    /* 次要顏色 */
    --secondary: #ec4899;
    --secondary-light: #f472b6;
    
    /* 強調色 */
    --accent: #14b8a6;
    --accent-light: #2dd4bf;
    
    /* 中性色 */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    
    /* 漸變 */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #14b8a6 0%, #6366f1 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-hero: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    
    /* 陰影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* 圓角 */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* 過渡 */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
    
    /* 字體 */
    --font-sans: 'Poppins', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* 啟用硬體加速 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--dark);
    color: var(--gray-300);
    line-height: 1.6;
    overflow-x: hidden;
    /* 優化文字渲染 */
    text-rendering: optimizeSpeed;
}

/* 減少動畫對低效能設備的影響 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   導航欄
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.9);
    /* 減少 blur 值以提升效能 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    /* GPU 加速 */
    will-change: background, box-shadow;
    transform: translateZ(0);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-en {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white);
    line-height: 1.2;
}

.logo-zh {
    font-size: 0.75rem;
    color: var(--gray-400);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--gray-300);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--white);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--gray-300);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.cart-btn:hover {
    color: var(--primary-light);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-link {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.admin-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--gray-300);
    transition: var(--transition);
}

/* ========================================
   按鈕樣式
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* 按鈕發光特效 */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn:hover::before {
    opacity: 1;
}

/* 按鈕光暈動畫 */
@keyframes btnGlow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 20px currentColor;
    }
    50% {
        box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
    }
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5), 
                0 0 20px rgba(99, 102, 241, 0.3),
                0 6px 20px rgba(99, 102, 241, 0.4);
}

/* 僅在非觸控設備上啟用脈衝動畫 */
@media (hover: hover) {
    .btn-primary:hover {
        animation: btnPulse 2s ease-in-out infinite;
    }
}

@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.5), 
                    0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(99, 102, 241, 0.6), 
                    0 0 25px rgba(99, 102, 241, 0.4);
    }
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 
                0 0 20px rgba(255, 255, 255, 0.2), 
                0 0 40px rgba(255, 255, 255, 0.1);
}

.btn-package {
    width: 100%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-top: auto;
}

.btn-package:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5), 
                0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-package.btn-featured {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
}

.btn-package.btn-featured:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6), 
                0 0 25px rgba(99, 102, 241, 0.4);
}

.btn-hosting {
    width: 100%;
    background: rgba(20, 184, 166, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.btn-hosting:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.5), 
                0 0 20px rgba(20, 184, 166, 0.3);
}

.full-width {
    width: 100%;
}

/* ========================================
   英雄區塊
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6rem 1.5rem 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    /* 減少 blur 值以提升效能 */
    filter: blur(60px);
    opacity: 0.4;
    /* 使用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    animation: float 10s ease-in-out infinite;
    /* 優化合成層 */
    contain: strict;
}

.sphere-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -80px;
    left: -80px;
    animation-delay: -2s;
}

.sphere-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1) translateZ(0);
    }
    50% {
        transform: translateY(-20px) scale(1.02) translateZ(0);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-400);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.75rem;
    animation: bounce 2s ease-in-out infinite;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--gray-500);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

@keyframes scroll {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(10px);
    }
}

/* ========================================
   區塊通用樣式
======================================== */
section {
    padding: 6rem 0;
    /* 優化渲染 - 內容可見性 */
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-400);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   服務區塊
======================================== */
.services {
    background: var(--gradient-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    /* GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
}

.service-card > p {
    color: var(--gray-400);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.service-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-300);
    font-size: 0.95rem;
}

.service-features i {
    color: var(--accent);
    font-size: 0.875rem;
}

/* ========================================
   套餐區塊
======================================== */
.packages {
    background: var(--dark);
    position: relative;
}

.packages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* 套餐標籤切換 */
.package-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 3rem;
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
}

.tab-btn i {
    font-size: 2rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.tab-btn span {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-300);
}

.tab-btn small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.tab-btn:hover i {
    color: var(--primary-light);
}

.tab-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
}

.tab-btn.active i,
.tab-btn.active span,
.tab-btn.active small {
    color: var(--white);
}

/* 套餐內容區 */
.package-tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.package-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-description {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.tab-description i {
    color: var(--primary-light);
    font-size: 1.25rem;
}

.tab-description p {
    color: var(--gray-300);
    font-size: 0.95rem;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

/* 內部系統套餐圖標徽章 */
.package-icon-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
}

.package-card.custom {
    border-style: dashed;
    border-color: rgba(251, 191, 36, 0.3);
}

.package-card.custom:hover {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.1);
}

.package-card.custom .package-icon-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-package.btn-custom {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.btn-package.btn-custom:hover {
    background: #f59e0b;
    color: var(--dark);
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5), 
                0 0 20px rgba(251, 191, 36, 0.3);
}

.package-card {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: visible;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
}

.package-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    z-index: 100;
}

.package-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.package-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.package-header {
    background: var(--gradient-dark);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.package-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.package-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.package-price .currency {
    font-size: 1rem;
    color: var(--gray-400);
}

.package-price .amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
}

.package-price .period {
    font-size: 1rem;
    color: var(--gray-400);
}

/* 原價標籤 */
.original-price {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: #ef4444;
    text-decoration: line-through;
    position: relative;
}

/* 未來定價標籤 */
.future-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(20, 184, 166, 0.4);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--accent-light);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.future-price-tag:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(99, 102, 241, 0.3));
    transform: scale(1.05);
}

.future-price-tag i {
    font-size: 0.7rem;
}

/* 未來定價對話泡泡 */
.future-price-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.98) 0%, rgba(99, 102, 241, 0.98) 100%);
    color: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.7;
    font-weight: 400;
    text-align: left;
    box-shadow: 0 10px 40px rgba(20, 184, 166, 0.4), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.future-price-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(99, 102, 241, 0.98);
}

.future-price-tag:hover .future-price-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.future-price-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin-right: 0.5rem;
    float: left;
}

.package-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.package-desc {
    text-align: center;
    color: var(--gray-400);
    margin-bottom: 2rem;
    min-height: 1.5rem;
}

.package-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    flex: 1;
}

.package-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-300);
}

.package-features li i {
    width: 20px;
    text-align: center;
}

.package-features li i.fa-check {
    color: var(--accent);
}

.package-features li i.fa-times {
    color: var(--gray-600);
}

.package-features li.disabled {
    color: var(--gray-600);
}

/* Feature Tooltip 對話泡泡 */
.feature-tip {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    margin: -0.5rem -0.75rem;
}

.feature-tip:hover {
    background: rgba(99, 102, 241, 0.1);
}

.tip-icon {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: auto;
    opacity: 0.6;
    transition: var(--transition);
}

.feature-tip:hover .tip-icon {
    color: var(--primary);
    opacity: 1;
}

/* Tooltip 對話泡泡容器 - 跟隨鼠標版本 */
.feature-tooltip {
    position: fixed;
    width: 280px;
    max-width: 90vw;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.98) 0%, rgba(139, 92, 246, 0.98) 100%);
    color: var(--white);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    /* 預設位置，會被 JS 覆蓋 */
    top: 0;
    left: 0;
}

/* 顯示 tooltip */
.feature-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* 手機版本調整寬度 */
@media (max-width: 768px) {
    .feature-tooltip {
        width: 250px;
        font-size: 0.8rem;
        padding: 0.875rem 1rem;
    }
}

/* Tooltip 內容動畫 */
.feature-tooltip-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.feature-tooltip-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* ========================================
   運行方案區塊
======================================== */
.hosting {
    background: var(--gradient-dark);
}

.hosting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.hosting-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
}

.hosting-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
}

.hosting-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin: 0 auto 1.5rem;
}

.hosting-card h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
}

.hosting-price {
    margin-bottom: 1.5rem;
}

.hosting-price .from {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.hosting-price .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

.hosting-price .period {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.hosting-features {
    text-align: left;
    margin-bottom: 1.5rem;
    flex: 1;
}

.hosting-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--gray-300);
    font-size: 0.95rem;
}

.hosting-features i {
    color: var(--accent);
    font-size: 0.875rem;
}

.btn-hosting {
    margin-top: auto;
}

.hosting-tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hosting-tag.recommended {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.hosting-tag.enterprise {
    background: rgba(236, 72, 153, 0.1);
    color: var(--secondary-light);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.hosting-tag.budget {
    background: rgba(20, 184, 166, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.hosting-tag.custom {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ========================================
   聯繫區塊
======================================== */
.contact {
    background: var(--dark);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info .section-tag {
    margin-bottom: 1rem;
}

.contact-info .section-title {
    text-align: left;
    margin-bottom: 1rem;
}

.contact-info > p {
    color: var(--gray-400);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-item div {
    display: flex;
    flex-direction: column;
}

.contact-item span {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.contact-item a,
.contact-item p {
    color: var(--white);
    font-weight: 500;
}

.contact-item a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.contact-form-wrapper {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-300);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-500);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--dark-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   頁腳
======================================== */
.footer {
    background: var(--dark-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: 1.5rem;
}

.footer-brand p {
    color: var(--gray-400);
    line-height: 1.7;
}

.footer-links h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--gray-400);
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-newsletter h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-newsletter > p {
    color: var(--gray-400);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--white);
    font-size: 0.95rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.newsletter-form button {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    transform: translateX(3px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: 2rem;
}

.footer-legal a {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-legal a:hover {
    color: var(--primary-light);
}

/* ========================================
   購物車側邊欄
======================================== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--dark-light);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* GPU 加速 */
    will-change: right;
    transform: translateZ(0);
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-header h3 {
    color: var(--white);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-cart {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.close-cart:hover {
    color: var(--white);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.cart-item-info h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cart-item-info p {
    color: var(--primary-light);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary);
}

.cart-item-qty {
    color: var(--white);
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.cart-total span:first-child {
    color: var(--gray-400);
}

.cart-total span:last-child {
    color: var(--white);
    font-weight: 700;
}

/* ========================================
   聊天框
======================================== */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1500;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    /* GPU 加速 */
    transform: translateZ(0);
    will-change: opacity, transform;
}

.chat-box.open {
    display: flex;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--gradient-primary);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--white);
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid var(--primary);
    border-radius: var(--radius-full);
}

.chat-header h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.chat-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.close-chat {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.close-chat:hover {
    color: var(--white);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.5;
}

.message.user .message-content {
    background: var(--gradient-primary);
    color: var(--white);
    border-bottom-right-radius: var(--radius-sm);
}

.message.bot .message-content {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray-300);
    border-bottom-left-radius: var(--radius-sm);
}

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    padding: 0 0.25rem;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--white);
    font-size: 0.95rem;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.send-btn:hover {
    transform: scale(1.05);
}

/* ========================================
   Toast 通知
======================================== */
.toast-container {
    position: fixed;
    top: 100px;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--accent);
}

.toast.error {
    border-left: 4px solid var(--secondary);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: var(--accent);
}

.toast.error i {
    color: var(--secondary);
}

.toast p {
    color: var(--white);
    flex: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========================================
   響應式設計
======================================== */
@media (max-width: 1024px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark-light);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-links.open {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .admin-link {
        display: none;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .chat-box {
        width: calc(100vw - 2rem);
        height: 70vh;
        bottom: 70px;
        right: -1rem;
    }
}

@media (max-width: 480px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   結帳系統
======================================== */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.checkout-overlay.open {
    opacity: 1;
    visibility: visible;
}

.checkout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95) translateZ(0);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    z-index: 2501;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* GPU 加速 */
    will-change: opacity, transform;
}

.checkout-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1) translateZ(0);
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--gradient-primary);
}

.checkout-header h2 {
    color: var(--white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-checkout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.25rem;
}

.close-checkout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.checkout-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* 步驟指示器 */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-400);
    transition: var(--transition);
}

.step-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
}

.step.active .step-label {
    color: var(--white);
}

.step.completed .step-number {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.step-line {
    width: 80px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 1rem;
    margin-bottom: 1.5rem;
}

/* 步驟內容 */
.checkout-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.checkout-step-content.active {
    display: block;
}

.checkout-step-content h3 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* 訂單摘要 */
.order-summary {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-item-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.order-item-details h4 {
    color: var(--white);
    font-size: 0.95rem;
    margin-bottom: 0.125rem;
}

.order-item-details span {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.order-item-price {
    text-align: right;
}

.order-item-price .price {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 1rem;
}

.order-item-price .qty {
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* 訂單總計 */
.order-total-section {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.order-subtotal,
.order-discount {
    display: flex;
    justify-content: space-between;
    color: var(--gray-400);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.order-discount span:last-child {
    color: var(--accent);
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.25rem;
    font-weight: 600;
}

.order-total span:first-child {
    color: var(--gray-300);
}

.order-total span:last-child {
    color: var(--white);
}

/* 優惠碼 */
.promo-code-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.promo-code-section input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--white);
    font-size: 0.95rem;
}

.promo-code-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-apply-promo {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-apply-promo:hover {
    background: var(--accent);
    color: var(--white);
}

/* 結帳表單 */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.checkout-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkout-form label {
    color: var(--gray-300);
    font-size: 0.9rem;
    font-weight: 500;
}

.checkout-form label .required {
    color: var(--secondary);
}

.checkout-form input,
.checkout-form textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    color: var(--white);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkout-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* 付款方式 */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-align: center;
}

.payment-card i {
    font-size: 1.75rem;
    color: var(--gray-400);
    transition: var(--transition);
}

.payment-card span {
    color: var(--gray-300);
    font-weight: 500;
}

.payment-card small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.payment-option:hover .payment-card {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.05);
}

.payment-option input:checked + .payment-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.payment-option input:checked + .payment-card i {
    color: var(--primary-light);
}

/* 條款勾選 */
.terms-checkbox {
    margin-top: 1rem;
}

.terms-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.9rem;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.terms-checkbox a {
    color: var(--primary-light);
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* 結帳按鈕 */
.checkout-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.checkout-actions.center {
    justify-content: center;
}

/* 訂單成功 */
.order-success {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: rgba(20, 184, 166, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon i {
    font-size: 3rem;
    color: var(--accent);
}

.order-success h3 {
    color: var(--white);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.order-number {
    color: var(--gray-400);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.order-number strong {
    color: var(--primary-light);
}

.success-message {
    color: var(--accent);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.success-detail {
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.order-info-card,
.payment-info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.order-info-card h4,
.payment-info-card h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-info-card ul {
    list-style: none;
}

.order-info-card li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-300);
    padding: 0.5rem 0;
}

.order-info-card li i {
    color: var(--primary-light);
    width: 20px;
    text-align: center;
}

.bank-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.bank-details p {
    color: var(--gray-300);
    margin-bottom: 0.5rem;
}

.bank-details p:last-child {
    margin-bottom: 0;
}

.bank-details strong {
    color: var(--gray-400);
}

.payment-note {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* 響應式結帳 */
@media (max-width: 768px) {
    .checkout-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .checkout-body {
        padding: 1.5rem;
    }
    
    .checkout-steps {
        transform: scale(0.9);
    }
    
    .step-line {
        width: 40px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    .checkout-actions {
        flex-direction: column;
    }
    
    .checkout-actions .btn {
        width: 100%;
    }
}
