﻿:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --card-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --hover-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden; /* 只隱藏水平滾動 */
    display: flex;
    flex-direction: column;
    margin: 0; /* 確保沒有預設 margin */
    padding: 0; /* 確保沒有預設 padding */
}

/* 導航列樣式 */
.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: var(--card-shadow);
    padding: 0.75rem 0; /* 減少垂直padding */
    border: none;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem; /* 稍微減小字體 */
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap; /* 防止標題換行 */
    margin-right: 1rem; /* 增加右邊距 */
}

    .navbar-brand:hover {
        color: #f8f9fa !important;
        transform: scale(1.05);
        transition: all 0.3s ease;
    }

/* 主導航項目樣式 */
.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    margin: 0 0.1rem; /* 減少水平間距 */
    padding: 0.4rem 0.6rem !important; /* 減少padding */
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.85rem; /* 減小字體 */
    white-space: nowrap; /* 防止文字換行 */
}

    .navbar-nav .nav-link:hover {
        color: white !important;
        background-color: rgba(255,255,255,0.2);
        transform: translateY(-2px);
    }

/* 右側用戶導航樣式 */
.navbar-nav:last-child {
    margin-left: auto; /* 確保靠右對齊 */
}

    .navbar-nav:last-child .nav-link {
        margin: 0 0.2rem;
        padding: 0.5rem 0.8rem !important;
        font-size: 0.9rem;
        background-color: rgba(255,255,255,0.1);
        border-radius: 25px;
    }

        .navbar-nav:last-child .nav-link:hover {
            background-color: rgba(255,255,255,0.3);
        }

/* 滾動平滑效果 */
html {
    scroll-behavior: smooth;
}

/* 錨點偏移調整（避免被固定導航列遮賠） */
section[id] {
    scroll-margin-top: 100px;
}

/* 為div錨點也添加偏移 */
div[id] {
    scroll-margin-top: 100px;
}

/* 響應式導航樣式 */
@media (min-width: 1400px) {
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem !important;
        margin: 0 0.2rem;
    }
    
    .navbar-brand {
        font-size: 1.4rem;
    }
}

@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem !important;
        margin: 0 0.05rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 992px) {
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
        padding: 0.75rem 1rem !important;
        border-radius: 10px;
        text-align: center;
        background-color: rgba(255,255,255,0.1);
        white-space: normal; /* 在手機版允許換行 */
    }

        .navbar-nav .nav-link:hover {
            background-color: rgba(255,255,255,0.3);
            transform: none;
        }

    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    /* 手機版下右側導航項目 */
    .navbar-nav:last-child {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
}

.navbar-toggler {
    border: 2px solid rgba(255,255,255,0.5);
    padding: 0.4rem 0.8rem;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 橫幅圖樣式 */
.hero-banner {
    background: linear-gradient(135deg, rgba(4, 12, 247, 0.4) 0%, rgba(118, 75, 162, 0.4) 50%, rgba(240, 147, 251, 0.3) 100%), url('/image/banner02.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
}

    .hero-banner::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%), radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 70%), linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
        z-index: 1;
    }

.hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 50px 0 50px 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6), 1px 1px 3px rgba(0,0,0,0.3);
    animation: slideInLeft 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.8;
    color: #cffd47 !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6);
    animation: slideInLeft 1s ease-out 0.3s both;
}

.hero-buttons {
    animation: slideInLeft 1s ease-out 0.6s both;
}

.hero-icon {
    font-size: 15rem;
    color: rgba(255, 255, 255, 0.1);
    animation: pulse 3s ease-in-out infinite;
    margin-left: -30px;
}

.floating-elements {
    position: relative;
    height: 300px;
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.6);
    animation: float 6s ease-in-out infinite;
}

    .floating-icon:nth-child(1) {
        top: 20%;
        left: 20%;
    }

    .floating-icon:nth-child(2) {
        top: 60%;
        right: 20%;
    }

    .floating-icon:nth-child(3) {
        bottom: 20%;
        left: 50%;
    }

    /* 新增圖標位置定義 - 避免重疊 */
    .floating-icon:nth-child(4) {
        top: 15%;
        right: 35%;
    }

    .floating-icon:nth-child(5) {
        bottom: 45%;
        right: 45%;
    }

.min-vh-50 {
    min-height: 50vh;
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    font-weight: 600;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    background-color: rgba(255, 255, 255, 0.1);
}

    .btn-outline-light:hover {
        background-color: white;
        color: #764ba2;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
        text-shadow: none;
    }

.btn-primary {
    background: var(--secondary-gradient);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--hover-shadow);
    }

.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--hover-shadow);
    }

