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

body {
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
    line-height: 1.6;
    color: #1f2937;
}

/* Navigation Styles */
.nav-link {
    position: relative;
    color: #4b5563;
    font-weight: 500;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: #10B981;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 2px;
}

.mobile-nav-link {
    padding: 12px 16px;
    color: #4b5563;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background-color: #f3f4f6;
    color: #10B981;
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Statistics Cards */
.stat-card {
    padding: 32px 24px;
    border-radius: 16px;
    color: white;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.9;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.95;
}

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #10B981, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

/* Highlight Cards */
.highlight-card {
    padding: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.highlight-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: #10B981;
}

.highlight-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* News Cards */
.news-card {
    position: relative;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #10B981;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.news-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.news-date {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-excerpt {
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.6;
}

.news-link {
    color: #10B981;
    font-weight: 600;
    transition: all 0.3s ease;
}

.news-link:hover {
    color: #059669;
    text-decoration: underline;
}

/* Step Cards */
.step-card {
    position: relative;
    text-align: center;
    padding: 32px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.step-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.step-desc {
    color: #6b7280;
    line-height: 1.6;
}

/* Footer Styles */
.footer-link {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #10B981;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #10B981;
    color: white;
    transform: translateY(-3px);
}

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

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

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-30px);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(-5%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out infinite 1s;
}

.animate-gradient-x {
    background-size: 200% 100%;
    animation: gradient-x 15s ease infinite;
}

.animate-shimmer {
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .highlight-card,
    .news-card {
        margin-bottom: 16px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.gradient-text {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(90deg, #10B981, #3B82F6, #8B5CF6, #10B981);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-x 3s ease infinite;
}

.glow-effect {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5),
                0 0 40px rgba(16, 185, 129, 0.3),
                0 0 60px rgba(16, 185, 129, 0.1);
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

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

.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-md {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.text-shadow-lg {
    text-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.bg-pattern-dots {
    background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}

.bg-pattern-grid {
    background-image: linear-gradient(rgba(16, 185, 129, 0.1) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(16, 185, 129, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.badge-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    z-index: 999;
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10B981, #3B82F6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Lazy Load Images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded {
    opacity: 1;
}

img[loading="lazy"] {
    min-height: 200px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Scroll Animation - FIXED: 設為立即可見 */
/* 🔧 CRITICAL FIX: 強制所有元素立即可見 - 不破壞佈局 */
.animate-on-scroll,
section.animate-on-scroll {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* 確保卡片和內容可見 */
.stat-card, 
.highlight-card, 
.news-card, 
.step-card {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 確保數字可見 */
.stat-number {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 確保所有子元素可見但保持原始 display 屬性 */
.animate-on-scroll * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 保持 grid 和 flex 佈局 */
.grid {
    display: grid !important;
}

.flex {
    display: flex !important;
}

/* 確保圖片正確顯示 */
img {
    opacity: 1 !important;
    visibility: visible !important;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
}

.skeleton-image {
    height: 200px;
    border-radius: 12px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.warning {
    border-left: 4px solid #F59E0B;
}

.toast.info {
    border-left: 4px solid #3B82F6;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    color: #6b7280;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #4b5563;
}

/* Print Styles */
@media print {
    nav,
    footer,
    .cta-button,
    .back-to-top,
    .toast {
        display: none;
    }
}