/* --- CSS 變數與全局重置 --- */
:root, body[data-theme='default'] {
    --primary-color: #00f0ff;
    --dark-bg: #0c002b;
    --card-bg: #1a0537;
    --text-color: #e0e0e0;
    --text-muted: #999;
    --font-heading: 'Exo 2', 'Noto Sans TC', sans-serif;
    --font-body: 'Noto Sans TC', sans-serif;
    --font-logo-sub: 'Cinzel', serif;
    --transition-speed: 0.3s;
    --btn-cta-gradient: linear-gradient(45deg, #f000ff, var(--primary-color));
}

body[data-theme='cyberpunk'] {
    --primary-color: #ff8c00;
    --dark-bg: #0a0a0c;
    --card-bg: #141418;
    --btn-cta-gradient: linear-gradient(45deg, #e67e22, var(--primary-color));
}

body[data-theme='arcane'] {
    --primary-color: #9d4edd;
    --dark-bg: #191226;
    --card-bg: #2a213f;
    --btn-cta-gradient: linear-gradient(45deg, #ffd700, var(--primary-color));
}

body[data-theme='frozen'] {
    --primary-color: #00aaff;
    --dark-bg: #111d28;
    --card-bg: #1e293b;
    --btn-cta-gradient: linear-gradient(45deg, #ffffff, var(--primary-color));
}

body[data-theme='obsidian'] {
    --primary-color: #e63946;
    --dark-bg: #000000;
    --card-bg: #111111;
    --btn-cta-gradient: linear-gradient(45deg, #ffffff, var(--primary-color));
}


*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: #fff;
}

img {
    max-width: 100%;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- 通用按鈕樣式 --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
    cursor: pointer;
}
.btn-primary {
    background-color: var(--primary-color);
    color: #000;
}
.btn-primary:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
}
.btn-secondary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #000;
}
.btn-cta {
    font-size: 1.25rem;
    padding: 18px 50px;
    background: var(--btn-cta-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    color: #fff;
}


/* --- 頁首 Header (新版) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: block;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.logo-main {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--primary-color);
}
.logo-sub {
    display: block;
    font-family: var(--font-logo-sub);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFD700; /* 改為固定的金色 */
    margin-top: 0;
    max-width: 450px;
    line-height: 1.5;
    animation: notice-glow 3s ease-in-out infinite; /* 使用專屬的金色光暈 */
    text-align: center;
}
.main-nav {
    display: none; /* 預設隱藏，由 JS 控制 */
}
.main-nav[data-visible="true"] {
    display: block;
    position: absolute;
    top: 80px;
    right: 5%;
    background: rgba(12, 0, 43, 0.9);
    padding: 20px 30px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.main-nav a {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease;
}
.main-nav a:hover::after {
    width: 100%;
}
.header-actions {
    display: flex;
    gap: 15px;
}
.mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    width: 30px;
    height: 22px;
    position: relative;
    padding: 0;
}


/* --- 圖片輪播區塊 (新) --- */
.image-rotator {
    padding: 0;
    margin-top: 80px; /* Header 的高度 */
    width: 100%;
}
.hero-slider-bg {
    position: relative;
    width: 100%;
    max-width: 1600px; /* 可設定最大寬度 */
    margin: 0 auto;
    aspect-ratio: 16 / 7; /* 設定輪播的長寬比 */
    overflow: hidden;
    background-color: #000;
}

/* --- 簡介區塊 (原 Hero Section) --- */
.intro-section {
    padding: 60px 0;
    text-align: center;
}
.intro-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(0,0,0,0.7);
}
.intro-title span {
    color: var(--primary-color);
    display: block;
}
.intro-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    max-width: 600px;
    margin: 20px auto 40px;
    color: var(--text-color);
}


/* --- 通用區塊樣式 --- */
section {
    padding: 50px 0; /* 縮小上下間距 */
}
.section-title {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 60px;
    text-transform: uppercase;
}
.section-title span {
    display: inline-block;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--primary-color);
}
.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: -40px auto 40px auto;
}


/* --- 特色區塊 --- */
.features-section {
    background-color: var(--dark-bg);
    padding-top: 50px; /* 明確減少與上方間距 */
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}
.feature-card {
    background-color: var(--card-bg);
    padding: 40px 30px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all var(--transition-speed) ease;
}
.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(255, 140, 0, 0.1);
}
.feature-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}


/* --- 最新消息區塊 --- */
.news-section {
    background-color: #0F0F12;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}
.news-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.news-card-image {
    position: relative;
}
.news-card-image img {
    height: 220px;
    width: 100%;
    object-fit: cover;
}
.news-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: #000;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
}
.news-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.news-card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}
.news-card-content p {
    flex-grow: 1;
    margin-bottom: 20px;
}
.news-card-content time {
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* --- 下載區塊 --- */
.download-section {
    background: url(img/bg.jpg) no-repeat center center/cover;
    position: relative;
    text-align: center;
}
.download-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.85);
}
.download-section .container {
    position: relative;
}
.download-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}
.download-btn .btn-main-text {
    font-size: 1.5rem;
}
.download-btn .btn-sub-text {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 400;
    text-transform: none;
    opacity: 0.8;
}


