@charset "UTF-8";

/* 整理完成 */

:root {
    --blue: #007bff;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --red: #dc3545;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #28a745;
    --teal: #20c997;
    --cyan: #6493fa;
    --white: #ffffff;
    --black: #000000;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --primary: #9e6de0;
    --secondary: #fd5190;
    --success: #0acb8e;
    --info: #04c7e0;
    --warning: #fec400;
    --danger: #fe5461;
    --light: #f0f1f5;
    --dark: #131313;
    --info-dark: #6493fa;
    --smoke: #8a909d;

    --c-blue: #6493fa;
    --c-cyan: rgb(0, 217, 255);
    --c-cyan-35: rgba(0, 217, 255, .35);
    --blur-d: rgba(19, 19, 19, .55);
    --text-light: #e6f1ff;
    --tech-speed: 2.2s;

    /* 新增：滾輪色系 */
    --scrollbar-thumb: rgba(0, 217, 255, .6);
    --scrollbar-thumb-hover: rgba(100, 147, 250, .9);
    --scrollbar-track: rgba(255, 255, 255, .06);
}

/* ===============================
            基本樣式重置
   =============================== */

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

body {
    width: 100%;
    height: auto;
    overflow-x: hidden;
    z-index: -10;
    position: relative;
    background-color: var(--dark);
}

main {
    width: 100%;
    height: auto;
	min-height: calc(100vh - 60px);
    margin: auto;
    z-index: 0;
    color: var(--light);
    font-size: 20px;
    overflow: hidden;
}

section {
    position: relative;
    padding: 120px 5% 100px;  /* 原本的值 */
    width: 100%;
    height: fit-content;
    min-height: calc(100vh - 60px);
    max-width: 1920px;
    margin: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

@media (max-width: 991px) {
    section {
        padding-top: 100px;  /* 🔥 平板/手機版減少 */
    }
}

@media (max-width: 480px) {
    section {
        padding-top: 80px;  /* 🔥 小手機版再減少 */
    }
}

/* 全站超連結樣式 */
a {
	color: var(--c-cyan);
	text-decoration: none;
	transition: color .2s ease, text-decoration-color .2s ease;
}

a:hover {
	color: var(--white);
	text-decoration: none;
	text-underline-offset: 3px;
	text-decoration-color: var(--c-blue);
}

/* ===============================
            自訂滾輪
   =============================== */


html,
body {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    /* thumb track */
}

/* WebKit 系列（Chrome/Edge/Safari） */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
    border: 2px solid transparent;
    /* 與軌道留白 */
    background-clip: padding-box;
    box-shadow: 0 0 0 1px rgba(0, 217, 255, .25) inset;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* 修正捲動條角落顏色（例如有水平與垂直同時出現時） */
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* 註：macOS 以覆蓋式捲動條為主，顏色在「系統設定 > 外觀 > 顯示捲動條 > 總是」時最明顯 */


/* 手機版：隱藏滾輪外觀（仍可滾動） */
@media (pointer: coarse),
(max-width: 991px) {

    html,
    body,
    * {
        -ms-overflow-style: none;
        /* IE/Edge(舊) */
        scrollbar-width: none;
        /* Firefox */
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    *::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
        display: none !important;
        /* Safari/iOS */
        background: transparent !important;
    }
}

/* ===============================
            主題與顯示控制
   =============================== */

/* 主題宿主分層與顯示控制：只顯示被選中的主題 */
#theme-host {
    position: fixed;
    inset: 0;
    z-index: -1;
    /* 永遠在內容底層 */
    pointer-events: none;
    /* 背景不吃事件 */
    overflow: hidden;
}

#theme-host .theme {
    display: none;
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#theme-host[data-theme="bg-stars"] #bg-stars {
    display: block;
}

#theme-host[data-theme="bg-tech-clean"] #bg-tech-clean {
    display: block;
}

#theme-host[data-theme="bg-particles"] #bg-particles {
    display: block;
}

/* default：不顯示任何主題，由 body 原本背景生效 */
#theme-host[data-theme="default"] .theme {
    display: none;
}


/* ===============================
            footer
   =============================== */

footer {
    background: transparent;
    backdrop-filter: blur(5px) saturate(100%);
    border-top: 1px solid rgba(0, 217, 255, .28);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    transition: background .3s, border-color .3s, box-shadow .3s;
    color: var(--light);
    height: 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===============================
            Header
   =============================== */

/* Header：初始透明 → 滾動霧面 */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;  /* 🔥 固定高度 */
    min-height: unset;  /* 🔥 移除 min-height */
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background .3s, border-color .3s, box-shadow .3s, height .3s;
    z-index: 1000;
}

.main-header.scrolled {
    background: transparent;
    backdrop-filter: blur(5px) saturate(100%);
    border-bottom: 1px solid rgba(0, 217, 255, .28);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    height: 72px;  /* 🔥 滾動後稍微縮小 */
}

