@import url('https://fonts.googleapis.com/earlyaccess/cwtexyen.css');

body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'cwTeXYen', 'Microsoft JhengHei', sans-serif;
    font-weight: 800;
    background-color: #0b0d17;
    color: white;
}

/* --- 0. 銀河背景層 --- */
.galaxy-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; 
    background-image: url('../img/bg-galaxy.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; 
    opacity: 0.4;
    pointer-events: none; 
}

/* --- 1. 中央標題區塊 --- */
.main-title-container {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    text-align: center;
    pointer-events: none;
    width: 100%; 
}

.main-logo {
    width: 350px; 
    height: auto;
    margin-bottom: 20px;
}

.sub-title {
    font-size: 2.25rem; 
    font-weight: 800;    
    letter-spacing: 8px; 
    color: #ffffff;
    opacity: 0; 
    text-shadow: none;
    position: relative;
    top: -30px;
}

/* --- Logo 與環繞軌道 --- */
.logo-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.main-logo {
    width: 350px; 
    height: auto;
    position: relative;
    z-index: 2; /* 確保 logo 蓋在軌道上方 */
    margin-bottom: 0; 
}

/* 1px 閃爍軌跡 */
.logo-orbit-track {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 440px; /* 軌道比 Logo 大一圈 */
    height: 440px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 1;
    pointer-events: none;
    animation: blink-orbit 2.5s ease-in-out infinite alternate;
}

/* 旋轉容器 */
.logo-orbit-dot-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 440px;
    height: 440px;
    z-index: 1;
    pointer-events: none;
    /* 10秒轉一圈 */
    animation: spin-orbit-dot 10s linear infinite;
}

/* 移動的小光點 */
.logo-orbit-dot {
    position: absolute;
    top: -3px; /* 置中貼齊 1px 的邊框 */
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffffff, 0 0 20px #00ffff; /* 帶有一點青藍色光暈 */
}

/* 閃爍動畫 */
@keyframes blink-orbit {
    0% { opacity: 0.1; box-shadow: 0 0 0 rgba(255,255,255,0); }
    100% { opacity: 0.7; box-shadow: 0 0 15px rgba(255,255,255,0.1) inset, 0 0 15px rgba(255,255,255,0.1); }
}

/* 旋轉動畫 */
@keyframes spin-orbit-dot {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 軌道樞紐 */
.orbit-pivot {
    position: absolute;
    top: 40%; 
    left: 50%;
    width: 0; height: 0; 
    z-index: 45; 
    pointer-events: none;
}

/* 偵查艦 */
.scout-ship {
    position: absolute;
    top: 0; left: 0;
    width: 40px; 
    height: 40px;
    background-image: url('../img/spaceship-02.svg');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    transform: translate(-50%, -50%) translateY(-220px) rotate(180deg);
    opacity: 0; 
    filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.8)); 
}

/* --- 2. 底部區塊 --- */
.bottom-panel {
    position: fixed;
    bottom: 0; 
    left: 0;
    width: 100%; height: 30%; 
    margin-bottom: 40px;
    z-index: 1000;
    background: transparent; 
    backdrop-filter: none;
    border: none;
    display: flex; justify-content: center; align-items: center;
    transform: translateY(150%);
    overflow: hidden; 
}

.console-book {
    position: absolute;
    bottom: -5%; 
    left: 50%;
    transform: translateX(-50%);
    width: 75%; 
    height: auto;
    z-index: 1; 
    opacity: 0.8; 
    pointer-events: none; 
}

/* --- 3. 行星容器與元素 --- */
.universe-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 80%; 
    z-index: 10;
    pointer-events: none; 
}

.planet-container {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: auto; 
    opacity: 0;
    transform: translateY(100vh); 
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    transition: filter 0.3s;
}

.planet-visual {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    background-color: transparent; 
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain; 
    transform-origin: center center;
    z-index: 1; 
}

.planet-container:hover {
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.6));
    z-index: 60;
}

/* 文字標籤 */
.planet-label {
    position: relative;
    z-index: 2; 
    color: #ffffff;
    font-size: 1.5rem; 
    font-weight: 800; 
    letter-spacing: 2px;
    white-space: normal; 
    text-align: center;
    line-height: 1.1; 
    text-shadow: 0 2px 8px rgba(0,0,0,1), 0 0 15px rgba(0,0,0,0.8); 
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
}

.label-en {
    display: block; 
    font-size: 0.7rem; 
    font-weight: 800; 
    letter-spacing: 1px;
    text-transform: uppercase; 
    opacity: 0.9;
    margin-top: 5px; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.p1 { width: 150px; height: 150px; }
.p2 { width: 240px; height: 240px; }
.p3 { width: 190px; height: 190px; }
.p4 { width: 300px; height: 300px; }

.p1 .planet-visual { background-image: url('../img/planet-01.gif'); }
.p2 .planet-visual { background-image: url('../img/planet-02.gif'); }
.p3 .planet-visual { background-image: url('../img/planet-03.gif'); }
.p4 .planet-visual { background-image: url('../img/planet-04.gif'); }

.planet-visual[style*="url"] { background-color: transparent; }

/* --- 4. 太空船 --- */
.spaceship {
    position: fixed;
    top: 50%; left: -300px; 
    height: auto; 
    aspect-ratio: 2/1;
    z-index: 200; 
    cursor: pointer;
    pointer-events: auto; 
    background-image: url('../img/spaceship-01.svg');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.9));
    transition: filter 0.3s;
}

.spaceship:hover {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
}