/* --- 頁尾 Footer --- */
.site-footer {
    background-color: #08080a;
    padding: 40px 0;
    font-size: 1rem;
    color: var(--text-muted);
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.social-links {
    display: flex;
    gap: 20px;
}
.social-links a {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.2rem;
}


/* --- 動畫 --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes subtle-glow {
    0%, 100% {
        text-shadow: 0 0 4px var(--accent-color-medium), 0 0 8px var(--accent-color);
    }
    50% {
        text-shadow: 0 0 8px var(--accent-color-medium), 0 0 16px var(--accent-color);
    }
}

@keyframes notice-glow {
    0%, 100% {
        text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700;
    }
    50% {
        text-shadow: 0 0 10px #FFC300, 0 0 20px #FFC300;
    }
}


/* --- 響應式設計 --- */
@media (max-width: 992px) {
    .main-nav {
        display: none;
        position: fixed;
        inset: 0 0 0 30%;
        background: rgba(12, 13, 15, 0.95);
        backdrop-filter: blur(10px);
        padding: 120px 40px 40px;
        z-index: 999;
    }
    .main-nav[data-visible="true"] {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .header-actions {
        display: none;
    }
    .mobile-nav-toggle {
        display: block;
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        z-index: 1001;
        width: 30px;
        height: 22px;
        position: relative;
    }
    .mobile-nav-toggle .sr-only { display: none; }
    .mobile-nav-toggle::before,
    .mobile-nav-toggle::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 3px;
        background: #fff;
        left: 0;
        transition: transform 0.3s, top 0.3s;
    }
    .mobile-nav-toggle::before { top: 0; }
    .mobile-nav-toggle::after { bottom: 0; }

    .mobile-nav-toggle[aria-expanded="true"]::before {
        top: 9.5px;
        transform: rotate(45deg);
    }
    .mobile-nav-toggle[aria-expanded="true"]::after {
        top: 9.5px;
        transform: rotate(-45deg);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .logo-main {
        font-size: 1.8rem;
    }
    .logo-sub {
        font-size: 0.75rem;
        max-width: 90%;
        line-height: 1.4;
        animation: none; /* 手機上移除動畫以優化效能 */
    }

    .video-player-section {
        /* 強制定義容器為16:9的橫向比例 */
        position: static !important;
        width: 100% !important;
        height: auto !important; /* 高度由 aspect-ratio 自動計算 */
        aspect-ratio: 16 / 9 !important;
        margin-top: 80px !important; /* 確保在固定頁首下方 */
        overflow: hidden !important;
        background-color: #000 !important; /* 為可能的黑邊設定背景色 */
    }

    .video-player-section video {
        /* 讓影片完整填充這個16:9的容器 */
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important; /* 確保影片完整顯示，不裁切 */
        /* 重置所有可能干擾的樣式 */
        position: static !important;
        transform: none !important;
        z-index: 1 !important;
    }

    section {
        padding: 40px 0; /* 手機版間距再小一點 */
    }
    .intro-section {
        padding: 40px 0;
    }
    .features-section {
        padding-top: 40px;
    }
    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }

    /* --- Download Card --- */
    .download-card {
        flex-direction: column;
        text-align: center;
    }

    .download-card .download-button {
        /*
          【最終修正】
          為了解決部分手機瀏覽器的頑固渲染問題，
          這裡使用更具體的選擇器 (.download-card .download-button)，
          並重新完整定義所有樣式且加上 !important，
          以確保它擁有最高的優先權，強制正確顯示。
        */
        display: block !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 1.5rem !important;
        padding: 1.2rem 2rem !important;

        background-image: linear-gradient(45deg, #00ff7f, #32cd32) !important;
        color: #000 !important;

        font-family: var(--font-heading) !important;
        font-size: 1.1rem !important;
        font-weight: 900 !important;
        text-decoration: none !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
        text-align: center !important;
        line-height: 1.5 !important; /* 同樣增加行高 */

        border: none !important;
        border-radius: 50px !important;
        box-shadow: 0 8px 15px rgba(0,0,0,0.2) !important;
        transform: none !important; /* 重置任何可能的變形 */
        transition: none !important; /* 手機上移除動態效果以求穩定 */
    }
}

.intro-text .notice-text {
    display: inline-block !important;
    margin-top: 1rem !important;
    padding: 0.5rem 1rem !important;
    background: rgba(255, 215, 0, 0.1) !important;
    border: 1px solid #FFD700 !important;
    border-radius: 5px !important;
    color: #FFD700 !important;
    font-weight: 700 !important;
}


/* --- 影片播放區塊 (取代輪播) --- */
.video-player-section {
    padding: 0;
    width: 100%;
    height: 100vh; /* 讓影片區塊佔滿整個視窗高度 */
    background-color: #000;
    overflow: hidden;
    position: relative;
}

.video-player-section video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 電腦版安裝提示 */
.install-notice-section {
    background-color: #1a1a1a;
    border-bottom: 1px solid var(--primary-color);
    padding: 1rem 0;
    text-align: center;
    color: #fff;
}

.install-notice-section p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}


/* --- 主題切換器 --- */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1002;
}
.theme-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid #fff;
    padding: 0;
    cursor: pointer;
    background-color: var(--theme-color);
    transition: transform 0.2s;
}
.theme-btn:hover {
    transform: scale(1.2);
}
.theme-btn.active {
    transform: scale(1.3);
    box-shadow: 0 0 10px #fff;
}

.download-button {
    display: inline-block;
    background-image: linear-gradient(45deg, #00ff7f, #32cd32); /* 改為經典的下載綠漸層 */
    color: #000; /* 文字改為黑色以確保對比度 */
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 900;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    line-height: 1.5; /* 增加行高讓文字不擁擠 */
    transition: all 0.3s ease;
    text-align: center;
    flex-shrink: 0;
    margin-left: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), 0 6px 6px rgba(0,0,0,0.2);
    transform: translateY(0);
}

.download-button:hover {
    background-image: linear-gradient(45deg, #32cd32, #228b22); /* 懸停時變為更深的綠色 */
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.3), 0 10px 10px rgba(0,0,0,0.25);
}

.download-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    transition-duration: 0.1s;
}