/* ==========================================================================
   1. 全域變數與基礎設定
   ========================================================================== */
:root {
    --white: #ffffff;
    --ultra-light-pink: #fffafa; /* 極淺粉，幾乎接近白 */
    --soft-pink: #fff0f3;       /* 淺粉 */
    --accent-pink: #ffb7c5;     /* 強調粉色 */
    --text-dark: #2d3436;
    --text-gray: #636e72;
    --border-light: #f1f2f6;
    --shadow: 0 15px 35px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--white);
    padding-top: 80px; 
}

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

/* ==========================================================================
   2. 頁首 (Header) 核心樣式
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; 
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 183, 197, 0.2);
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: -1;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 24px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.univ-name {
    font-size: 0.85rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.committee-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-pink);
    transition: width 0.3s ease;
}

.nav-item:hover {
    color: var(--accent-pink);
}

.nav-item:hover::after {
    width: 100%;
}

.icon-sm {
    font-size: 0.7rem;
    margin-left: 4px;
    vertical-align: middle;
}

.mobile-menu-toggle, .menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 2000;
    padding: 10px;
    transition: color 0.3s ease;
}

.mobile-menu-toggle *, .menu-toggle * {
    pointer-events: none;
}

/* ==========================================================================
   3. 頁尾 (Footer) 核心樣式
   ========================================================================== */
.main-footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-light);
    padding: 80px 0 0 0; 
    margin-top: 0;
    position: relative;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 50px;
    position: static !important; 
}

.footer-left {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo img {
    height: 80px;
    width: auto;
}

.footer-logo-text {
    display: flex;
    flex-direction: column;
}

.footer-univ {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.footer-comm {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    gap: 24px;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-pink); 
}

.footer-socials {
    display: flex;
    gap: 16px;
}

.social-btn {
    width: 42px;
    height: 42px;
    background-color: var(--ultra-light-pink); 
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.social-btn:hover {
    background-color: var(--accent-pink);
    color: var(--white);
    transform: translateY(-4px); 
}

.footer-bottom {
    background-color: var(--ultra-light-pink); 
    padding: 20px 0;
    border-top: 1px solid rgba(255, 183, 197, 0.1);
}

.footer-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin: 0;
}

.tech-by {
    font-weight: 500;
}

/* ==========================================================================
   4. Page Top 按鈕樣式
   ========================================================================== */
.footer-back-to-top {
    position: absolute;
    top: 0;
    right: calc((100% - 1140px) / 2 + 24px);
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: var(--text-gray);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px 8px 16px; 
    z-index: 10;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.footer-back-to-top:hover {
    color: var(--accent-pink);
}

.footer-back-to-top:hover i {
    color: var(--accent-pink); 
    transform: translateY(-3px); 
}

.footer-back-to-top i {
    font-size: 0.8rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* ==========================================================================
   5. 響應式設計 (Responsive Web Design)
   ========================================================================== */

@media (max-width: 1140px) {
    .footer-back-to-top {
        right: 24px; 
    }
}

@media (max-width: 992px) {
    /* Header 手機版選單設定 */
    .logo {
        width: auto;
        flex-shrink: 1;
        position: relative;
        z-index: 10;
    }
    
    .logo a {
        display: inline-flex;
        width: max-content;
    }

    .mobile-menu-toggle, .menu-toggle {
        position: relative;
        z-index: 9999 !important;
        margin-right: -10px;
        pointer-events: auto !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
    }

    .hamburger-lines {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 16px;
    }

    .hamburger-lines span {
        display: block;
        height: 1.5px;
        width: 100%;
        background-color: var(--text-dark);
        border-radius: 10px;
        transition: all 0.3s ease-in-out;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1500;
        
        visibility: hidden;
        transform: translateX(100%);
        
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), 
                    visibility 0.4s linear; 
    }

    .nav-wrapper.active {
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-wrapper.active ~ .mobile-menu-toggle .hamburger-lines span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-wrapper.active ~ .mobile-menu-toggle .hamburger-lines span:nth-child(2) {
        opacity: 0;
    }

    .nav-wrapper.active ~ .mobile-menu-toggle .hamburger-lines span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .nav-item {
        font-size: 1.6rem;
        font-weight: 700;
        display: block;
    }

    /* Page Top 行動裝置微調 */
    .footer-back-to-top {
        top: 0px;
        right: 20px; 
    }
    
    .footer-back-to-top:hover i {
        transform: none; 
    }
}

@media (max-width: 768px) {
    /* Footer 行動裝置堆疊設定 */
    .footer-container {
        flex-direction: column;
        gap: 40px;
        align-items: flex-start;
    }
    
    .footer-right { 
        align-items: flex-start; 
        width: 100%; 
    }
    
    .footer-links { 
        flex-direction: column; 
        gap: 16px; 
    }
    
    .footer-bottom-container { 
        flex-direction: column; 
        gap: 8px; 
        text-align: center; 
    }
}