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

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== 主內容區域 ===== */
.main-content {
    flex: 1 0 auto;
    padding: 20px;
}

/* ===== 導航列樣式 ===== */
.menu-color {
    background-color: rgba(0, 78, 43, 0.8);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 60px;
}

/* 全屏選單背景層 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 998;
    background-color: rgba(0, 78, 43, 0.95); /* 新增：全螢幕背景顏色 */
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 主容器設定 - 桌面版 */
.menu-wrapper {
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: 60px;
}

/* 滾動容器 - 桌面版 */
.menu-scroll-container {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    height: 100%;
}

/* Logo樣式 */
.menu-logo {
    width: 75px;
    height: 60px;
    position: fixed;
    padding-left: 10px;
    z-index: 1000;
}

.menu-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 主導航選單 - 桌面版 */
.top-menu {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    flex-grow: 1;
    order: 1;
    height: 100%;
    align-items: center;
}

.top-menu li {
    position: relative;
    text-align: center;
    width: auto;
    height: 100%;
    font-size: 18px;
    font-weight: 800;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

/* 分隔線 - 桌面版 */
.top-menu li:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.top-menu a {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    height: 100%;
    transition: color 0.3s;
}

.top-menu a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.top-menu .spacer {
    width: 80px;
    visibility: hidden;
}

/* 圖標選單 - 桌面版 */
.top-icon {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    flex-shrink: 0;
    order: 2;
    margin-left: 20px;
    align-items: center;
    height: 100%;
}

.top-icon li {
    width: 35px;
    height: 35px;
    margin-left: 15px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.top-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.top-icon img {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    object-fit: cover;
    border-radius: 50%;
}

/* 懸停效果 */
.top-icon li:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.top-icon a:hover img {
    opacity: 0.8;
}

/* ===== 漢堡選單按鈕 ===== */
.hamburger {
    display: none;
    cursor: pointer;
    position: fixed;
    right: 20px;
    top: 12px;
    background: transparent;
    border: none;
    padding: 12px;
    z-index: 1000;
    transition: transform 0.3s ease;
    outline: none;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    width: 100%;
    height: 3px;
    background-color: #fff;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    border-radius: 3px;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    width: 100%;
    height: 3px;
    background-color: #fff;
    position: absolute;
    left: 0;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    border-radius: 3px;
}

.hamburger-inner::before {
    top: -10px;
    transform-origin: center;
}

.hamburger-inner::after {
    bottom: -10px;
    transform-origin: center;
}

/* X形轉換 */
.hamburger[aria-expanded="true"] .hamburger-inner {
    background-color: transparent !important;
    transform: translateY(-50%) scale(0.9);
}

.hamburger[aria-expanded="true"] .hamburger-inner::before {
    top: 0;
    transform: rotate(45deg) translateY(0) scaleX(0.9);
}

.hamburger[aria-expanded="true"] .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-45deg) translateY(0) scaleX(0.9);
}

.hamburger:hover .hamburger-inner,
.hamburger:hover .hamburger-inner::before,
.hamburger:hover .hamburger-inner::after {
    background-color: rgba(255, 255, 255, 0.9);
}

.hamburger:active {
    transform: scale(0.95);
}

