/*
    Update History:
    V1.1.5: 手機版強制解除翻轉限制，同步字級。
    V1.1.6: 同步桌面與手機版 Active 底線寬度為 2px。
    V1.1.9: 精修 Banner 邏輯：1920px 以上鎖定 100px 高，以下依 1152:100 比例縮放防裁切。
    V1.2.1: 修正手機版 Home 項目因隱藏中文導致無懸停變色問題，特別開啟 Home 英文變色效果。
*/

:root {
    --panel-main-text-size: clamp(1rem, 1.2vw, 1.5rem);
    --panel-main-line-height: 1.8;
    --accent-color: #FFB11B;
}

html { font-size: 16px; scroll-behavior: smooth; } 
@media (max-width: 1920px) { html { font-size: 14.222px; } }
@media (max-width: 1440px) { html { font-size: 13px; } }

* { margin: 0; padding: 0; box-sizing: border-box; }

.resize-transition-stopper * {
    transition: none !important;
}

body { 
    font-family: "Microsoft JhengHei", sans-serif; 
    font-size: 0.75rem; 
    color: #333; 
    background-color: #FFFFFF; 
    overflow-x: hidden; 
    overflow-y: auto; 
}

.div-hidden {display: none !important; }

/* --- Navbar (Desktop) --- */
.navbar { 
    position: fixed; top: 0; width: 100%; height: 6.25rem; 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 2.5rem; 
    background: rgba(255, 255, 255, 0.25); 
    backdrop-filter: blur(10px);          
    -webkit-backdrop-filter: blur(10px);   
    z-index: 10000; white-space: nowrap; 
}
.nav-side { display: flex; align-items: center; }
.nav-left { justify-content: flex-start; gap: 3rem; }
.logo-area { cursor: pointer; flex-shrink: 0; }
.logo-area img { height: 3.125rem; width: auto; display: block; }

.nav-links { display: flex; list-style: none; gap: 1.875rem; align-items: center; }
.nav-item, .nav-item-special { height: 1.6rem; line-height: 1.6rem; cursor: pointer; position: relative; overflow: hidden; }

.nav-item.active, 
.nav-item.active .nav-external, 
.nav-item.active .flip-text { 
    cursor: default !important; 
    pointer-events: none !important; 
}

