*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --global-saturation: 100%;
}

html {
    filter: saturate(var(--global-saturation));
    transition: filter 0.25s ease;
}

/* =========================================
   全局動畫關鍵幀
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: #0a0a10;
    background-image:
        radial-gradient(ellipse 85% 65% at 12% -5%, rgba(0, 229, 255, 0.18), transparent 62%),
        radial-gradient(ellipse 75% 60% at 88% 8%, rgba(140, 92, 255, 0.16), transparent 60%),
        radial-gradient(ellipse 65% 55% at 98% 62%, rgba(255, 92, 180, 0.09), transparent 60%),
        radial-gradient(ellipse 95% 75% at 50% 105%, rgba(0, 229, 255, 0.11), transparent 65%),
        linear-gradient(160deg, #100f1e 0%, #07070b 40%, #0a0a17 75%, #0d0d1c 100%);
    background-attachment: fixed;
    color: #e2e2ec;
    font-family: 'Space Grotesk', 'Noto Sans TC', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    animation: fadeIn 0.8s ease-out;
}

header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(10, 10, 14, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 24px rgba(0, 0, 0, 0.25);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-controls {
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    background: linear-gradient(125deg, rgba(20, 22, 31, 0.78), rgba(35, 38, 51, 0.55));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(15px) saturate(170%);
    -webkit-backdrop-filter: blur(15px) saturate(170%);
}

.theme-toggle {
    border: 1px solid rgba(0, 229, 255, 0.38);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.08));
    color: #00e5ff;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    border-radius: 999px;
    padding: 0.38rem 0.86rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: rgba(0, 229, 255, 0.55);
    transform: translateY(-1px);
}

.saturation-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #c7c7d6;
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    font-family: 'Noto Sans TC', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

#saturation-range {
    width: 104px;
    accent-color: #00e5ff;
}

#saturation-range::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(0, 229, 255, 0.7));
}

#saturation-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-top: -5px;
    background: #ecfbff;
    border: 1px solid rgba(0, 229, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.22);
}

#saturation-range::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(0, 229, 255, 0.7));
}

#saturation-range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ecfbff;
    border: 1px solid rgba(0, 229, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.22);
}

#saturation-value {
    min-width: 42px;
    color: #8c8c9e;
    font-weight: 700;
    text-align: right;
}

.logo {
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 1rem;
    color: #fff;
}

.nav-links a {
    color: #8c8c9e;
    text-decoration: none;
    margin-left: 1.8rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.nav-links a:hover {
    color: #00e5ff;
}

main {
    position: relative;
    z-index: 1;
    padding: 14vh 5% 10vh 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-family: 'Space Grotesk', sans-serif;
    background-color: rgba(0, 229, 255, 0.1);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 100px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 2rem 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
    background: linear-gradient(180deg, #FFFFFF 0%, #8c8c9e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 10px 30px rgba(255, 255, 255, 0.08);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero p {
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    font-family: 'Noto Sans TC', sans-serif;
    color: #8c8c9e;
    max-width: 100%;
    line-height: 1.7;
    letter-spacing: 1px;
    font-weight: 400;
    margin: 0;
    text-align: justify;
    text-justify: inter-character;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 5rem 0 2rem 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    animation: slideInLeft 0.8s ease-out;
    scroll-margin-top: 100px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-left: 1.5rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

/* 確保卡片樣式正確且滑鼠會變成手指 */
.card {
    grid-column: span 6;
    background-color: #0f0f14;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
    cursor: pointer;
    animation: scaleIn 0.6s ease-out;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 8px; height: 8px;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    border-right: 2px solid rgba(255, 255, 255, 0.15);
    z-index: 3;
}

/* =========================================
   卡片圖片容器與濾鏡 (優化圖文比例)
   ========================================= */
.card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10; /* 一般卡片採用 16:10 黃金比例，增加圖片高度 */
    height: auto;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.03);
    opacity: 1;
}

/* 大主打卡片專屬比例 */
.featured-card .card-img-wrapper {
    aspect-ratio: 21 / 9; /* 電影級寬螢幕比例，讓浮生未央更具震撼力 */
    height: auto;
}

/* =========================================
   卡片文字區塊 (縮小黑色方塊面積)
   ========================================= */
.card-content {
    padding: 1.5rem 2rem; /* 將原本的 2.5rem 縮小，上下收緊，左右保留呼吸感 */
}

.featured-card h3 {
    font-size: 1.8rem;
    color: #00e5ff;
}

.card h3 {
    margin: 0 0 0.5rem 0; /* 縮小標題與內文的距離 */
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.card p {
    color: #8c8c9e;
    font-size: 0.95rem;
    line-height: 1.5; /* 稍微收緊文字行高 */
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制內文最多顯示兩行，超過變成省略號，確保黑色方塊不會被文字撐太高 */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 229, 255, 0.4);
    background-color: #13131c;
}

