/* ========== 全局設定 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;
    --secondary-color: #0a0a0a;
    --accent-color: #4a9eff;
    --accent-light: #7bb8ff;
    --accent-dark: #2868b8;
    --text-dark: #ffffff;
    --text-light: #e8e8e8;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --shadow: 0 10px 30px rgba(74, 158, 255, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #0a0a0a 100%);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(74, 158, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(123, 184, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== 導航欄 ========== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(74, 158, 255, 0.15);
    border-bottom: 1px solid rgba(74, 158, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    transition: var(--transition);
    filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.4));
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(74, 158, 255, 0.6));
}

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ffffff, #7bb8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== 主要內容區 ========== */
main {
    position: relative;
    z-index: 1;
    margin-top: 80px;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== 個人介紹區 ========== */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeInUp 1s ease-out;
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    display: inline-block;
}

.hero-logo {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.4));
    animation: heroLogoFloat 3s ease-in-out infinite;
}

@keyframes heroLogoFloat {
    0%, 100% { 
        transform: translateY(0px);
        filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.4));
    }
    50% { 
        transform: translateY(-10px);
        filter: drop-shadow(0 0 30px rgba(74, 158, 255, 0.6));
    }
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #7bb8ff, #4a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInLeft 0.8s ease-out;
    filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.3));
}

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

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: slideInRight 0.8s ease-out;
}

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

.hero-description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.85;
    line-height: 1.8;
}

.skills-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.skill-badge {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    border: 1px solid rgba(74, 158, 255, 0.3);
    transition: var(--transition);
    animation: fadeIn 1s ease-out backwards;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.1);
}

.skill-badge:nth-child(1) { animation-delay: 0.1s; }
.skill-badge:nth-child(2) { animation-delay: 0.2s; }
.skill-badge:nth-child(3) { animation-delay: 0.3s; }
.skill-badge:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.skill-badge:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(74, 158, 255, 0.15);
    box-shadow: 
        0 5px 15px rgba(74, 158, 255, 0.3),
        0 0 15px rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.5);
}

/* ========== 專案區 ========== */
.projects-section {
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #4a9eff, #7bb8ff, transparent);
    margin: 1rem auto;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.4);
    animation: lineGlow 2s ease-in-out infinite;
}

@keyframes lineGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(74, 158, 255, 0.4);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px rgba(74, 158, 255, 0.6), 0 0 30px rgba(74, 158, 255, 0.3);
        opacity: 0.9;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ========== 專案卡片 ========== */
.project-card {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(74, 158, 255, 0.25);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-light);
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.08) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 
        0 12px 35px rgba(74, 158, 255, 0.2),
        0 0 25px rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.5);
    background: rgba(10, 20, 35, 0.9);
}

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

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.12), transparent);
    transition: left 0.7s ease;
}

.project-card:hover::after {
    left: 100%;
}

.project-card:active {
    transform: translateY(-8px) scale(1.01);
}

.project-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    color: #7bb8ff;
    transition: var(--transition);
}

.project-icon i {
    display: block;
    background: linear-gradient(135deg, #4a9eff, #7bb8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(74, 158, 255, 0.4));
}

.project-card:hover .project-icon {
    transform: translateY(-5px) scale(1.05);
}

.project-card:hover .project-icon i {
    filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.6));
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-description {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: rgba(74, 158, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: #7bb8ff;
}

.project-year {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: #7bb8ff;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #4a9eff 0%, #7bb8ff 100%);
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 15px rgba(74, 158, 255, 0.4);
    color: #000000;
}

/* ========== 頁尾 ========== */
footer {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
    margin-top: 4rem;
    border-top: 1px solid rgba(74, 158, 255, 0.2);
    position: relative;
    z-index: 1;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-link {
    color: var(--text-light);
    font-size: 1.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.1);
    color: #4a9eff;
    filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.5));
}

.footer-text {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ========== 響應式設計 ========== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    nav {
        padding: 1rem;
    }
    
    .nav-title {
        font-size: 1.2rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
}

/* ========== 載入動畫 ========== */
.fade-in {
    animation: fadeInUp 0.6s ease-out backwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }

/* ========== 滾動條美化 ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.4);
    border-radius: 5px;
    border: 2px solid rgba(0, 0, 0, 0.8);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.6);
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

/* ========== 專案彈窗 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.modal.active {
    opacity: 1;
}

.modal-content {
    background: rgba(10, 10, 10, 0.95);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(74, 158, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(74, 158, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: var(--transition);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.modal-close:hover {
    background: rgba(74, 158, 255, 0.2);
    transform: rotate(90deg);
    border-color: rgba(74, 158, 255, 0.6);
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    border-bottom: 2px solid rgba(74, 158, 255, 0.3);
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #7bb8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title i {
    background: linear-gradient(135deg, #4a9eff, #7bb8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-badge.featured {
    background: linear-gradient(135deg, #4a9eff, #7bb8ff);
    color: #000000;
}

.modal-badge.year {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: #7bb8ff;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: var(--text-light);
}

.modal-tech {
    margin-bottom: 1.5rem;
}

.modal-tech h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #7bb8ff;
}

.modal-tech-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-tag {
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #7bb8ff;
    font-weight: 500;
}

.modal-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.modal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(74, 158, 255, 0.2);
}

.modal-link-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(74, 158, 255, 0.4);
    background: rgba(74, 158, 255, 0.1);
    color: #7bb8ff;
}

.modal-link-btn:hover {
    background: rgba(74, 158, 255, 0.25);
    border-color: rgba(74, 158, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 158, 255, 0.3);
}

.modal-link-btn.github {
    background: rgba(74, 158, 255, 0.15);
}

.modal-link-btn.website {
    background: linear-gradient(135deg, #4a9eff, #7bb8ff);
    color: #000000;
    border: none;
}

.modal-link-btn.website:hover {
    box-shadow: 0 5px 20px rgba(74, 158, 255, 0.5);
}

/* 響應式彈窗 */
@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-links {
        flex-direction: column;
    }
    
    .modal-link-btn {
        width: 100%;
        justify-content: center;
    }
}

