/* --- 全局與字體設定 --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;700&family=Orbitron:wght@400;700&display=swap');

:root {
    /* 顏色來自你的 System Design PDF */
    --primary-blue: #1A345E;
    --peaceful-green: #00C67A;
    --accent-blue: #547EA3;
    --light-blue: #E2F4FA;
    --oceanic-teal: #4F9DAC;
    --accent-gold: #FCB336;
    --mystic-purple: #9200C6;
    --text-light: #f0f8ff;
    --text-dark: #1A345E;

    /* 字體 */
    --font-title: 'Orbitron', 'Noto Sans TC', sans-serif;
    --font-body: 'Noto Sans TC', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--primary-blue);
    color: var(--text-light);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 語言切換器樣式 --- */
.lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    background-color: rgba(26, 52, 94, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 5px;
    display: flex;
    border: 1px solid var(--accent-blue);
}

.lang-btn {
    background-color: transparent;
    border: none;
    color: var(--light-blue);
    padding: 8px 15px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 14px;
    border-radius: 15px;
    transition: background-color 0.3s, color 0.3s;
}

.lang-btn.active {
    background-color: var(--accent-gold);
    color: var(--primary-blue);
    font-weight: 700;
}

/* --- 3D 背景畫布 --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    outline: none;
}

/* --- 滾動提示 --- */
.scroll-down-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 1.5px;
    opacity: 0;
    transition: opacity 0.5s;
}

.scroll-down-indicator::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: white;
    margin: 8px auto 0;
    animation: scroll-flicker 2s infinite;
}

@keyframes scroll-flicker {
    0%, 100% { height: 40px; opacity: 1; }
    50% { height: 20px; opacity: 0.5; }
}

/* --- 旅程主容器 --- */
#journey-container {
    position: relative;
    z-index: 1;
}

/* --- 章節通用樣式 --- */
.chapter {
    min-height: 100vh;
    width: 100vw;
    padding: 10vh 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    opacity: 0; /* 由JS控制顯示 */
}

.chapter-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 1rem;
}

/* --- 各章節標題顏色 --- */
.terra-title, .about-title {
     color: #E2F4FA;
     text-shadow: 0 0 15px var(--accent-blue);
}
.cybennah-title {
    color: var(--accent-gold);
    text-shadow: 0 0 15px var(--accent-gold);
}
.aquatica-title {
    color: var(--oceanic-teal);
    text-shadow: 0 0 15px var(--oceanic-teal);
}
.eclipsia-title {
    color: #9200C6; /* A much lighter, ethereal purple */
    text-shadow: 0 0 15px var(--mystic-purple);
}
.ekeres-title {
    color: var(--peaceful-green);
    text-shadow: 0 0 15px var(--peaceful-green);
}


.chapter-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--light-blue);
    margin-bottom: 5vh;
    letter-spacing: 2px;
}

.project-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
}

/* --- PDF 檢視器樣式 (桌面版) --- */
.pdf-viewer {
    position: relative;
    width: 100%;
    max-width: 960px; /* 設定最大寬度 */
    margin: 0 auto;
    /* 16:9 aspect ratio */
    padding-top: 56.25%; 
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid var(--accent-blue);
    background-color: #555; /* 背景色，防止 iframe 載入前空白 */
}

.pdf-viewer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- 行動版 PDF 連結樣式 --- */
.pdf-mobile-link {
    display: none; /* 預設隱藏，由 RWD 控制顯示 */
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--accent-blue);
    border-radius: 15px;
    background-color: rgba(26, 52, 94, 0.3);
    width: 100%;
    max-width: 400px;
}

.pdf-thumbnail {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    margin: 0 auto 1rem;
    display: block;
    border: 1px solid var(--accent-blue);
}

.pdf-mobile-link p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--light-blue);
}

.project-details {
    max-width: 600px;
}