.featured-card {
    grid-column: span 12;
    background: linear-gradient(135deg, #0f0f14 0%, #151522 100%);
    border-color: rgba(0, 229, 255, 0.25);
    animation: scaleIn 0.6s ease-out;
}

.card-third {
    grid-column: span 4;
}

.card-third .card-img-wrapper {
    aspect-ratio: 1 / 1;
}

.card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 10px, rgba(255, 255, 255, 0.04) 10px, rgba(255, 255, 255, 0.04) 20px);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.placeholder-label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5a5a6e;
    font-family: 'Space Grotesk', sans-serif;
}

@media (max-width: 768px) {
    .card, .featured-card {
        grid-column: span 12;
    }

    #saturation-range {
        width: 98px;
    }

    .header-tools {
        gap: 0.7rem;
    }

    .nav-links a {
        margin-left: 1rem;
    }

    .view-controls {
        padding: 0.35rem 0.5rem;
        gap: 0.5rem;
    }

    .theme-toggle {
        padding: 0.34rem 0.7rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    header {
        align-items: flex-start;
        gap: 0.55rem;
        flex-direction: column;
    }

    .header-tools {
        width: 100%;
        flex-wrap: wrap;
        row-gap: 0.6rem;
        justify-content: space-between;
    }

    .nav-links {
        display: flex;
        align-items: center;
    }

    .nav-links a {
        margin-left: 0;
        margin-right: 0.9rem;
    }

    .view-controls {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .modal-content {
        width: 94%;
        height: 88vh;
    }

    .modal-body {
        padding: 3.75rem 1.25rem 1.75rem;
    }

    .modal-body h2 {
        font-size: 1.5rem;
        padding-bottom: 0.75rem;
    }

    .project-details p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .modal-body img {
        margin: 1.25rem 0;
    }

    .additional-images {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .additional-images-mask img:last-child {
        grid-column: span 1;
    }

    .project-instagram {
        padding: 0.75rem;
    }

    .close-btn {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }

    .nav-arrow {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .nav-arrow-prev {
        left: 0.5rem;
    }

    .nav-arrow-next {
        right: 0.5rem;
    }

    .project-section-label {
        margin: 2rem 0 1rem 0;
    }
}

html[data-theme="light"] body,
html[data-theme="light"] html {
    background-color: #f5f7fc;
    background-image:
        radial-gradient(ellipse 85% 65% at 12% -5%, rgba(0, 133, 224, 0.18), transparent 62%),
        radial-gradient(ellipse 75% 60% at 88% 8%, rgba(116, 112, 219, 0.14), transparent 60%),
        radial-gradient(ellipse 65% 55% at 98% 62%, rgba(255, 97, 149, 0.1), transparent 60%),
        linear-gradient(165deg, #f9fbff 0%, #edf2fb 45%, #eef3fd 100%);
    color: #1f2331;
}

html[data-theme="light"] header {
    background: rgba(245, 249, 255, 0.8);
    border-bottom: 1px solid rgba(30, 45, 76, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 24px rgba(44, 62, 102, 0.08);
}

html[data-theme="light"] .logo,
html[data-theme="light"] .section-title,
html[data-theme="light"] .card h3,
html[data-theme="light"] .modal-body h2 {
    color: #121a2a;
}

html[data-theme="light"] .hero h1 {
    background: linear-gradient(180deg, #0f1e3a 0%, #425273 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .nav-links a,
html[data-theme="light"] .card p,
html[data-theme="light"] .about-content p,
html[data-theme="light"] .contact-content p,
html[data-theme="light"] #saturation-value,
html[data-theme="light"] .project-details p,
html[data-theme="light"] .close-btn,
html[data-theme="light"] .nav-arrow {
    color: #586482;
}

html[data-theme="light"] .card {
    background-color: rgba(255, 255, 255, 0.75);
    border-color: rgba(37, 56, 91, 0.15);
}

html[data-theme="light"] .card:hover {
    border-color: rgba(0, 145, 229, 0.4);
    background-color: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .featured-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(235, 244, 255, 0.95) 100%);
    border-color: rgba(0, 145, 229, 0.3);
}

html[data-theme="light"] .skill-tag {
    background-color: rgba(17, 45, 92, 0.05);
    border-color: rgba(17, 45, 92, 0.16);
    color: #27324b;
}

html[data-theme="light"] .modal {
    background-color: rgba(232, 240, 251, 0.72);
}

html[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 145, 229, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 40px rgba(0, 145, 229, 0.12), 0 20px 55px rgba(37, 56, 91, 0.12);
}

html[data-theme="light"] .project-instagram {
    background: rgba(17, 45, 92, 0.04);
    border-color: rgba(17, 45, 92, 0.1);
}

html[data-theme="light"] .view-controls {
    background: linear-gradient(130deg, rgba(251, 253, 255, 0.86), rgba(231, 240, 255, 0.9));
    border-color: rgba(37, 56, 91, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 18px rgba(65, 86, 126, 0.14);
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 145, 229, 0.35);
    background: rgba(0, 145, 229, 0.12);
    color: #0f5b86;
}

/* =========================================
   About / Contact 區塊
   ========================================= */
.about-section,
.contact-section {
    margin: 6rem 0;
    animation: fadeInUp 0.8s ease-out;
}

.about-content p,
.contact-content p {
    font-size: 1.05rem;
    font-family: 'Noto Sans TC', sans-serif;
    color: #a1a1b5;
    line-height: 1.8;
    max-width: 100%;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: justify;
    text-justify: inter-character;
}

.skills-list,
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.skill-tag {
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    background-color: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 100px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #e2e2ec;
}

.contact-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #00e5ff;
    background-color: rgba(0, 229, 255, 0.06);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 100px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    background-color: rgba(0, 229, 255, 0.14);
}
/* =========================================
   Modal 滿版科技感視窗樣式
   ========================================= */
.modal {
    display: none; /* 預設隱藏 */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 7, 0.85); /* 深色毛玻璃遮罩 */
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: fadeIn 0.4s ease-out;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 40px rgba(0, 229, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    border-radius: 4px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

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

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #8c8c9e;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.close-btn:hover {
    color: #00e5ff;
}

/* 鍵盤操作時的焦點外框（滑鼠點擊不顯示）*/
.card:focus-visible,
.close-btn:focus-visible,
.nav-arrow:focus-visible,
.nav-links a:focus-visible,
.contact-link:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid #00e5ff;
    outline-offset: 3px;
    border-radius: 4px;
}

/* 導航箭頭按鈕樣式 */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #8c8c9e;
    font-size: 1.35rem;
    font-weight: 300;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    line-height: 1;
    padding: 0;
}

.nav-arrow:hover {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.4);
    transform: translateY(-50%) scale(1.08);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow.disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.nav-arrow-prev {
    left: 2rem;
}

.nav-arrow-next {
    right: 2rem;
}

@media (max-width: 900px) {
    .nav-arrow-prev {
        left: 0.75rem;
    }
    .nav-arrow-next {
        right: 0.75rem;
    }
}

.modal-body {
    padding: 4rem;
}

.modal-body h2 {
    font-size: 2.5rem;
    margin-top: 0;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.video-container {
    width: 100%;
    margin: 2rem 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.video-container iframe {
    display: block;
    border-radius: 4px;
}

.modal-body img {
    width: 100%;
    border-radius: 4px;
    margin: 2rem 0;
}

.project-details p {
    color: #a1a1b5;
    line-height: 1.8;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.project-link {
    margin-top: 1.5rem;
}

.project-section-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #00e5ff;
    margin: 3rem 0 1.25rem 0;
}

.project-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-left: 1.25rem;
}

.project-instagram {
    max-width: 100%;
    width: 100%;
    margin: 0 auto 2rem auto;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.project-instagram > * {
    width: 100% !important;
    max-width: 540px !important;
}

.project-instagram iframe {
    border-radius: 8px !important;
}

.additional-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.additional-images img {
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
}

/* MASK - 最後一張圖片放大全寬 */
.additional-images-mask img:last-child {
    grid-column: span 2;
    max-width: 100%;
}

/* =========================================
   圖片放大燈箱 (Lightbox) 樣式
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #00e5ff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    z-index: 10001;
}

.lightbox-close:hover {
    color: #fff;
}

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

/* =========================================
   Light Theme 對比修正 (最終覆蓋)
   ========================================= */
html[data-theme="light"] .tag {
    color: #046f9a;
    background-color: rgba(0, 145, 229, 0.14);
    border-color: rgba(0, 145, 229, 0.35);
}

html[data-theme="light"] .section-title::after,
html[data-theme="light"] .project-section-label::after {
    background: rgba(24, 45, 89, 0.18);
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .card p,
html[data-theme="light"] .about-content p,
html[data-theme="light"] .contact-content p,
html[data-theme="light"] .project-details p,
html[data-theme="light"] .saturation-control,
html[data-theme="light"] .saturation-control span,
html[data-theme="light"] #saturation-value,
html[data-theme="light"] .close-btn,
html[data-theme="light"] .nav-arrow,
html[data-theme="light"] .placeholder-label {
    color: #3f4c69;
}

html[data-theme="light"] .nav-links a {
    color: #4d5e83;
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .close-btn:hover,
html[data-theme="light"] .nav-arrow:hover {
    color: #0479b2;
}

html[data-theme="light"] .contact-link {
    color: #0f5b86;
    background-color: rgba(0, 145, 229, 0.09);
    border-color: rgba(0, 145, 229, 0.32);
}

html[data-theme="light"] .contact-link:hover {
    background-color: rgba(0, 145, 229, 0.16);
}

html[data-theme="light"] .modal-body h2 {
    color: #13203b;
    border-bottom-color: rgba(24, 45, 89, 0.2);
}