/* ====================================
   MathsKiller - Global Premium Styles
   統一全站設計風格 v2.0
   ==================================== */

/* CSS Variables - 高級配色方案 */
:root {
    /* 主色調 - 專業紫藍漸變 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-ultra: #a5b4fc;
    
    /* 強調色 - 豐富層次 */
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    --accent-cyan: #00d4ff;
    --accent-cyan-dark: #0891b2;
    --accent-pink: #ff6b9d;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    
    /* 高級漸變 */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-hero: linear-gradient(135deg, #020617 0%, #1e1b4b 50%, #020617 100%);
    --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #6366f1 100%);
    --gradient-premium: linear-gradient(135deg, #f59e0b 0%, #6366f1 50%, #00d4ff 100%);
    --gradient-glass: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    --gradient-diagram: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    
    /* 背景色 */
    --bg-dark: #020617;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(15, 23, 42, 0.8);
    --bg-diagram: #0a0f1a;
    
    /* 文字色 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #a5b4fc;
    
    /* 邊框 */
    --border-color: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(99, 102, 241, 0.5);
    
    /* 高級陰影 */
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.4);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 60px rgba(99, 102, 241, 0.3);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-diagram: 0 4px 24px rgba(0, 0, 0, 0.5);
    
    /* 字體 */
    --font-primary: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Inter', 'Noto Sans TC', sans-serif;
    
    /* 間距 */
    --nav-height: 70px;
    --container-width: 1200px;
    
    /* 圓角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* 過渡 */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ====================================
   統一導航欄
   ==================================== */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0 5%;
}

.nav-container {
    max-width: var(--container-width);
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.4rem;
}

.nav-logo-icon {
    font-size: 1.6rem;
}

.nav-logo-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.nav-cta {
    padding: 10px 20px;
    background: var(--gradient-gold);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

/* Auth Buttons - 精美設計 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

.nav-btn {
    padding: 10px 22px;
    border: 2px solid rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.nav-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border: none;
    color: white;
    padding: 10px 24px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.nav-btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-btn.primary:hover::before {
    left: 100%;
}

.nav-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    margin: 15px;
}

.mobile-auth-buttons .nav-btn {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 1rem;
}

/* 手機端漢堡選單 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

.mobile-menu-btn.active {
    transform: rotate(90deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.99) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(30px);
    padding: 30px 20px;
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
    animation: mobileMenuIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mobileMenuIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: 8px;
    animation: slideInLeft 0.4s ease both;
}

.mobile-menu a:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu a:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu a:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu a:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu a:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu a:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu a:nth-child(7) { animation-delay: 0.35s; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(10px);
}

.mobile-menu a.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.1));
    border-color: rgba(99, 102, 241, 0.5);
}

/* 響應式 - 平板 */
@media (max-width: 1024px) {
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .nav-cta {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* 響應式 - 手機 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .auth-buttons {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .global-footer {
        padding: 40px 5% 20px;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ====================================
   統一頁腳
   ==================================== */
.global-footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 60px 5% 30px;
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 0;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

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

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.3rem;
    transition: var(--transition-normal);
}

.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ====================================
   通用按鈕樣式
   ==================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition-normal);
    font-family: var(--font-primary);
}

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

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

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

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

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

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

/* ====================================
   通用卡片樣式
   ==================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ====================================
   WhatsApp 浮動按鈕
   ==================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: whatsapp-pulse 2s ease-in-out infinite;
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: whatsapp-ring 2s ease-out infinite;
    z-index: -1;
}

.whatsapp-float::after {
    content: '立即諮詢';
    position: absolute;
    right: 75px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-float:hover::after {
    opacity: 1;
    transform: translateX(0);
}

@keyframes whatsapp-ring {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 5px 25px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 5px 35px rgba(37, 211, 102, 0.6); }
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.6);
    animation: none;
}

/* ====================================
   頁面主容器（含導航欄間距）
   ==================================== */
.page-container {
    padding-top: var(--nav-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding: 40px 5%;
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

/* ====================================
   Section 標題
   ==================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ====================================
   載入動畫
   ==================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ====================================
   Scrollbar 樣式
   ==================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ====================================
   頁面載入動畫
   ==================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.loader-logo {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse-loader 1.5s infinite;
}

@keyframes pulse-loader {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; transform: translateX(0); }
    50% { width: 100%; transform: translateX(0); }
    100% { width: 100%; transform: translateX(100%); }
}

/* ====================================
   滾動進度指示器
   ==================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-gold));
    z-index: 9998;
    transition: width 0.1s;
}

/* ====================================
   返回頂部按鈕
   ==================================== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
    z-index: 998;
    cursor: pointer;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

/* ====================================
   動畫效果
   ==================================== */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ====================================
   工具類
   ==================================== */
.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gold {
    color: var(--accent-gold);
}

.text-muted {
    color: var(--text-muted);
}

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

.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* ====================================
   高級圖表容器樣式
   ==================================== */
.diagram-container {
    position: relative;
    background: var(--bg-diagram);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-diagram);
    overflow: hidden;
}

.diagram-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-premium);
}

.diagram-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.diagram-container svg {
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.diagram-label {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* SVG 圖表增強樣式 */
.diagram-svg {
    background: linear-gradient(180deg, #0a0f1a 0%, #0f172a 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.diagram-svg text {
    font-family: var(--font-primary);
    font-weight: 600;
}

.diagram-svg .point-label {
    fill: var(--accent-cyan);
    font-size: 11px;
}

.diagram-svg .dimension-label {
    fill: var(--text-secondary);
    font-size: 9px;
}

.diagram-svg .highlight-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ====================================
   高級卡片樣式
   ==================================== */
.premium-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: var(--transition-normal);
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glass);
    opacity: 0;
    transition: var(--transition-normal);
}

.premium-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
}

.premium-card:hover::before {
    opacity: 1;
}

.premium-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.premium-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
}

.premium-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.premium-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ====================================
   題目卡片增強
   ==================================== */
.question-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 20px;
    transition: var(--transition-normal);
}

