/* 全局設定 */
:root {
    --primary-color: #00ff9d;
    --secondary-color: #009944;
    --dark-bg: #0a0a0a;
    --light-text: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    padding-top: 76px;
}

/* 文字漸變效果 */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* 導覽列樣式 */
.navbar {
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    box-shadow: 0 2px 20px rgba(0, 255, 157, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar .nav-link {
    color: var(--light-text);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after {
    width: 80%;
}

/* Hero 區塊 */
.hero-section {
    position: relative;
    background-color: var(--dark-bg);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 157, 0.1) 0%, transparent 70%);
    z-index: 1;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.5rem;
    opacity: 0.9;
}

.btn-outline-light {
    border: 2px solid var(--light-text);
    color: var(--light-text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: var(--light-text);
    color: var(--dark-bg);
    transform: translateY(-2px);
}

/* 滾動指示器 */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--light-text);
    border-radius: 15px;
    margin: 0 auto 1rem;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    background: var(--light-text);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 20px); opacity: 0; }
}

/* 區塊標題 */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

/* 研究卡片 */
.research-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.research-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.1);
}

.card-image {
    position: relative;
    overflow: hidden;
    padding-top: 60%;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: all 0.3s ease;
}

.research-card:hover .card-overlay {
    opacity: 1;
}

.research-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 2rem;
}

.card-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* 圖片容器 */
.image-container {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(0, 153, 68, 0.1));
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* 動畫效果 */
[data-aos] {
    opacity: 0;
    transition: all 0.8s ease;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* 全局字體設定 */
body {
    font-family: 'Inter', sans-serif;
    padding-top: 76px; /* 為固定導覽列預留空間 */
}

.hero-section {
    background-image: url('../assets/bg_main.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    margin-top: -76px; /* 抵消 body 的 padding-top */
    margin-bottom: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-section h1.animate {
    opacity: 1;
    transform: translateY(0);
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.navbar-brand {
    color: #4a4a4a;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #009944;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.95) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.navbar .nav-link {
    color: #4a4a4a;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.navbar .nav-link:hover {
    color: #2c5530;
    transform: translateX(5px);
}

/* Section Spacing */
section {
    margin-bottom: 6rem;
    scroll-margin-top: 100px; /* 為跳頁預留空間 */
}

section:last-child {
    margin-bottom: 0;
}

/* About Us Section */
.about-section {
    background-color: #f8f9fa;
    padding: 4rem 0;
    margin-top: 0;
}

.about-section h3 {
    color: #2c5530;
    margin-bottom: 2rem;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: rgba(44, 85, 48, 0.1);
    border-radius: 4px;
}

.about-section h5 {
    color: #2c5530;
    margin-bottom: 1.5rem;
}

.about-section p {
    color: #4a4a4a;
    line-height: 2.0;
    margin-bottom: 0;
}

.about-section img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.about-section img[src="assets/light.jpg"] {
    opacity: 0;
    transform: translateX(50px);
}

.about-section img[src="assets/culture.jpg"] {
    opacity: 0;
    transform: translateX(-50px);
}

.about-section img.animate {
    opacity: 1;
    transform: translateX(0);
}

.about-section img:hover {
    transform: scale(1.02);
}

/* Research Project Section */
.research-project-section {
    position: relative;
    overflow: visible;
}

.research-project-section h3 {
    color: #2c5530;
    margin-bottom: 2rem;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: rgba(44, 85, 48, 0.1);
    border-radius: 4px;
}

.research-project-section h5 {
    color: #2c5530;
    margin-bottom: 1.5rem;
}

.parallax-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    margin: 2rem 0;
}

.parallax-image {
    position: relative;
    width: 100%;
    height: auto;
    will-change: transform;
    transform: translateZ(0);
    display: block;
    transition: transform 0.1s ease-out;
}

/* Card Styles */
.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card-img-top {
    height: 400px;
    object-fit: cover;
}

.card-title {
    color: #2c5530;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-text {
    color: #4a4a4a;
    line-height: 2.0;
}

@media (max-width: 768px) {
    .about-section .row > div {
        margin-bottom: 2rem;
    }
    
    section {
        margin-bottom: 4rem;
    }
}

/* Contact Section */
.contact-section {
    background-color: #f8f9fa;
    padding: 4rem 0 0 0;
}

.contact-section h3 {
    color: #2c5530;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: rgba(44, 85, 48, 0.1);
    border-radius: 4px;
}

.contact-section p {
    color: #4a4a4a;
    line-height: 2.0;
}

.contact-us {
    background-color: rgba(44, 85, 48, 0.1);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

#copyright {
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

section.contact-section {
    margin-bottom: 0;
}

#copyright p {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.2;
    margin-bottom: 0;
}