.hero-section {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

    .hero-section h1 {
        font-size: 3rem;
        font-weight: 700;
        margin-bottom: 1rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }

    .hero-section p {
        font-size: 1.2rem;
        opacity: 0.9;
    }

/* AI themed decorative elements */
.ai-pattern {
    position: relative;
}

    .ai-pattern::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%);
        z-index: -1;
        pointer-events: none;
    }

/* 確保AI特效容器的基礎樣式 */
.ai-trophy-glow {
    position: absolute;
    top: 38%;
    right: 13%;
    transform: translateY(-50%);
    width: 180px;
    height: 180px;
    pointer-events: none;
    z-index: 15;
    /* 確保顯示在最前面 */
    display: block;
    visibility: visible;
}

/* 確保AI文字的基礎可見性 */
.ai-text-glow {
    position: absolute;
    top: 48%;
    left: 53%;
    transform: translate(-50%, -50%);
    font-size: 82px;
    font-weight: bold;
    color: #d9eaed;
    text-shadow: 0 0 10px #00d4ff;
    animation: aiFlashGlow 2s infinite alternate ease-in-out;
    z-index: 20;
    font-family: 'Arial Black', Arial, sans-serif;
    /* 確保字體後備方案 */
    display: block;
    visibility: visible;
}

/* 動畫效果 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.2;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(120deg);
    }

    66% {
        transform: translateY(-10px) rotate(240deg);
    }
}

.container {
    max-width: 1400px; /* 增加最大寬度 */
}

/* 導航列容器特別設定 */
.navbar .container {
    max-width: 1400px;
    padding: 0 1rem;
}

@media (min-width: 1600px) {
    .navbar .container {
        max-width: 1500px;
    }
}

/* 內容區域樣式 */
.content-wrapper {
    position: relative;
    z-index: 3;
    flex: 1;
    min-height: calc(100vh - 200px); /* 確保內容區域有足夠的最小高度 */
    display: flex;
    flex-direction: column;
}

main {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 0; /* 移除padding，讓內容頁面自己控制 */
    margin: 0; /* 移除margin */
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 3;
    flex: 1; /* 讓main元素也使用flex布局 */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer {
    background: var(--dark-gradient);
    color: white;
    padding: 2rem 0; /* 增加 padding 以容納新內容 */
    margin-top: auto !important; /* 確保footer始終在底部 */
    border: none;
    position: relative;
    z-index: 10;
    line-height:10px !important;
}

    .footer a {
        color: #87ceeb;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .footer a:hover {
            color: white;
            text-decoration: underline;
        }

/* 指導單位與主辦單位樣式 */
.organizer-info {
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

    .organizer-info:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }

    .organizer-info h6 {
        color: #ffffff !important;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .organizer-info p {
        color: #e8f4fd !important;
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 0;
    }

/* Footer 連結顏色優化 */
.footer .text-info {
    color: #63c5da !important;
    font-weight: 500;
}

    .footer .text-info:hover {
        color: #ffffff !important;
        text-shadow: 0 0 5px rgba(99, 197, 218, 0.5);
    }

.footer .text-light {
    color: #f8f9fa !important;
}

/* 分隔線樣式 */
.footer hr {
    border-color: rgba(255, 255, 255, 0.3) !important;
    margin: 1.5rem 0;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0; /* 在小螢幕上適當減少 padding */
    }

        .footer .container .row {
            margin: 0;
        }

        .footer p {
            margin-bottom: 0.5rem;
        }

            .footer p:last-child {
                margin-bottom: 0;
            }

    /* 指導單位與主辦單位響應式 */
    .organizer-info {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }

        .organizer-info h6 {
            font-size: 1rem;
        }

        .organizer-info p {
            font-size: 0.9rem;
        }

    /* Footer連結在小螢幕上的樣式 */
    .footer .col-md-6 {
        margin-bottom: 1rem;
    }

        .footer .col-md-6:last-child {
            margin-bottom: 0;
        }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-banner {
        min-height: 60vh;
    }

    .hero-icon {
        font-size: 8rem;
    }

    .floating-elements {
        height: 200px;
    }

    .floating-icon {
        font-size: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }

        .hero-buttons .btn:last-child {
            margin-bottom: 0;
        }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-content {
        padding: 2rem;
    }

    .hero-image {
        display: none;
    }
}

/* 表單 checkbox 置中樣式 */
.form-check.text-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

    .form-check.text-center .form-check-input {
        margin: 0 0.5rem 0 0;
    }

/* Checkbox 藍色邊框樣式 */
.form-check-input[type="checkbox"] {
    border: 2px solid #0d6efd;
}

    .form-check-input[type="checkbox"]:checked {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }

    .form-check-input[type="checkbox"]:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .form-check-input[type="checkbox"]:hover {
        border-color: #0b5ed7;
    }

