@charset "UTF-8";

:root {
	--primary: #0EA5E9;  
	--primary-light: #38BDF8;
	--primary-dark: #0284C7;

    --secondary: #14B8A6; 
	--secondary-light: #2DD4BF;
	--secondary-dark: #0D9488;
    
	--accent: #00d9ff;
    --accent-hover: #38bdf8;

	--success: #10B981;
    --info: #04c7e0;
	--warning: #fec400;
    --danger: #fe5461;
	
	/* Legacy Colors (for backward compatibility) */
    --blue: #3b82f6;
    --blue-light: #60a5fa;
    --blue-bg: rgba(59, 130, 246, 0.15);
    
    --green: #10b981;
    --green-light: #34d399;
    --green-bg: rgba(16, 185, 129, 0.15);

    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --purple-bg: rgba(139, 92, 246, 0.15);
    
    --red: #ef4444;
    --red-light: #f87171;
    --red-bg: rgba(239, 68, 68, 0.1);

    --orange: #f59e0b;
    --orange-light: #fbbf24;
    --orange-bg: rgba(245, 158, 11, 0.15);

    --cyan: #06b6d4;
    --cyan-light: #22d3ee;
    --cyan-bg: rgba(6, 182, 212, 0.15);

    --teal: #20c997;
    --white: #ffffff;
    --black: #000000;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --light: #f0f1f5;
    --dark: #131313;
    --smoke: #8a909d;

    /* ===============================
       System Colors (Unified)
       =============================== */
    
    /* Layout Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;

    /* Theme Colors */
    --sys-bg: #0f172a;
    --sys-card-bg: rgba(30, 41, 59, 0.7);
    --sys-border: rgba(255, 255, 255, 0.08);
    --sys-text: #e2e8f0;
    --sys-text-muted: #94a3b8;
    
}


* {
	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;
    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;
}

a {
    text-decoration: none;
}

a:hover {
	text-decoration: 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;
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all 0.3s ease;

    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header 滾動狀態 - 添加背景模糊效果 */
.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: 70px;
}

/* 科技藍動態底線動畫 */
.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;
}



/* Header 左側區域 - Logo 和側邊欄切換按鈕 */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Header 右側區域 - 系統功能按鈕 */
.header-right {
    display: flex;
    align-items: center;
}

/* 分隔線 */
.nav-divider {
    display: block;
    height: 40px;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.5), transparent);
    margin: 0 10px;
    width: 1px;
}


/* ===============================
   Logo 樣式
   =============================== */

.header-logo{
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #00d9ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* ===============================
   手機版選單切換按鈕（漢堡選單）
   =============================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 漢堡選單展開時的 X 形狀 */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

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

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


/* ===============================
   側邊欄切換按鈕（系統管理頁面專用）
   =============================== */

.sys-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    z-index: 10002;
    position: relative;
}

.sys-toggle-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    transform: scale(1.05);
}

.sys-toggle-btn:active {
    transform: scale(0.95);
}

/* ===============================
   導航連結樣式
   =============================== */

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00d9ff;
}

.nav-link i {
    font-size: 1rem;
}



/* ===============================
   用戶下拉選單
   =============================== */

/* 用戶選單容器 */
.user-dropdown {
    position: relative;
}

/* 用戶按鈕 */
.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--light);
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 217, 255, 0.5);
}

/* 用戶頭像 */
.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #00d9ff, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
    transition: all 0.2s;
    flex-shrink: 0;
}

/* 用戶名稱 */
.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 下拉箭頭 */
.user-btn i.fa-chevron-down {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s;
}

.user-btn:hover i.fa-chevron-down {
    color: #00d9ff;
}

/* 用戶下拉選單 */
.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: fit-content;
    min-width: 200px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 10000;
}

.user-menu.active {
    display: block;
}

/* 用戶選單標題區 */
.user-menu-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px 12px 0 0;
}

.user-menu-header .user-avatar {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
}

.user-menu-info {
    width: fit-content;
}

.user-menu-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 用戶選單分隔線 */
.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.user-menu-items {
    padding: 10px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 用戶選單項目 */
.user-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--light);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #00d9ff;
}

.user-menu-item i {
    width: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.user-menu-item:hover i {
    color: #00d9ff;
}

/* 登出按鈕特殊樣式 */
.user-menu-item.logout {
    color: #f87171;
    border-radius: 0 0 12px 12px;
}

.user-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.user-menu-item.logout i {
    color: #f87171;
}

.user-menu-item.logout:hover i {
    color: #ef4444;
}


/* ===============================
   響應式設計（RWD）
   =============================== */

/* 平板和手機版 (≤768px) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-menu {
        position: fixed;
        inset: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: rgba(10, 15, 30, 0.98);
        backdrop-filter: blur(20px);
        padding: 80px 30px 40px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        gap: 15px;
    }

    .header-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .nav-link.header-link {
        width: 100%;
        justify-content: center;
        padding: 18px 24px;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 2px solid rgba(0, 217, 255, 0.3);
        border-radius: 12px;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-divider {
        height: 2px;
        margin: 15px 0;
        width: 100%;
    }

    .user-dropdown {
        width: 100%;
        position: static;
    }

    .user-btn {
        width: 100%;
        justify-content: center;
        padding: 18px 24px;
        font-size: 1rem;
        gap: 12px;
    }

    .user-btn .user-name {
        max-width: none;
    }

    .user-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: 12px 12px 0 0;
        background: rgba(15, 23, 42, 0.98);
        border: 1px solid rgba(0, 217, 255, 0.3);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        max-height: 80vh;
        overflow-y: auto;
    }

    .user-menu-header {
        padding: 25px 20px;
        background: rgba(0, 217, 255, 0.05);
        border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    }

    .user-menu-header .user-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .user-menu-item {
        padding: 16px 20px;
        font-size: 1rem;
        gap: 15px;
        border-radius: 0;
    }

    .user-menu-item i {
        width: 22px;
        font-size: 1.1rem;
    }

    .user-menu-item.logout {
        margin-bottom: env(safe-area-inset-bottom, 20px);
    }

    .user-menu-divider {
        background: rgba(0, 217, 255, 0.2);
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .header-logo img {
        height: 35px;
    }

    .main-header {
        height: 70px;
        padding: 0 15px;
    }

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

    .header-menu.active .nav-link,
    .header-menu.active .user-dropdown {
        animation: slideInUp 0.4s ease forwards;
        opacity: 0;
    }

    .header-menu.active .nav-link:nth-child(1) { animation-delay: 0.1s; }
    .header-menu.active .nav-link:nth-child(2) { animation-delay: 0.15s; }
    .header-menu.active .user-dropdown { animation-delay: 0.2s; }



    .mobile-menu-toggle.active {
        position: fixed;
        top: 20px;
        right: 30px;
        z-index: 1001;
    }

    .mobile-menu-toggle.active span {
        background: #00d9ff;
    }
}

/* 小螢幕優化 (≤480px) */
@media (max-width: 480px) {
    .header-menu {
        padding: 60px 20px 30px;
    }

    .nav-link{
        font-size: 0.95rem;
    }

    .header-logo img {
        height: 30px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .user-menu-header {
        padding: 20px 15px;
    }

    .user-menu-header .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .user-menu-item {
        padding: 14px 15px;
        font-size: 0.95rem;
    }
}
