/* =========================================
   全域變數與基礎設定 (Realistic Milky Way Theme)
========================================= */
:root { 
    /* 嚴格以純黑色作為最深色基底 */
    --primary-bg: #000000; 
    --text-main: #e0e0e0; 
    --text-gold: #d4af37; 
    --sidebar-start: rgba(6, 26, 64, 0.85); 
    --sidebar-end: rgba(0, 51, 102, 0.95); 
    --sidebar-border: #1e4d7b; 
    --accent-gold: #c5a059; 
    --accent-gold-bright: #ffd700; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Noto Sans TC', sans-serif; 
    background-color: var(--primary-bg); 
    color: var(--text-main); 
    overflow-x: hidden; 
    line-height: 1.6; 
    min-height: 100vh;
}

/* =========================================
   極致真實化銀河背景 (Realistic Milky Way Background)
========================================= */
.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--primary-bg);
    overflow: hidden;
}

/* 1. 最深層宇宙：四周與底部為絕對純黑，僅在視角中心帶有極淡的微光漸層 */
.aurora-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 35% 25%, #061124 0%, #000000 55%);
    z-index: -3;
}

/* 2. 核心真實化斜向銀河帶：加強暗星雲（塵埃帶）與亮星雲的真實對比 */
.aurora-container::after {
    content: '';
    position: absolute;
    width: 260vw;
    height: 260vh;
    top: -80%;
    left: -80%;
    /* 仿照真實銀河相片：兩側為純黑與暗塵埃帶，中央過渡為紫紅、暖粉與白熱核心 */
    background: linear-gradient(
        125deg, 
        transparent 32%, 
        rgba(0, 0, 0, 0.95) 38%,   /* 真實的暗星雲塵埃帶（極黑） */
        rgba(40, 15, 55, 0.6) 43%,  
        rgba(130, 50, 90, 0.75) 47%, 
        rgba(255, 220, 190, 0.9) 50%, /* 銀河白熱核心 */
        rgba(180, 80, 90, 0.75) 53%, 
        rgba(50, 20, 45, 0.6) 57%, 
        rgba(0, 0, 0, 0.95) 62%,   /* 另一側的暗星雲塵埃帶（極黑） */
        transparent 68%
    );
    filter: blur(35px); /* 降低模糊度讓星雲邊緣與塵埃帶更具真實質感 */
    animation: flowMilkyWay 45s ease-in-out infinite alternate;
    mix-blend-mode: screen;
    z-index: -2;
}

/* 3. 星雲氣體光暈 1 (增添立體深景) */
.aurora-glow {
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: -30%;
    left: -20%;
    background: radial-gradient(ellipse at 40% 40%, rgba(15, 35, 80, 0.5) 0%, transparent 60%);
    filter: blur(65px);
    opacity: 0.85;
    animation: flowNebula 35s ease-in-out infinite alternate;
    transform-origin: center;
    mix-blend-mode: screen;
}

