/* --- 基礎設定與主題變數 --- */
:root {
    /* 深色模式 (預設) */
    --bg-color: #0b1120;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --card-bg: rgba(15, 23, 42, 0.8);
    --nav-bg: rgba(11, 17, 32, 0.9);
    --sub-text: #94a3b8;
    --title-color: #ffffff;
    --blob-opacity: 0.3;
    --card-border: rgba(56, 189, 248, 0.1); /* 新增變數便於管理邊框 */
}
.site-logo {
    height: 55px; /* 根據導覽列高度調整圖片大小 */
    width: auto;
    display: block;
    transition: 0.3s;
}

/* 懸停效果，讓 Logo 有點互動感 */
.logo-wrapper:hover .site-logo {
    transform: scale(1.05);
}
/* 淺色模式變量 */
[data-theme="light"] {
    --bg-color: #f1f5f9;
    --text-color: #1e293b;
    --accent-color: #0284c7;
    --card-bg: rgba(255, 255, 255, 0.9);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --sub-text: #475569;
    --title-color: #0f172a;
    --blob-opacity: 0.15;
    --card-border: rgba(0, 0, 0, 0.05);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    text-decoration: none; 
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.6; 
    overflow-x: hidden; 
    scroll-behavior: smooth; 
    transition: background-color 0.3s, color 0.3s; 
}
body.theme-transitioning {
    transition: background-color 0.3s ease, color 0.3s ease;
}
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 40px; 
}

/* --- 背景動畫 --- */
.bg-animation { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: -1; 
    filter: blur(80px); 
    opacity: var(--blob-opacity); 
    transition: opacity 0.3s;
}

.blob { 
    position: absolute; 
    width: 400px; 
    height: 400px; 
    border-radius: 50%; 
    animation: move 20s infinite alternate; 
}

.blob-1 { background: var(--accent-color); top: -10%; left: -10%; }
.blob-2 { background: #6366f1; bottom: 10%; right: -5%; }

@keyframes move { 
    from { transform: translate(0, 0); } 
    to { transform: translate(200px, 100px); } 
}

/* --- 導覽列 --- */
.navbar { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    height: 80px; 
    background: var(--nav-bg); 
    backdrop-filter: blur(12px); 
    z-index: 1000; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    display: flex; 
    align-items: center; 
    transition: background 0.1s;
}

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

.logo { 
    font-size: 1.4rem; 
    font-weight: bold; 
    color: var(--accent-color); 
}

/* --- 下拉選單樣式設計 --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.menu-trigger-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.4rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    opacity: 0.8;
}

.menu-trigger-btn:hover {
    opacity: 1;
    color: var(--accent-color);
}

.dropdown-content {
    display: none; /* 預設隱藏 */
    position: absolute;
    top: 55px;
    right: 0;
    min-width: 180px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 0;
    list-style: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 2000;
}

/* 顯示 Class */
.dropdown-content.show {
    display: block;
    animation: menuFadeIn 0.25s ease-out;
}

.dropdown-content li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: 0.2s;
}

.dropdown-content li a i {
    width: 18px;
    text-align: center;
    opacity: 0.7;
}

.dropdown-content li a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 主題按鈕樣式 --- */
.theme-btn {
    background: transparent;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.3s ease;
}

.theme-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* --- Hero 區塊 --- */
.hero { 
    min-height: 70vh; 
    display: flex; 
    align-items: center; 
    padding-top: 80px; 
}

.hero-layout { 
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between; 
    width: 100%; 
    gap: 40px; 
}

.hero h1 { 
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem; 
    line-height: 1.2; 
    font-weight: 800; 
    margin-bottom: 20px; 
    color: var(--title-color); 
}

.highlight-animated { 
    background: linear-gradient(to right, #38bdf8, #fbbf24, #6366f1, #38bdf8); 
    background-size: 300% auto; 
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent; 
    animation: rainbow 5s linear infinite; 
}

.avatar-wrapper { 
    width: 140px; 
    height: 140px; 
    background: #000; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 0 80px rgba(56, 189, 248, 0.3); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
}

.avatar-content { 
    font-size: 6rem; 
    font-weight: 900; 
    color: #fff; 
}

.social-icons { 
    display: flex; 
    gap: 20px; 
    margin-top: 25px; 
}

.social-icons a { 
    color: var(--text-color); 
    font-size: 1.8rem; 
    transition: 0.3s; 
}

.social-icons a:hover {
    color: var(--accent-color);
}

/* --- 經歷卡片 --- */
.experience { padding-top: 10px; padding-bottom: 120px; }

.section-title-center { 
    text-align: center; 
    font-size: 2.2rem; 
    margin-bottom: 60px; 
    color: var(--title-color); 
}

.experience-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

.exp-card { 
    display: block; 
    background: var(--card-bg); 
    border: 1px solid var(--card-border); 
    border-radius: 20px; 
    padding: 30px; 
    position: relative; 
    overflow: hidden; 
    transition: 0.4s ease;
    color: inherit; 
}

[data-theme="light"] .exp-card {
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hover-arrow {
    position: absolute; 
    top: 15px; 
    right: 15px;
    font-size: 1rem; 
    color: var(--accent-color);
    opacity: 0; 
    transform: translate(-10px, 10px);
    transition: 0.3s ease;
}

.exp-card:hover { 
    border-color: var(--accent-color); 
    transform: translateY(-8px); 
    background: rgba(56, 189, 248, 0.05); 
}

.exp-card:hover .hover-arrow { opacity: 1; transform: translate(0, 0); }

.card-header { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 20px; 
    opacity: 0.8; 
}

.main-icon { font-size: 2rem; color: var(--accent-color); }
.text-group h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--title-color); }
.text-group p { font-size: 0.9rem; color: var(--sub-text); }