/* AI 獎盃閃動效果樣式 */
/* AI 獎盃特效容器 */
.ai-trophy-glow {
    position: absolute;
    top: 38%;
    right: 13%;
    transform: translateY(-50%);
    width: 180px;
    height: 180px;
    pointer-events: none;
    z-index: 15;
}

/* AI 字樣閃動效果 */
.ai-text-glow {
    position: absolute;
    top: 48%;
    left: 53%;
    transform: translate(-50%, -50%);
    font-size: 82px;
    font-weight: bold;
    color: #d9eaed;
    text-shadow: 0 0 10px #00d4ff;
    animation: aiFlashGlow 2s infinite alternate ease-in-out;
    z-index: 20;
    font-family: 'Arial Black', sans-serif;
}

/* 主要閃動動畫 */
@keyframes aiFlashGlow {
    0% {
        opacity: 0.6;
        text-shadow: 0 0 5px #00d4ff, 0 0 10px #00d4ff, 0 0 15px #00d4ff;
        transform: translate(-50%, -50%) scale(1);
    }

    25% {
        opacity: 0.8;
        text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff, 0 0 30px #00d4ff, 0 0 40px #0099cc;
        transform: translate(-50%, -50%) scale(1.05);
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 15px #00d4ff, 0 0 25px #00d4ff, 0 0 35px #00d4ff, 0 0 45px #0099cc, 0 0 55px #0066aa;
        transform: translate(-50%, -50%) scale(1.1);
    }

    75% {
        opacity: 0.9;
        text-shadow: 0 0 20px #00d4ff, 0 0 30px #00d4ff, 0 0 40px #00d4ff, 0 0 50px #0099cc;
        transform: translate(-50%, -50%) scale(1.08);
    }

    100% {
        opacity: 0.7;
        text-shadow: 0 0 8px #00d4ff, 0 0 16px #00d4ff, 0 0 24px #00d4ff;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

/* 脈衝圓圈效果 */
.ai-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid #00d4ff;
    border-radius: 50%;
    opacity: 0;
    animation: aiPulse 5s infinite;
}

@keyframes aiPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.4;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* 粒子效果 */
.ai-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
}

.ai-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
    animation: aiParticleFloat 3s infinite linear;
    box-shadow: 0 0 6px #00d4ff;
}

    .ai-particle:nth-child(1) {
        animation-delay: 0s;
        top: 20%;
        left: 30%;
    }

    .ai-particle:nth-child(2) {
        animation-delay: 0.5s;
        top: 60%;
        left: 70%;
    }

    .ai-particle:nth-child(3) {
        animation-delay: 1s;
        top: 40%;
        left: 20%;
    }

    .ai-particle:nth-child(4) {
        animation-delay: 1.5s;
        top: 80%;
        left: 50%;
    }

    .ai-particle:nth-child(5) {
        animation-delay: 2s;
        top: 10%;
        left: 80%;
    }

    .ai-particle:nth-child(6) {
        animation-delay: 2.5s;
        top: 70%;
        left: 15%;
    }

@keyframes aiParticleFloat {
    0% {
        opacity: 0;
        transform: translateY(0px) scale(0);
    }

    20% {
        opacity: 1;
        transform: translateY(-15px) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-25px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-35px) scale(0);
    }
}

/* 發光圓圈效果 */
.ai-glow-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    animation: aiGlowRotate 4s infinite linear;
}

@keyframes aiGlowRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.3;
        border-color: rgba(0, 212, 255, 0.3);
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
        opacity: 0.6;
        border-color: rgba(0, 212, 255, 0.6);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        opacity: 0.3;
        border-color: rgba(0, 212, 255, 0.3);
    }
}

/* 響應式調整 */
@media (max-width: 992px) {
    .ai-trophy-glow {
        right: 8%;
        width: 150px;
        height: 150px;
    }

    .ai-text-glow {
        font-size: 60px;
    }
}

@media (max-width: 768px) {
    .ai-trophy-glow {
        right: 5%;
        width: 120px;
        height: 120px;
        top: 40%;
    }

    .ai-text-glow {
        font-size: 48px;
    }

    .ai-pulse-ring {
        width: 60px;
        height: 60px;
    }

    .ai-glow-circle {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 576px) {
    .ai-trophy-glow {
        right: 3%;
        width: 100px;
        height: 100px;
        top: 35%;
    }

    .ai-text-glow {
        font-size: 36px;
    }
}

/* 懸停增強效果 */
.hero-banner:hover .ai-text-glow {
    animation-duration: 1s;
}

.hero-banner:hover .ai-pulse-ring {
    animation-duration: 1.5s;
}

/* 確保橫幅區域有相對定位 */
.hero-banner {
    position: relative;
}

/* 回到頂部按鈕樣式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}


/* 回到頂部按鈕響應式調整 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}
