:root {
    /* Colors */
    --header-bg: #000000;
    --header-text: #ffffff;
    --header-border: #333333;
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #60a5fa;
    
    /* Dimensions */
    --header-height: 80px;
    --footer-height: 200px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    
    /* Radius */
    --radius-sm: 0.375rem;
}


/******************************************************************************
 * 基礎樣式重置
 ******************************************************************************/
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, sans-serif;
	line-height: 1.6;
	margin: 0;
	overflow-x: hidden;
}

main{
    min-height: calc(100vh - var(--header-height) - var(--footer-height)) ;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}


.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}


/******************************************************************************
 * HEADER 導航列
 ******************************************************************************/

/* Main Header Container */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    height: var(--header-height);
    color: var(--header-text);
    
    /* Flexbox Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* Header Left - Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity var(--transition-fast);
}

.header-left:hover {
    opacity: 0.85;
}

.header-left img {
    height: 60px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -0.5px;
}

/* Header Right - Navigation & Toggle */
.header-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Unified Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--header-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.nav-link:hover {
    color: var(--primary-light);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile Menu Toggle Button */
.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(--header-text);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.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);
}

/******************************************************************************
 * 響應式設計 - Header
 ******************************************************************************/
@media (max-width: 991.98px) {
    /* Transform nav to mobile layout */
    .header-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--header-bg);
        border-bottom: 1px solid var(--header-border);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        padding: 1.5rem;
        
        /* Change to vertical layout */
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        
        /* Hidden by default */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .header-nav.active {
        max-height: 800px;
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
    }
    
    .header-nav .nav-link {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    /* Show mobile toggle */
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 16px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .header-left img {
        height: 40px;
    }
}

/* User Dropdown Menu */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--header-text);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name-text {
    font-weight: 500;
    font-size: 15px;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: auto;
    min-width: 200px;
    background-color: #202226;
    border: 1px solid #40444D;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@keyframes dropDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991.98px) {
    .user-dropdown-menu {
        position: relative;
        top: 0;
        right: auto;
        left: auto;
        margin: 10px auto 0;
        width: 100%;
        max-width: 280px;
        display: none;
    }
    .user-dropdown-menu.show {
        display: block;
        animation: dropDownFade 0.2s ease forwards;
        transform: none;
    }
}

/* User Card Header */
.dropdown-profile-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-lg {
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 12px; /* Rounded Square */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.profile-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: max-content;
}

.profile-name {
    color: white;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.profile-role {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.4;
}

.dropdown-divider {
    height: 1px;
    background-color: #374151;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/******************************************************************************
 * FOOTER 頁尾
 ******************************************************************************/
.main-footer {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 2rem 0 1rem;
    margin-top: auto;
    border-top: 1px solid var(--header-border);
    height: var(--footer-height);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Contact Info */
.footer-contact {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
	justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
	justify-content: center;
    gap: 0.5rem;
    font-size: 14px;
}

.contact-item i {
    color: var(--primary-light);
    font-size: 16px;
}

.contact-item a {
    color: #9ca3af;
    transition: color var(--transition-fast);
}

.contact-item a:hover {
    color: var(--primary-light);
}

/* Footer Info */
.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.footer-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.copyright {
    font-weight: 600;
    color: #d1d5db;
}

.company {
    color: #9ca3af;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.footer-links a {
    color: #9ca3af;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-links .separator {
    color: #6b7280;
}

/* Footer Credit */
.footer-credit {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

.footer-credit p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.footer-credit .heart {
    color: #ef4444;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

/* Footer Responsive */
@media (max-width: 768px) {
    .main-footer {
        height: auto;
    }
    .footer-contact {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
    }
}
