/* style2.css */

/* --- 全局設定 --- */
:root {
    --primary-color: #0056b3; /* 企業藍 */
    --accent-color: #e74c3c;   /* 強調色 (紅) */
    --text-color: #333;
    --bg-light: #fff;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: '微軟正黑體', sans-serif;
}

/* --- 導航列容器 --- */
header {
    background-color: var(--bg-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between; /* 關鍵：Logo左，選單右 */
    align-items: center;
    padding: 0 20px;
}

/* --- Logo 樣式 --- */
.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
}

/* --- 選單列表 --- */
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px; /* 選單項目間距 */
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    display: block;
    padding: 10px 5px;
}

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

/* --- 下拉選單 (Dropdown) --- */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; /* 靠左對齊父元素 */
    background-color: #fff;
    min-width: 240px; /* 下拉選單寬度 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 10px 0;
    z-index: 999;
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content a {
    padding: 12px 20px;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding-left: 25px; /* 懸停時輕微位移效果 */
}

/* 顯示下拉選單 (電腦版 Hover) */
.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropbtn i {
    font-size: 0.8rem;
    margin-left: 5px;
    transition: transform 0.3s;
}

.dropdown:hover .dropbtn i {
    transform: rotate(180deg); /* 箭頭旋轉 */
}

/* --- 16年經驗 Badge --- */
.badge-experience {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: text-top;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.4);
    white-space: nowrap; /* 防止文字換行 */
}

/* --- 聯絡我們按鈕 --- */
.btn-contact {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 50px;
}

.btn-contact:hover {
    background-color: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

/* --- 漢堡按鈕 --- */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* --- RWD 手機版樣式 (<= 768px) --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        right: -100%; /* 隱藏在右側外 */
        width: 70%;
        height: calc(100vh - var(--nav-height));
        background-color: #fff;
        flex-direction: column; /* 改為垂直排列 */
        align-items: flex-start;
        padding: 20px;
        transition: right 0.4s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        overflow-y: auto; /* 內容過長可捲動 */
    }

    .nav-links.active {
        right: 0; /* 滑入 */
    }

    .nav-links li {
        width: 100%;
        margin-bottom: 10px;
    }

    .nav-links a {
        width: 100%;
        padding: 15px;
    }

    /* 手機版下拉選單處理 */
    .dropdown:hover .dropdown-content {
        display: none; /* 禁用 Hover */
    }

    .dropdown-content {
        position: static; /* 取消絕對定位 */
        box-shadow: none;
        padding-left: 20px;
        background-color: #f9f9f9;
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block; /* 透過 JS 開啟 */
    }
    
    .badge-experience {
        float: right;
        margin-top: 2px;
    }
}

/* 動畫 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}