/* 科技藍動態底線 */
.main-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 217, 255, 0) 25%, rgba(0, 217, 255, .9) 50%, rgba(100, 147, 250, .8) 70%, transparent 90%) 0 0 / 220% 100% no-repeat;
    opacity: 0;
    transition: opacity .25s;
    animation: techline var(--tech-speed, 2.2s) linear infinite;
    animation-play-state: paused;
    pointer-events: none;
    z-index: 1;
}

.main-header.scrolled::after {
    opacity: .35;
}

.main-header.scrolling-down::after {
    opacity: 1;
    animation-play-state: running;
}

@keyframes techline {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

.main-header .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    padding: 0 20px;  /* 🔥 移除上下 padding，讓高度完全由 header 控制 */
    height: 100%;  /* 🔥 填滿父層 */
    max-width: 1920px;
    margin: auto;
}

.logo img {
    height: 48px;
    display: block;
    transition: height .3s;  /* 🔥 讓 logo 也能隨 header 縮放 */
}

.main-header.scrolled .logo img {
    height: 42px;  /* 🔥 滾動後稍微縮小 */
}

/* 漢堡按鈕 */
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
    display: block;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 桌機導覽 */
.header-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.header-menu .menu {
    position: relative;
    border-radius: 12px;
}

.header-menu .item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-light);
    border: 1px solid transparent;
    transition: background .2s, transform .2s, border-color .2s;
    cursor: pointer;
    position: relative;
    z-index: 1;
    font-size: 15px;
}

.header-menu .item:hover {
    background: rgba(255, 255, 255, .06);
    border-color: var(--c-cyan);
    transform: translateY(-1px);
}

/* 下拉選單：完全由 CSS 控制（置中對齊） */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 220px;
    background: rgba(10, 14, 24, .98);
    color: #f0f7ff;
    border: 1px solid var(--c-cyan);
    border-radius: 14px;
    overflow: hidden;
    opacity: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .5), 0 0 25px rgba(0, 217, 255, .3);
    transition: transform .2s, opacity .2s;
    z-index: 1600;
    pointer-events: none;
}

/* 桌機：hover 時顯示 */
@media (min-width: 992px) {
    .menu:hover>.dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }

    .menu:hover::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 8px;
        z-index: 1599;
    }
}

/* 行動版：JS 加 .open 時顯示 */
.menu.open>.dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #f0f7ff;
    text-decoration: none;
    text-align: center;
    font-size: 15px;
    transition: background .2s, transform .15s, color .2s;
    font-weight: 500;
    border: 0;
    width: 100%;
    background: none;
}

.dropdown-item:hover {
    background: rgba(100, 147, 250, .25);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 217, 255, .4);
}

/* RWD：行動版全螢幕置中選單 */
@media (max-width: 991px) {
    .main-header {
        height: 68px;  /* 🔥 平板/手機版縮小 */
    }

    .main-header.scrolled {
        height: 60px;  /* 🔥 滾動後更小 */
    }

    .logo img {
        height: 40px;
    }

    .main-header.scrolled .logo img {
        height: 36px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-menu {
        position: fixed;
        top: 68px;  /* 🔥 對應 header 高度 */
        left: 0;
        right: 0;
        height: calc(100vh - 68px);  /* 🔥 對應 header 高度 */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        /* 行動版加深背景，提升可讀性 */
        background: rgba(8, 12, 20, .92);
        backdrop-filter: blur(18px) saturate(120%);
        -webkit-backdrop-filter: blur(18px) saturate(120%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity .25s, transform .25s, visibility .25s;
        padding: 20px;
        z-index: 999;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .header-menu.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .header-menu .menu {
        width: 100%;
        max-width: 280px;
        background-color: rgba(255, 255, 255, .10);
    }

    .header-menu .item {
        width: 100%;
        justify-content: center;
        font-weight: 700;
        font-size: 18px;
        background: var(--gray);
        border: 1px solid var(--c-cyan);
        box-shadow: 0 6px 22px rgba(0, 0, 0, .28), 0 0 0 1px var(--c-cyan) inset;
    }

    .dropdown-menu {
        position: static;
        margin-top: 8px;
        transform: none;
        opacity: 1;
        background: rgba(255, 255, 255, .10);
        border: 1px solid var(--c-cyan);
        display: none;
        pointer-events: auto;
    }

    .menu.open>.dropdown-menu {
        display: block;
        transform: translateX(0%) translateY(0);
    }

    .main-header {
        background: transparent;
        backdrop-filter: blur(5px) saturate(100%);
        border-bottom: 1px solid rgba(0, 217, 255, .28);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    }

    .main-header::after {
        opacity: 1;
        animation-play-state: running;
    }
}

@media (max-width: 480px) {
    .main-header {
        height: 60px;  /* 🔥 小手機版再縮小 */
    }

    .main-header.scrolled {
        height: 56px;
    }

    .logo img {
        height: 36px;
    }

    .main-header.scrolled .logo img {
        height: 32px;
    }

    .header-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .main-header.scrolled ~ .header-menu {
        top: 56px;
        height: calc(100vh - 56px);
    }
}