.project-details h4 {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.project-details p {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* --- 序章 (Intro) --- */
#intro {
    height: 100vh;
    justify-content: center;
}

#intro-title {
    font-family: var(--font-title);
    /* 更新：調整 clamp() 函數，使字體在不同螢幕尺寸下更合適 */
    font-size: clamp(2.5rem, 8vw, 6rem); 
    color: var(--text-light);
    text-align: center;
    position: relative;
    /* 更新：微調 letter-spacing */
    letter-spacing: 2px; 
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px var(--accent-gold), 0 0 30px var(--accent-gold), 0 0 40px var(--accent-gold);
    line-height: 1.25; /* 更新：微調行高 */
    word-break: break-word; 
    padding: 0 1.5rem; /* 更新：增加 padding */
}

/* --- 關於 (About Section) --- */
#about {
    background: radial-gradient(circle, var(--accent-blue) 0%, var(--primary-blue) 70%);
}

.about-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
}

.about-main {
    display: flex;
    gap: 5rem;
    align-items: center;
    width: 100%;
}

.about-image-container {
    flex: 0 0 250px;
}

.about-image {
    width: 100%;
    border-radius: 50%;
    border: 5px solid var(--accent-gold);
    box-shadow: 0 0 25px rgba(252, 179, 54, 0.5);
}

.about-text {
    flex: 1;
    text-align: left;
}

.about-text h3 {
    font-family: var(--font-body);
    font-size: 1.5rem;
    color: var(--light-blue);
    margin-bottom: 1rem;
    font-weight: 700;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 700px;
}

.about-details {
    width: 100%;
    border-top: 1px solid var(--accent-blue);
    padding-top: 3rem;
}

.details-sub-row {
    display: flex;
    gap: 3rem;
    width: 100%;
}

.details-column {
    flex: 1;
}

.details-column h4 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-align: left;
}

.timeline {
    position: relative;
    padding-left: 25px;
    border-left: 2px solid var(--accent-blue);
    text-align: left;
}

.timeline-item {
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    border: 2px solid var(--primary-blue);
    box-shadow: 0 0 10px var(--accent-gold);
}

.timeline-item h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--light-blue);
}

.timeline-item p {
    font-size: 0.9rem;
    color: var(--light-blue);
    opacity: 0.8;
}

.timeline-item p strong {
    font-weight: normal;
    color: var(--light-blue);
    opacity: 1;
}

.skills-container {
    display: flex;
    gap: 3rem;
    text-align: left;
}

.skill-category {
    flex: 1;
}

.skill-category h6 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--light-blue);
}

.skill-category ul {
    list-style: none;
    padding: 0;
}

.skill-category ul li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 20px;
}

.skill-category ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-size: 14px;
}

#contact-info {
    margin-top: 2rem;
    border-top: 1px solid var(--accent-blue);
    padding-top: 2rem;
    width: 100%;
    max-width: 700px;
    text-align: center;
}

#contact-info a {
    color: var(--accent-gold);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.2rem;
    transition: text-shadow 0.3s;
}
#contact-info a:hover {
    text-shadow: 0 0 10px var(--accent-gold);
}

/* --- 新增：序言 (Prologue) --- */
#prologue {
    justify-content: center;
    text-align: center;
    background: transparent; /* 保持星空背景可見 */
}

.prologue-content {
    max-width: 800px;
    padding: 2.5rem;
    background-color: rgba(26, 52, 94, 0.3); /* 半透明背景，增加層次感 */
    backdrop-filter: blur(5px);
    border-radius: 20px;
    border: 1px solid var(--accent-blue);
}

.prologue-content h2 {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px var(--accent-gold);
}

.prologue-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 2;
    color: var(--light-blue);
}

/* --- 按鈕樣式 --- */
.cta-button {
    font-family: var(--font-body);
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none; /* 確保 a 標籤按鈕沒有底線 */
    display: inline-block; /* 讓 a 標籤有正確的 padding */
}

