/* --- 全域設定 --- */
:root {
    --primary-color: #4fd1c5; /* 主色 */
    --background-color: #1a202c; /* 背景色 */
    --card-background: #2d3748; /* 卡片背景 */
    --text-color: #f7fafc; /* 主要文字 */
    --text-muted: #a0aec0; /* 次要文字 */
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Noto Sans TC', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.8;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

/* --- 導覽列 --- */
.navbar {
    background-color: rgba(45, 55, 72, 0.8);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.navbar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2.5rem;
}

.navbar nav ul li a {
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    text-decoration: none;
    position: relative;
}

.navbar nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar nav ul li a:hover,
.navbar nav ul li a.active {
    color: var(--text-color);
}

.navbar nav ul li a:hover::after,
.navbar nav ul li a.active::after {
    width: 100%;
}


/* --- 英雄區塊 (首頁) --- */
.hero-section {
    min-height: calc(100vh - 80px); /* 減去導覽列高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(26, 32, 44, 0.85), rgba(26, 32, 44, 0.85)), url('../images/hero-background.jpg') center center / cover no-repeat;
}

.hero-content h1 {
    font-family: var(--heading-font);
    font-size: clamp(2.5rem, 5vw, 4rem); /* 自適應字體 */
    color: var(--text-color);
    margin: 0 0 1rem;
    animation: fadeInDown 1s ease-out;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease-out 0.3s;
    animation-fill-mode: backwards; /* 讓動畫開始前元素不可見 */
}

/* --- 按鈕 --- */
.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: fadeInUp 1s ease-out 0.6s;
    animation-fill-mode: backwards;
}

.cta-button:hover {
    background-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(79, 209, 197, 0.4);
}

/* --- 通用頁面區塊 --- */
.page-section {
    padding: 6rem 0;
}

.page-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
}

.page-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
}


/* --- 關於我頁面 --- */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    text-align: left;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

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

.skills ul {
    list-style: none;
    padding: 0;
}

.skills li {
    background-color: var(--card-background);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

/* --- 專案頁面 --- */
.project-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-background);
    border-radius: 8px;
    text-align: left;
    overflow: hidden; /* 確保內容不超出圓角 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.project-card-content {
    padding: 1.5rem;
    flex-grow: 1; /* 讓內容填滿剩餘空間 */
    display: flex;
    flex-direction: column;
}

.project-card-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.project-card-content p {
    color: var(--text-muted);
    flex-grow: 1; /* 推動下方元素到底部 */
}

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

.project-tags span {
    background-color: #4a5568;
    color: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    align-self: flex-start; /* 靠左對齊 */
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #fff;
    text-decoration: underline;
}


/* --- 聯絡我頁面 --- */
#contact p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
}


/* --- 頁尾 --- */
.footer {
    background-color: #2d3748;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid #4a5568;
}

.footer .social-links a {
    margin: 0 15px;
    color: var(--text-muted);
    font-size: 1.5rem; /* 放大圖示 */
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block; /* 讓 transform 生效 */
}

.footer .social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
    text-decoration: none;
}

.footer p {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

/* --- 動畫 --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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


/* --- 響應式佈局 --- */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .page-section {
        padding: 4rem 0;
    }

    .page-section h2 {
        font-size: 2rem;
    }
}