.nav-external { text-decoration: none !important; color: #000000 !important; display: block; width: 100%; height: 100%; }

.flip-text { display: flex; flex-direction: column; transition: transform 0.5s cubic-bezier(0.45, 0, 0.55, 1); height: 3.2rem; }
.flip-text span { display: block; height: 1.6rem; line-height: 1.6rem; text-align: center; color: #000000; transition: opacity 0.4s, color 0.4s; font-size: 1.125rem; font-weight: 500; }
.flip-text .ch { opacity: 0; }
.flip-text .en { opacity: 1; }

.nav-item:hover .flip-text, .nav-item.active .flip-text, .nav-item-special:hover .flip-text { transform: translateY(-1.6rem); }
.nav-item:hover .en, .nav-item.active .en, .nav-item-special:hover .en { opacity: 0; }
.nav-item:hover .ch, .nav-item.active .ch, .nav-item-special:hover .ch { opacity: 1; }

.nav-item:not(.active):hover .flip-text span.ch, .nav-item-special:hover .flip-text span.ch { color: #FFB11B !important; }

.nav-item.active { border-bottom: 2px solid #000; }

.icon-area { display: flex; gap: 1.25rem; align-items: center; }
.mobile-only-icons { display: none; } 
.icon-item { position: relative; width: 1.5625rem; height: 1.5625rem; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.icon-item img { height: 1.5625rem !important; width: 1.5625rem !important; position: absolute; transition: 0.2s; }
.icon-hover { opacity: 0; }
.icon-item:hover .icon-orig { opacity: 0; }
.icon-item:hover .icon-hover { opacity: 1; }

.icon-label { 
    position: absolute; bottom: 1.5rem; left: 100%; transform: translateX(-50%); 
    font-size: 0.75rem; white-space: nowrap; opacity: 0; transition: 0.4s; 
    pointer-events: none; text-align: center; background: rgba(0, 0, 0, 0.7); 
    color: white; padding: 0 0.5rem; border-radius: 4px; 
}
.icon-item:hover .icon-label { opacity: 1; }

.hamburger { display: none; width: 30px; height: 20px; flex-direction: column; justify-content: space-between; cursor: pointer; z-index: 10001; }
.hamburger span { display: block; width: 100%; height: 3px; background-color: #000000; border-radius: 3px; transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* --- Groups Content --- */
#groups-content { margin-top: 6.25rem; min-height: calc(100vh - 6.25rem - 250px); width: 100%; display: flex; flex-direction: column; }
.groups-top-header { width: 100%; padding: 6rem 0 2rem; display: flex; flex-direction: column; }
.en-title-row { width: 100%; padding-right: 150px; text-align: right; }
.header-title-en { font-size: 6em; font-weight: 800; color: #333; letter-spacing: 2px; line-height: 1; margin: 0; }
.banner-row { width: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 100px; position: relative; margin-top: 0.5rem; }
.sidebar-title { position: absolute; left: 100px; font-size: 1.5em; font-weight: 700; color: #333; margin: 0; white-space: nowrap; }

.header-banner-icon { 
    width: 60vw; 
    height: auto; 
    aspect-ratio: 1152 / 100; 
    object-fit: cover; 
    background-color: transparent; 
}

@media (min-width: 1920px) {
    .header-banner-icon {
        height: 100px;
        width: 60vw;
    }
}

.groups-body-container { width: 100%; display: flex; flex-direction: row; align-items: stretch; padding: 2rem 0 5rem; }
.groups-sidebar { width: 25%; flex-shrink: 0; }
.groups-divider { width: 0.5px; background-color: rgba(0, 0, 0, 0.1); flex-shrink: 0; }
.groups-main-panel { width: 75%; padding: 0 20vw 0 3rem; flex-grow: 1; }
.group-category-title { font-size: 2em; font-weight: 700; color: #333; margin: 2.5rem 0 1rem; text-align: left; }
.group-category-title:first-child { margin-top: 0; }
.groups-table { width: 100%; border-collapse: collapse; font-size: 1.125rem; text-align: left; margin-bottom: 3rem; border: 1px solid #E0E0E0; table-layout: fixed; }
.groups-table th, .groups-table td { padding: 1.2rem 1rem; border: 1px solid #E0E0E0; word-wrap: break-word; }
.groups-table th:nth-child(1), .groups-table td:nth-child(1) { width: 25%; }
.groups-table th:nth-child(2), .groups-table td:nth-child(2) { width: 35%; }
.groups-table th:nth-child(3), .groups-table td:nth-child(3) { width: 40%; }
.groups-table th { background-color: transparent; font-weight: 600; color: #555; }

/* --- Footer --- */
.footer-section { height: 250px; background-color: black; display: flex; justify-content: center; align-items: center; color: white; }
.footer-container { width: 90%; max-width: 1200px; display: flex; justify-content: center; align-items: flex-start; gap: clamp(2rem, 12.2vw, 15.625rem); }
.footer-left { display: flex; flex-direction: column; gap: 0.5rem; color: #bbb; font-size: 0.9rem; min-width: 300px; }
.footer-right { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; color: #888; min-width: 250px; height: 100%; }
.work-time { display: flex; align-items: flex-start; margin-top: 0.5rem; }
.back-btn { cursor: pointer; margin-top: 1rem; width: 40px; height: 15px; display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.arrow-up { width: 10px; height: 10px; border-top: 3px solid rgba(255, 255, 255, 0.7); border-left: 3px solid rgba(255, 255, 255, 0.7); transform: rotate(45deg); }

/* --- RWD：手機版選單 --- */
@media (max-width: 1024px) {
    .navbar { padding: 1.5rem 2.5rem; }
    .nav-links { 
        position: fixed; top:0; right: 0; width: 250px; height: 100vh; 
        background: rgba(0, 0, 0, 0.9); flex-direction: column; 
        align-items: flex-start !important;
        padding: 70px 30px; gap: 2.2rem; 
        z-index: 10000; border-left: 1px solid rgba(255, 255, 255, 0.1);
        transition: transform 0.4s ease; transform: translateX(100%);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    }
    .nav-links.active { transform: translateX(0); }
    .nav-links .nav-item, .nav-links .nav-item-special {
        overflow: visible !important; 
        height: auto !important;
        line-height: normal !important;
    }
    .nav-links .flip-text { 
        height: auto !important; 
        transform: none !important; 
        display: flex !important; 
        flex-direction: column !important; 
    }

    /* 針對 Home 項目（連結 index.html 的 a 標籤）在手機版隱藏中文 */
    .nav-links a[href="index.html"] .ch { display: none !important; }

    /* 修正需求：手機版 Home 項目的英文懸停變色 */
    .nav-links a[href="index.html"]:hover .en,
    .nav-links .nav-item.active a[href="index.html"] .en {
        color: #FFB11B !important;
    }

    .nav-links .flip-text span { 
        text-align: left; 
        height: auto !important; 
        line-height: 1.2 !important; 
        display: block !important; 
        position: static !important; 
        visibility: visible !important;
        transition: color 0.3s ease; /* 平滑變色 */
    }
    .nav-links .flip-text .en { opacity: 0.7 !important; color: #FFFFFF !important; font-size: 1.5rem !important; }
    .nav-links .flip-text .ch { opacity: 1 !important; color: #FFFFFF !important; font-size: 1rem !important; margin-top: 5px !important; }
    
    /* 其他項目的中文懸停變色邏輯 */
    .nav-links .nav-item:not(.active):hover .ch,
    .nav-links .nav-item-special:hover .ch {
        color: #FFB11B !important;
    }

    .nav-links .nav-item.active { 
        border-bottom: 2px solid #ffffff !important; 
        padding-bottom: 0.3125rem; 
        width: fit-content; 
        padding-right: 120px !important;
        pointer-events: none !important; 
    }
    .hamburger { display: flex; }
    .hamburger span { background-color: #000; }
    .hamburger.active span { background-color: #FFF; } 
    .mobile-only-icons { display: flex; justify-content: flex-start; gap: 1.5rem; padding-bottom: 1.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    .desktop-icons { display: none; }
    .groups-sidebar, .groups-divider { display: none; }
    .groups-main-panel { width: 100%; padding: 0 5%; text-align: left; }
    .header-title-en { font-size: 4em; }
    .sidebar-title { left: 50px; }
}

@media (max-width: 768px) {
    .groups-top-header { padding-top: 3rem; align-items: center; }
    .en-title-row, .header-banner-icon { display: none !important; }
    .banner-row { justify-content: center; padding-right: 0; }
    .sidebar-title { position: static; font-size: 1.8em; text-align: center; }
    .footer-section { height: auto; min-height: 250px; }
    .footer-container { flex-direction: column; align-items: center; gap: 2.5rem; text-align: center; }
    .footer-left { align-items: flex-start; text-align: left; min-width: unset; width: fit-content; max-width: 240px; margin: 0px auto; }
    .footer-right { align-items: center; height: auto; width: 100%; min-width: unset; }
    .copyright { text-align: center; width: 100%; }
}

.text-accent {color: var(--accent-color) !important;}