/* 4. 星雲氣體光暈 2 (右下方暖色氣體交錯) */
.aurora-glow:nth-child(2) {
    top: 15%;
    left: 15%;
    width: 160vw;
    height: 120vh;
    background:
        radial-gradient(ellipse at 65% 65%, rgba(120, 40, 80, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(180, 100, 60, 0.2) 0%, transparent 50%);
    filter: blur(75px);
    opacity: 0.8;
    animation: flowNebulaReverse 40s ease-in-out infinite alternate-reverse;
}

/* =========================================
   金色大小錯落、忽明忽暗閃爍星空 (Golden Starlight)
========================================= */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    background: radial-gradient(circle, #fffdf0 0%, #ffd700 50%, #c5a059 80%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.9), 0 0 12px rgba(197, 160, 89, 0.5);
    animation: goldenTwinkle cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* =========================================
   背景動畫 Keyframes
========================================= */
@keyframes flowMilkyWay {
    0% { transform: rotate(0deg) translate(-1.5%, -1.5%) scale(1); opacity: 0.8; }
    50% { transform: rotate(1.5deg) translate(1.5%, 2%) scale(1.03); opacity: 1; }
    100% { transform: rotate(-1deg) translate(2%, -1%) scale(1.06); opacity: 0.85; }
}

@keyframes flowNebula {
    0% { transform: scale(1) translate(0, 0) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.08) translate(3%, -2%) rotate(1.5deg); opacity: 0.95; }
    100% { transform: scale(0.95) translate(-2%, 2%) rotate(-1deg); opacity: 0.6; }
}

@keyframes flowNebulaReverse {
    0% { transform: scale(1.08) translate(0, 0) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(0.92) translate(-3%, 3%) rotate(-1.5deg); opacity: 0.9; }
    100% { transform: scale(1.1) translate(2%, -2%) rotate(1deg); opacity: 0.7; }
}

@keyframes goldenTwinkle {
    0% { 
        opacity: 0.05; 
        transform: scale(0.4); 
        box-shadow: 0 0 1px rgba(255, 215, 0, 0.1);
    }
    100% { 
        opacity: 1; 
        transform: scale(1.3); 
        box-shadow: 0 0 8px rgba(255, 215, 0, 1), 0 0 16px rgba(197, 160, 89, 0.8);
    }
}

/* =========================================
   側邊欄與導航 (Sidebar)
========================================= */
.sidebar { 
    position: fixed; left: 0; top: 0; width: 90px; height: 100vh; 
    background: linear-gradient(135deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%); 
    border-right: 1px solid var(--sidebar-border); 
    box-shadow: inset 1px 0 2px rgba(255, 255, 255, 0.1), 5px 0 15px rgba(0,0,0,0.6); 
    display: flex; flex-direction: column; align-items: center; padding-top: 1.5rem; 
    z-index: 1000; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow: visible; backdrop-filter: blur(10px);
}
.sidebar.expanded, .sidebar:hover { width: 260px; }
.sidebar-toggle { position: absolute; top: 50%; right: -24px; width: 24px; height: 60px; background: linear-gradient(135deg, var(--accent-gold) 0%, #ffd700 100%); border-radius: 0 30px 30px 0; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 4px 0 8px rgba(0,0,0,0.4); color: #000; font-size: 1.2rem; transform: translateY(-50%); z-index: 1001; transition: 0.3s; }
.sidebar-toggle:hover { right: -28px; width: 28px; }
.sidebar-toggle i { transition: transform 0.4s ease; }
.sidebar.expanded .sidebar-toggle i, .sidebar:hover .sidebar-toggle i { transform: rotate(180deg); }
.logo-container { display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem; width: 100%; transition: 0.3s; cursor: pointer; }
.logo-img { width: 50px; border-radius: 50%; box-shadow: 0 0 10px rgba(197, 160, 89, 0.5); transition: 0.4s; }
.sidebar.expanded .logo-img, .sidebar:hover .logo-img { width: 80px; }
.company-name { font-family: 'Orbitron', sans-serif; font-size: 0; color: var(--accent-gold); text-align: center; margin-top: 1rem; opacity: 0; transition: 0.4s; white-space: nowrap; font-weight: 700; }
.sidebar.expanded .company-name, .sidebar:hover .company-name { font-size: 0.9rem; opacity: 1; white-space: normal; }
.nav-menu { list-style: none; width: 100%; margin-top: 1rem; overflow: hidden; flex-grow: 1; }
.nav-link { display: flex; align-items: center; padding: 1rem 0; color: #a0c0e0; text-decoration: none; transition: 0.3s; padding-left: 32px; position: relative; border-left: 3px solid transparent; }
.sidebar.expanded .nav-link, .sidebar:hover .nav-link { padding-left: 25px; }
.nav-link i { font-size: 1.3rem; min-width: 30px; text-align: center; color: #ffffff; text-shadow: 0 0 5px rgba(0, 168, 255, 0.5); }
.link-text { display: none; margin-left: 15px; font-size: 1rem; white-space: nowrap; color: #fff; opacity: 0; transition: opacity 0.4s; }
.sidebar.expanded .link-text, .sidebar:hover .link-text { display: block; opacity: 1; }
.nav-link:hover { background: linear-gradient(90deg, rgba(0, 51, 102, 0.5), transparent); border-left: 3px solid var(--accent-gold); }
.nav-link:hover i, .nav-link:hover .link-text { color: var(--accent-gold-bright); text-shadow: 0 0 8px var(--accent-gold); }
.lang-switcher { margin-top: auto; margin-bottom: 2rem; width: 100%; display: flex; align-items: center; padding-left: 32px; transition: 0.3s; cursor: pointer; position: relative; }
.sidebar.expanded .lang-switcher, .sidebar:hover .lang-switcher { padding-left: 25px; }
.lang-switcher i { font-size: 1.5rem; min-width: 30px; text-align: center; color: var(--accent-gold); }
.lang-select { display: none; margin-left: 10px; background: rgba(0,0,0,0.5); border: 1px solid var(--accent-gold); color: #fff; padding: 5px 10px; border-radius: 50px; font-family: inherit; font-size: 0.9rem; cursor: pointer; outline: none; }
.sidebar.expanded .lang-select, .sidebar:hover .lang-select { display: block; }
.lang-select option { background: var(--sidebar-end); color: #fff; }

/* 頁尾與波浪 (Footer) */
.info-footer { position: relative; width: 100%; margin-top: 5rem; padding: 1.5rem 2rem 0.5rem; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); display: flex; flex-direction: column; align-items: center; text-align: center; border-top: 1px solid rgba(255,255,255,0.05); }
.info-footer::before { content: ''; position: absolute; top: -20px; left: 0; width: 200%; height: 20px; background-repeat: repeat-x; background-size: 50% 100%; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V120H0Z' opacity='.6' fill='rgba(130,50,90,0.2)'/%3E%3C/svg%3E"); animation: moveWaveTop 10s linear infinite; }
.info-footer::after { content: ''; position: absolute; top: -25px; left: 0; width: 200%; height: 25px; background-repeat: repeat-x; background-size: 50% 100%; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V120H0Z' fill='rgba(40,15,55,0.3)'/%3E%3C/svg%3E"); animation: moveWaveTop 7s linear infinite reverse; }
@keyframes moveWaveTop { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.footer-content { position: relative; z-index: 10; width: 100%; }
.footer-company { font-size: 1.6rem; font-weight: 900; margin-bottom: 0.5rem; background: linear-gradient(45deg, #b8860b, #ffd700, #daa520); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.8)); letter-spacing: 1px; }
.footer-details { color: #a0c0e0; font-size: 1rem; font-weight: 400; line-height: 1.5; margin-bottom: 0.8rem; }
.footer-line { width: 80%; max-width: 500px; height: 1px; background: rgba(255, 255, 255, 0.1); border: none; margin: 0 auto 0.5rem auto; }
.footer-copy { color: #666; font-size: 0.85rem; font-weight: 400; font-family: 'Orbitron', sans-serif; }