/* ==========================================================================
   1. 全站基礎設定
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, "Microsoft JhengHei";
    margin: 0;
    padding: 0;
    background-color: #ffffff; 
    color: #808080; /* 全站預設文字灰色 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止手機版網頁左右溢出 */
}

/* ==========================================================================
   2. 頂部導覽列 (Navbar) - 純白底色、大螢幕置中留白
   ========================================================================== */
.navbar-wrapper {
    background-color: #ffffff; 
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #f1f1f1; /* 極淡底部分隔線 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); 
    width: 100%;
}

.navbar {
    max-width: 1600px;         /* 大螢幕限制寬度，自動留白置中 */
    margin: 0 auto;            
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 60px;              
}

.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.navbar-logo {
    height: 42px;              
    width: auto;               
    display: block;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
}

.nav-links > li {
    display: flex;
    align-items: center;
}

.nav-links > li > a {
    color: #808080; 
    text-decoration: none;
    padding: 0 1.2rem;
    line-height: 60px;          
    display: block;
    transition: background-color 0.2s, color 0.2s;
    font-weight: bold;
    height: 100%;
}

/* 滑鼠懸停：觸發粉紫藍色反饋 */
.nav-links > li > a:hover {
    background-color: #E6E6FF; /* 淺粉紫藍底 */
    color: #9999FF;            /* 粉紫藍字 */
}

/* 漢堡按鈕 (電腦版預設隱藏) */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-toggle span {
    width: 100%;
    height: 3px;
    background-color: #808080; 
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 電腦版下拉選單 - 白底微調 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none; 
    position: absolute;
    top: 100%;                 
    left: 0;
    background-color: #ffffff; 
    min-width: 320px;
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #f1f1f1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dropdown-menu li a {
    color: #808080; 
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid #fafafa; 
    transition: background-color 0.2s, color 0.2s;
    font-weight: bold;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a:hover {
    background-color: #E6E6FF; 
    color: #9999FF;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* ==========================================================================
   3. 首頁內容排版 (Banner & Cards & Welcome Text) - 完全還原 Huskylens 橫向卡片
   ========================================================================== */
.hero-banner {
    width: 100%;       
    max-width: 1600px; 
    margin: 0 auto;    
    padding: 0;        
    background: none;  
}

.hero-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

.main-content {
    max-width: 1600px; 
    margin: 0 auto;    
    padding: 2rem 2rem 4rem 2rem; 
    width: 100%;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3.5rem;
    margin-top: 2rem;
}

.welcome-section h2, .parts-title {
    color: #3333FF; /* 歡迎標題深藍色 */
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.welcome-text {
    max-width: 1200px;         
    margin: 0 auto;            
    text-align: justify;       
    text-justify: inter-word;  
    color: #808080; 
    font-size: 1.15rem;        
    line-height: 1.85;         
}

/* 核心排版：使三張卡片在電腦屏幕上完美橫向並排 */
.card-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 25px;       
    width: 100%;
    margin-top: 3rem;
    justify-content: center;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); 
    display: flex;
    flex-direction: column;
    /* 三欄平分計算：3張卡片剛好鋪滿網頁閱讀區 */
    flex: 1 1 calc(33.333% - 25px); 
    min-width: 280px; 
    text-decoration: none; 
    color: inherit;        
    transition: transform 0.2s, box-shadow 0.2s, outline 0.1s;
    border: 1px solid #f1f1f1; 
}

/* 滑鼠懸浮特效：外框加上 hex#9999FF 的粉紫藍色外框線 */
.card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    outline: 3.5px solid #9999FF; 
}

/* 關鍵修復：限制 3 張相片高度，contain 保證絕不裁切，留白處由極淡灰背景優雅襯托 */
.card img {
    width: 100%;       
    height: 240px;             /* 固定的舒適卡片高度 */
    background-color: #fafafa; /* 當相片比例不同時，四周自動留白補淡灰色 */
    display: block;
    object-fit: contain;       /* 不裁切相片鐵律 */
    padding: 10px;             /* 卡片內呼吸間距 */
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: #ffffff;
    border-top: 1px solid #f5f5f5;
}

.card-body h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #808080; /* 文字灰色 */
    text-align: center; 
    font-weight: bold;
}

.card-body p {
    margin: 0;
    font-size: 0.95rem;
    color: #808080;
    text-align: center; 
}

/* ==========================================================================
   4. 頁腳與自製計數器樣式
   ========================================================================== */
.site-footer {
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #f1f1f1; 
    padding: 25px 0;
    margin-top: 2rem;
}

.counter-container {
    max-width: 1600px;
    margin: 0 auto;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, "Microsoft JhengHei";
    font-size: 0.95rem;
    color: #808080;
    font-weight: bold;
}

/* 計數器數字：深藍色 */
.counter-number {
    color: #3333FF; 
    font-size: 1.1rem;
    margin-left: 3px;
}

/* ==========================================================================
   5. RWD 手機版媒體查詢 (完全對齊 Huskylens 規格)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row !important; 
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1.2rem !important; 
        position: relative;
        height: 60px; 
        background-color: #ffffff !important; 
        z-index: 1001;
    }

    .hamburger-toggle {
        display: flex !important;
    }

    /* 漢堡按鈕動畫變為 X */
    .hamburger-toggle.open span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    .hamburger-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-toggle.open span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    /* 手機版全版彈出選單 */
    .nav-links {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 60px; 
        left: 0;
        width: 100%;
        background-color: #ffffff !important; 
        box-shadow: 0 10px 15px rgba(0,0,0,0.08); 
        padding: 0;
        z-index: 9999 !important;               
        border-top: 1px solid #f1f1f1;
        border-bottom: 1px solid #e5e5e5;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links > li {
        width: 100%;
        text-align: left;
        display: block;
        background-color: #ffffff !important;
    }

    .nav-links > li > a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f9f9f9;
        line-height: normal; 
        height: auto;
        color: #808080;
    }
    
    /* 手機版選單懸停 */
    .nav-links > li > a:hover {
        background-color: #E6E6FF !important; 
        color: #9999FF;
    }

    /* 手機版下拉子選單：固定以白色微暗層次開展 */
    .dropdown-menu {
        position: relative;
        top: 0;
        box-shadow: none;
        width: 100%;
        background-color: #fafafa !important; 
        display: block; 
        border: none;
        z-index: 10000;
    }

    .dropdown-menu li {
        background-color: #fafafa !important;
    }

    .dropdown-menu li a {
        padding: 12px 2.5rem; 
        border-bottom: 1px solid #f1f1f1;
    }
    
    /* 手機版主內文與卡片自適應降級為單欄 */
    .main-content {
        padding: 1rem 1rem 2rem 1rem;
    }

    .welcome-text {
        text-align: left; 
        padding: 0 0.5rem;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .card {
        flex: 1 1 100%; /* 手機版自動佔滿 100% 寬度，垂直排列 */
    }
    
    .card img {
        height: 180px; /* 手機版微調相片高度 */
    }
}