.cta-button:hover {
    background-color: var(--accent-gold);
    color: var(--primary-blue);
    box-shadow: 0 0 20px var(--accent-gold);
}

/* --- Persona 彈出視窗 --- */
.modal {
    display: none; /* JS will change this to 'flex' */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--light-blue);
    color: var(--text-dark);
    width: 100%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: slideIn 0.5s;
    display: flex;
    overflow: hidden;
    margin: auto;
}

.close-button {
    color: var(--accent-blue);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 10;
}

.close-button:hover {
    transform: scale(1.2);
}

.persona-left {
    background-color: var(--accent-blue);
    color: var(--text-light);
    padding: 40px;
    width: 35%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#persona-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--light-blue);
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#persona-name {
    font-family: var(--font-title);
    font-size: 1rem;
    line-height: 1.4;
}

.persona-right {
    width: 65%;
    padding: 30px 40px;
}

.persona-tabs {
    display: flex;
    border-bottom: 2px solid var(--accent-blue);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--accent-blue);
    position: relative;
    transition: color 0.3s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-blue);
    font-weight: 700;
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.persona-details-content {
    font-size: 1rem;
    line-height: 1.8;
    height: auto;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 15px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* [新增] Persona 列表樣式 */
.persona-details-content ul {
    list-style-position: outside;
    padding-left: 1.2rem; /* 增加列表內縮 */
    text-align: left;
}

.persona-details-content ul li {
    margin-bottom: 0.75rem; /* 增加列表項間距 */
}

.persona-details-content ul li:last-child {
    margin-bottom: 0;
}


/* 美化滾動條 */
.persona-details-content::-webkit-scrollbar {
  width: 8px;
}
.persona-details-content::-webkit-scrollbar-track {
  background: transparent; 
}
.persona-details-content::-webkit-scrollbar-thumb {
  background-color: var(--accent-blue);
  border-radius: 10px;
}


@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-50px);} to {transform: translateY(0);} }

/* --- 響應式設計 (RWD) --- */
@media (max-width: 992px) {
    .about-main, .details-sub-row {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    .about-text {
        text-align: center;
    }
    .details-column h4 {
        text-align: center;
    }
    .about-image-container {
        margin-bottom: 1rem;
        flex-basis: 200px;
        width: 200px;
    }
}


@media (max-width: 767px) {
    /* PDF 顯示切換 */
    .pdf-viewer {
        display: none;
    }
    .pdf-mobile-link {
        display: block;
    }

    /* 整體字體與排版調整 */
    .chapter {
        padding: 10vh 4vw;
    }
    .chapter-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    .chapter-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 4vh;
    }
    .project-details h4 {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }
    .project-details p {
        font-size: clamp(1.3rem, 5vw, 2rem);
        line-height: 1.7;
    }

    /* About Section RWD */
    .skills-container {
        flex-direction: column;
    }

    /* Persona 彈出視窗調整 */
    .modal-content {
        flex-direction: column;
        max-height: 85vh;
        overflow-y: auto;
    }
    .persona-left, .persona-right {
        width: 100%;
    }
    .persona-left {
        padding: 25px;
    }
    #persona-image {
        width: 120px;
        height: 120px;
    }
    #persona-name {
        font-size: 1.2rem;
    }
    .persona-right {
        padding: 25px 20px;
    }
    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    .persona-details-content {
        font-size: 0.9rem;
        line-height: 1.7;
        height: auto;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

/* 針對更小的手機螢幕 */
@media (max-width: 480px) {
    .lang-switcher {
        top: 15px;
        right: 15px;
    }
    .lang-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    #intro-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .persona-tabs {
        /* [移除] 不再需要 space-around，flex-wrap 會處理 */
    }
    .tab-btn {
        font-size: 0.8rem;
        padding: 8px;
    }
    .persona-details-content {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    #persona-name {
        font-size: 1.1rem;
    }
}