.question-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.question-number {
    position: absolute;
    top: -12px;
    left: 24px;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
}

.question-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty-easy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* ====================================
   答案標籤
   ==================================== */
.answer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-gold);
    color: #000;
    font-weight: 800;
    border-radius: 50%;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.answer-correct {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.answer-wrong {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* ====================================
   精準數學圖形顏色定義
   ==================================== */
:root {
    /* 圖形專用顏色 */
    --diagram-shape: #4ecdc4;
    --diagram-line-1: #ff6b6b;
    --diagram-line-2: #ffd93d;
    --diagram-line-3: #6bcb77;
    --diagram-line-4: #a855f7;
    --diagram-point: #ffffff;
    --diagram-area: rgba(99, 102, 241, 0.2);
    --diagram-grid: rgba(255, 255, 255, 0.05);
}

/* ====================================
   Glassmorphism 效果
   ==================================== */
.glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
}

/* ====================================
   響應式圖表
   ==================================== */
@media (max-width: 768px) {
    .diagram-container {
        padding: 15px;
    }
    
    .diagram-container svg {
        max-width: 100%;
        height: auto;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .question-number {
        top: -10px;
        left: 16px;
        font-size: 0.8rem;
        padding: 5px 12px;
    }
}

/* ====================================
   骨架屏加載效果
   ==================================== */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(30, 41, 59, 0.8) 0%, 
        rgba(51, 65, 85, 0.8) 50%, 
        rgba(30, 41, 59, 0.8) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ====================================
   成功/錯誤狀態
   ==================================== */
.status-success {
    color: var(--accent-green);
}

.status-error {
    color: var(--accent-red);
}

.status-warning {
    color: var(--accent-gold);
}

/* ====================================
   工具提示
   ==================================== */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ====================================
   徽章樣式
   ==================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-gold {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ====================================
   數字計數動畫
   ==================================== */
.count-up {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ====================================
   閃爍高亮效果
   ==================================== */
.highlight-flash {
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% { background: rgba(245, 158, 11, 0.3); }
    100% { background: transparent; }
}

/* ====================================
   按鈕波紋效果
   ==================================== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* ====================================
   按鈕光澤效果
   ==================================== */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ====================================
   卡片傾斜效果
   ==================================== */
.card-tilt {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-tilt:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

/* ====================================
   文字漸變動畫
   ==================================== */
.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--accent-gold) 25%,
        var(--accent-cyan) 50%,
        var(--accent-gold) 75%,
        var(--primary) 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 4s linear infinite;
}

@keyframes textShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* ====================================
   脈動邊框效果
   ==================================== */
.border-pulse {
    position: relative;
}

.border-pulse::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--primary), var(--accent-gold), var(--accent-cyan), var(--primary));
    background-size: 400% 400%;
    animation: borderPulse 3s ease infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.border-pulse:hover::before {
    opacity: 1;
}

@keyframes borderPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ====================================
   成功複製反饋
   ==================================== */
.copy-success {
    position: relative;
}

.copy-success::after {
    content: '✓ 已複製';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-green);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: copyFeedback 1.5s ease forwards;
    pointer-events: none;
}