/* --- 5. 太空船 Modal --- */
.spaceship-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 500px; max-width: 90%;
    background-color: #8b0000; 
    color: white;
    padding: 30px;
    border-radius: 15px;
    z-index: 3000; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 2px solid rgba(255,255,255,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spaceship-modal.active {
    opacity: 1; visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- 6. 流星與流星 Modal --- */
.meteor {
    position: fixed;
    top: -100px; left: -100px; 
    width: 180px; 
    height: 180px;
    z-index: 250; 
    cursor: pointer;
    pointer-events: auto;
    background-image: url('../img/meteor-01.svg');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

.meteor-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 400px; max-width: 85%;
    background-color: #ffc107; 
    color: #333; 
    padding: 30px;
    border-radius: 20px;
    z-index: 3100; 
    box-shadow: 0 0 50px rgba(255, 193, 7, 0.6);
    border: 2px solid #fff; 
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.meteor-modal.active {
    opacity: 1; visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.meteor-btn {
    background-color: #d32f2f;
    color: white;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px;
    border: none;
    transition: transform 0.2s;
}
.meteor-btn:hover {
    transform: scale(1.05);
    background-color: #b71c1c;
    color: white;
}

.modal-close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.spaceship-modal .modal-close-btn { color: rgba(255,255,255,0.7); }
.spaceship-modal .modal-close-btn:hover { color: white; }
.meteor-modal .modal-close-btn { color: rgba(0,0,0,0.5); }
.meteor-modal .modal-close-btn:hover { color: black; }


/* --- 7. Sections 內容區塊 --- */
.sections-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 500; 
    pointer-events: none;
    visibility: hidden;
    
    /* 【修改 1】PC 端左右 padding 改為 0，實現滿版 */
    padding: 0;
    box-sizing: border-box; 
    
    display: grid;
    place-items: stretch;
}

.section-content {
    grid-area: 1 / 1; 
    position: relative; 
    
    width: 100%; height: 100%; 
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* --- 區塊背景設定 --- */
#sec-1, #sec-2, #sec-3, #sec-4 { 
    background-color: #333; /* 淺灰色底 */
}

/* --- Content 區塊微調 --- */
.section-content .content {
    margin-bottom: 1rem;
    padding: 2rem;
    background-color: #ffffff; /* 如果希望內容框有個白底可以保留這行，不需要的話可刪除 */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    min-width: 300px;
}

/* --- MORE 按鈕樣式 --- */
.more-btn {
    padding: 10px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    background-color: #333333;
    color: #ffffff;
    border: 2px solid #333333;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.more-btn:hover {
    background-color: transparent;
    color: #333333;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.section-content.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 501;
}

/* --- 8. 返回按鈕 --- */
.back-btn {
    position: fixed;
    top: 30px; right: 30px;
    z-index: 2000; 
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    cursor: pointer;
    opacity: 0; visibility: hidden;
}

/* --- Footer --- */
.copyright-footer {
    position: fixed;
    bottom: 0; 
    left: 0;
    width: 100%;
    height: 40px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0; 
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 4000;
    pointer-events: none;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* 美化或隱藏區塊內的滾動條 */
.overflow-auto::-webkit-scrollbar {
    width: 6px;
}
.overflow-auto::-webkit-scrollbar-track {
    background: transparent;
}
.overflow-auto::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}


/* --- 推薦人索引標籤區塊 --- */
.index-tags-wrapper {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.index-tags-grid {
    display: grid;
    /* 電腦版：每排 8 個 */
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    /* 初始高度：大約兩排按鈕的高度 (約 80px) + gap */
    max-height: 85px; 
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

/* 展開狀態：給一個足夠大的 max-height 讓它順暢滑出 */
.index-tags-grid.expanded {
    max-height: 1000px; 
}

/* 確保標籤文字過長時會變成 ... 而不會破版 */
.index-tag-btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    padding: 8px 5px;
}

/* 展開/收起 箭頭按鈕 */
.toggle-index-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
    cursor: pointer;
    transition: color 0.3s;
}
.toggle-index-btn:hover {
    color: #000;
}

/* 平滑滾動 (讓點擊標籤時，畫面平滑滑動到卡片) */
html {
    scroll-behavior: smooth;
}

/* RWD 調整：小螢幕時減少每排數量 */
@media (max-width: 992px) {
    .index-tags-grid { grid-template-columns: repeat(4, 1fr); max-height: 85px; }
}
@media (max-width: 576px) {
    .index-tags-grid { grid-template-columns: repeat(2, 1fr); max-height: 85px; }
}

/* --- RWD 調整 --- */
@media (max-width: 768px) {
    .p1 { width: 100px; height: 100px; }
    .p2 { width: 150px; height: 150px; }
    .p3 { width: 130px; height: 130px; }
    .p4 { width: 180px; height: 180px; }
    
    .main-logo { width: 220px; }
    .main-title-container { top: 35%; }
    .sub-title { font-size: 1.5rem; letter-spacing: 3px; }

    .spaceship-modal { width: 90%; }
    .console-book { width: 120%; }
    
    .planet-label { font-size: 1.1rem; }
    .label-en { font-size: 0.6rem; }
    
    .meteor { width: 120px; height: 120px; }

    .orbit-pivot { top: 35%; }
    .scout-ship {
        transform: translate(-50%, -50%) translateY(-160px) rotate(180deg);
        width: 30px; height: 30px;
    }
    .logo-orbit-track, .logo-orbit-dot-wrapper {
        width: 280px;
        height: 280px;
    }
	
    .copyright-footer { font-size: 0.6rem; padding: 0 10px; }

    /* 【修改 2】RWD 手機版：同樣改為 0 */
    .sections-wrapper {
        padding: 0;
    }
}