.hamburger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ===== 頁尾樣式 ===== */
.site-footer {
    background-color: white;
    background-image: url('../images/footer_bg.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 60px;
}

/* 版權文字區域 */
.footer-container {
    text-align: right;
    flex-shrink: 0;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-container p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.company-name {
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 1px;
}

/* Footer icons 樣式 */
.footer-icons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    padding: 0 15px;
}

/* ===== 新增：規範條款和私隱政策樣式 ===== */
.footer-links {
    font-size: 12px;
    color: #ccc;
    text-align: left; /* 預設靠左 */
    margin: 5px 0 0 0;
}

.footer-links a {
    color: #CCC !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #FFF !important;
    text-decoration: underline;
}

/* 在 768px 及以下時置中 */
@media (max-width: 768px) {
    .footer-links {
        text-align: center;
    }
}

/* ===== 桌面版 Footer 固定底部樣式 ===== */
@media (min-width: 1025px) {  
    .site-footer {
        position: fixed;
        bottom: 0px;
        height: 65px;
    }
}

/* ===== 響應式設計 ===== */

/* 平板和手機 (1024px 及以下) */
@media (max-width: 1024px) {
    /* 導航列響應式 - 移除背景色 */
    .menu-color {
        box-shadow: none;
        height: 60px;
    }
    
    .menu-overlay.show ~ .menu-color {
        background-color: transparent; /* 1024px以下不顯示背景顏色 */
        z-index: 1001;
    }
    
    .menu-wrapper {
        flex-direction: column;
        padding: 0;
        height: auto;
    }
    
    .menu-scroll-container {
        flex-direction: column;
        padding-top: 60px;
        max-height: calc(100vh - 0px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        /* 移除原本的背景色，現在由 menu-overlay 提供 */
        background-color: transparent;
        text-align: center;
        justify-content: center;
        align-items: center;
    }
    
    .menu-logo {
        width: 65px;
        height: 52px;
        top: 4px;
        left: 5px;
    }
    
    .top-menu,
    .top-icon {
        width: 100%;
        display: none;
        padding: 15px 0;
        margin-left: 0;
        justify-content: center;
        height: auto;
    }
    
    .top-menu.show {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .top-menu li::after {
        display: none;
    }
    
    .top-menu li {
        width: 100%;
        padding: 12px 0;
        height: auto;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .top-menu a {
        padding: 5px 5px;
        line-height: 1.5;
        justify-content: center;
        width: 100%;
        text-align: center;
    }
    
    .top-menu li.spacer {
        display: none !important;
    }
    
    .hamburger {
        display: block;
        top: 8px;
    }
    
    /* 頁尾響應式 */
    .site-footer {
        height: auto;
        min-height: 60px;
        position: relative;
    }
    
    .footer-container p {
        font-size: 15px;
    }
    
    .footer-container, .footer-container p {
        white-space: normal;
        text-overflow: clip;
    }
    
    /* Footer icons 響應式 */
    .footer-icons .top-icon {
        display: flex !important;
        flex-direction: row;
        padding: 0;
        margin: 0;
    }
    
    .footer-icons .top-icon li {
        margin: 0 5px;
    }
}

/* 手機 (768px 及以下) */
@media (max-width: 768px) {
    .site-footer {
        padding: 8px 15px;
        height: auto;
        min-height: 120px;
        flex-wrap: wrap;
        justify-content: center;
        background-size: cover;
        background-position: center center;
        flex-direction: column;
        position: relative;
    }
    
    /* 確保 footer-icons 在上方 */
    .footer-icons {
        order: 1;
        padding: 5px 10px;
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .footer-container {
        text-align: center;
        width: 100%;
        white-space: normal;
        padding: 5px 0;
        order: 2;
    }
    
    .footer-container p {
        font-size: 14px;
        white-space: normal;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .footer-icons .top-icon li {
        width: 35px;
        height: 35px;
        margin: 0 3px;
    }
}

/* 小手機 (480px 及以下) */
@media (max-width: 480px) {
    .menu-logo {
        width: 65px;
        height: 53px;
    }
    
    .menu-scroll-container {
        padding-top: 55px;
    }
    
    .hamburger {
        top: 10px;
    }
    
    .site-footer {
        padding: 8px 10px;
        min-height: 140px;
        background-size: cover;
        background-position: center center;
        position: relative;
    }
    
    .footer-container p {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .footer-icons .top-icon li {
        width: 30px;
        height: 30px;
        margin: 0 2px;
    }
}

/* 超小屏幕 (360px 及以下) */
@media (max-width: 360px) {
    .site-footer {
        min-height: 140px;
        background-size: cover;
        background-position: center center;
        position: relative;
    }
    
    .footer-container, .footer-icons {
        justify-content: center;
        text-align: center;
        height: auto;
    }
    
    .footer-container {
        margin-top: 5px;
    }
    
    .footer-container p {
        white-space: normal;
        text-overflow: clip;
        line-height: 1.6;
    }
}

@media (max-width: 240px) {
    .site-footer {
        min-height: 175px;
        position: relative;
    }
}

/* ===== 輔助類別 ===== */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ===== 新增會員按鈕樣式 ===== */
.member-buttons {
    display: flex;
    align-items: center;
    margin-left: 10px;
    order: 2;
}

.member-join-btn,
.member-login-btn {
    padding: 8px 2px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: #fff;
    background: none;
    border: none;
}

.member-join-btn:hover,
.member-login-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

/* ===== 新增會員按鈕分隔符樣式 ===== */
.member-separator {
    color: #fff;
    margin: 0 5px;
    font-weight: 400;
}

/* 響應式設計 - 平板和手機 (1024px 及以下) */
@media (max-width: 1024px) {
    .member-buttons {
        display: flex;
        flex-direction: row;
        width: auto;
        margin-left: 0;
        padding: 0;
        order: 0;
        position: fixed;
        right: 70px; /* 放在漢堡按鈕的左邊 */
        top: 15px;
        align-items: center;
        z-index: 1001;
    }
    
    .member-join-btn,
    .member-login-btn {
        margin: 0;
        padding: 6px 5px;
        font-size: 16px;
        background: none;
        border: none;
    }
    
    .member-separator {
        margin: 0 3px;
        font-size: 13px;
    }
}

/* 手機 (768px 及以下) */
@media (max-width: 768px) {
    .member-buttons {
        right: 65px;
        top: 12px;
    }
    
    .member-join-btn,
    .member-login-btn {
        padding: 9px 5px;
        font-size: 16px;
    }
    
    .member-separator {
        font-size: 12px;
        margin: 0 2px;
    }
}

/* 小手機 (480px 及以下) */
@media (max-width: 480px) {
    .member-buttons {
        right: 60px;
        top: 10px;
    }
    
    .member-join-btn,
    .member-login-btn {
        padding: 13px 5px;
        font-size: 16px;
    }
    
    .member-separator {
        font-size: 11px;
        margin: 0 1px;
    }
}

/* 超小屏幕 (360px 及以下) */
@media (max-width: 360px) {
    .member-buttons {
        right: 55px;
        top: 10px;
    }
    
    .member-join-btn,
    .member-login-btn {
        font-size: 16px;
    }
    
    .member-separator {
        font-size: 10px;
    }
}