/* --- 關於我 --- */
/* --- 關於我 --- */
.about-section { 
    padding: 150px 0; 
    background: rgba(0,0,0,0.05); 
}

.about-layout { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    gap: 60px; 
    align-items: center; 
}

/* 這裡是關鍵修改處 */
.about-title-group { 
    position: relative; 
    margin-bottom: 80px; /* 從原本的 40px 增加到 80px，拉開標題與方框的距離 */
}

.bg-text { 
    font-size: 5rem; 
    font-weight: 900; 
    opacity: 0.05; 
    position: absolute; 
    top: -40px; 
    left: 0; 
    color: var(--text-color);
}

.main-title { 
    font-size: 2.5rem; 
    position: relative; 
    z-index: 1; 
    color: var(--title-color); 
}

.info-cards { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.info-card { 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: 15px; 
    border: 1px solid var(--card-border); 
}

.info-card i { color: #4ade80; font-size: 1.2rem; margin-bottom: 10px; }

/* --- 技術棧 --- */
.tech-stack-section { padding: 100px 0; }

.slider { 
    overflow: hidden; 
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); 
}

.slide-track { 
    display: flex; 
    width: calc(240px * 10); 
    animation: scroll-loop 20s linear infinite; 
}

.slide { width: 240px; padding: 10px; }

.tag-capsule { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 25px; 
    border-radius: 50px; 
    background: var(--card-bg); 
    border: 1px solid var(--card-border); 
    transition: 0.3s; 
}

.t-js { border-left: 4px solid #f7df1e; }
.t-aws { border-left: 4px solid #ff9900; }
.t-wp { border-left: 4px solid #21759b; }
.t-figma { border-left: 4px solid #f24e1e; }
.t-git { border-left: 4px solid #f1502f; }

@keyframes scroll-loop { 
    from { transform: translateX(0); } 
    to { transform: translateX(calc(-240px * 5)); } 
}
footer { 
    text-align: center; 
    padding: 60px 0; 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    opacity: 0.6; 
}

/* --- RWD --- */
@media (max-width: 992px) {
    .hero-layout { flex-direction: column-reverse; text-align: center; align-items: center; gap: 30px; }
    .hero h1 { font-size: 2.5rem; }
    .hero-image { justify-content: center; }
    .about-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .navbar .container { padding: 0 15px; }
    .logo { font-size: 1.1rem; }
}
       /* 詳情頁專屬額外樣式 */
        .detail-container { padding: 120px 20px 60px; max-width: 800px; margin: 0 auto; }
        
        .back-btn { 
            display: inline-flex; 
            align-items: center; 
            gap: 8px; 
            color: var(--accent-color); 
            text-decoration: none; 
            margin-bottom: 30px; 
            font-weight: bold; 
            transition: 0.3s; 
        }
        .back-btn:hover { transform: translateX(-5px); }

        .detail-header { margin-bottom: 40px; }
        .detail-header h1 { font-size: 2.5rem; margin-bottom: 15px; color: var(--title-color); }
        
        .tag { 
            display: inline-block; 
            padding: 5px 15px; 
            background: rgba(56, 189, 248, 0.1); 
            border: 1px solid var(--accent-color); 
            border-radius: 20px; 
            color: var(--accent-color); 
            font-size: 0.9rem; 
            margin-bottom: 20px; 
        }

        .detail-content { 
            background: var(--card-bg); 
            padding: 40px; 
            border-radius: 20px; 
            border: 1px solid var(--card-border); 
            line-height: 1.8; 
            color: var(--text-color);
        }

        .detail-content h2 { 
            color: var(--accent-color); 
            margin: 30px 0 15px; 
            font-size: 1.5rem; 
            border-left: 4px solid var(--accent-color); 
            padding-left: 15px; 
        }

        /* 影片容器優化 */
        .video-container {
            margin: 25px 0;
            width: 100%;
            border-radius: 15px;
            overflow: hidden;
            background: #000;
            border: 1px solid var(--card-border);
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }

        .video-container video, 
        .video-container iframe {
            width: 100%;
            display: block;
            aspect-ratio: 16 / 9;
        }

        .video-caption {
            text-align: center;
            font-size: 0.9rem;
            color: var(--sub-text);
            margin-bottom: 30px;
        }

        .detail-image { 
            display: block; 
            margin: 30px auto 0; 
            width: 100%; 
            max-width: 500px;
            height: auto; 
            border-radius: 10px; 
            border: 1px solid var(--card-border); 
        }

        ul.detail-list { padding-left: 20px; color: var(--sub-text); }
        ul.detail-list li { margin-bottom: 10px; }

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