@keyframes copyFeedback {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ====================================
   輸入框焦點效果
   ==================================== */
.input-glow:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.15),
        0 0 20px rgba(99, 102, 241, 0.2);
}

/* ====================================
   懸浮卡片效果
   ==================================== */
.card-float {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-float:hover {
    transform: translateY(-12px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* ====================================
   標籤切換動畫
   ==================================== */
.tab-underline {
    position: relative;
}

.tab-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-underline:hover::after,
.tab-underline.active::after {
    left: 0;
    width: 100%;
}

/* ====================================
   圖標旋轉效果
   ==================================== */
.icon-spin {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-spin:hover {
    transform: rotate(360deg);
}

/* ====================================
   展開/收起動畫
   ==================================== */
.collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible.expanded {
    max-height: 2000px;
}

/* ====================================
   載入狀態
   ==================================== */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ====================================
   成功/錯誤圖標動畫
   ==================================== */
.icon-success {
    animation: iconPop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent-green);
}

.icon-error {
    animation: iconShake 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent-red);
}

@keyframes iconPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes iconShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ====================================
   鍵盤焦點樣式
   ==================================== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ====================================
   打印樣式
   ==================================== */
@media print {
    .global-nav,
    .global-footer,
    .whatsapp-float,
    .back-to-top,
    .scroll-to-top {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ====================================
   頁面進入動畫
   ==================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* ====================================
   Scroll to Top 按鈕
   ==================================== */
.scroll-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

/* ====================================
   頁面載入進度條
   ==================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10000;
}

.page-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-premium);
    animation: pageLoad 0.8s ease-out forwards;
}

@keyframes pageLoad {
    0% { width: 0; }
    100% { width: 100%; }
}

/* ====================================
   平滑滾動
   ==================================== */
html {
    scroll-behavior: smooth;
}

/* ====================================
   Selection 高亮
   ==================================== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ====================================
   Skeleton Loading
   ==================================== */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-secondary) 25%, 
        var(--bg-tertiary) 50%, 
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 200px;
}

/* ====================================
   Tooltip
   ==================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 8px 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ====================================
   Video Player 專業樣式
   ==================================== */
.video-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.video-container video {
    width: 100%;
    display: block;
    background: var(--bg-primary);
}

.video-container:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.5);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.7);
}

/* ====================================
   入場動畫
   ==================================== */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes fadeInRight {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* 延遲動畫 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ====================================
   課程卡片增強
   ==================================== */
.course-card-enhanced {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.course-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-premium);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.course-card-enhanced:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.course-card-enhanced:hover::before {
    opacity: 1;
}

/* ====================================
   專業標籤樣式
   ==================================== */
.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pro.gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pro.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pro.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ====================================
   統計數字動畫
   ==================================== */
.stat-number-animated {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ====================================
   Glassmorphism 卡片
   ==================================== */
.glass-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ====================================
   進度條樣式
   ==================================== */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ====================================
   響應式視頻容器
   ==================================== */
.video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

