/* ==========================================================================
   1. GLOBAL VARIABLES & RESET (通用全域設定)
   ========================================================================== */
:root {
    --primary: #0a2540;
    --accent: #0088cc;
    --accent-green: #1a5e3a;
    --accent-green-hover: #13472c;
    --light-green: #f0fdf4;
    --light-bg: #f8fafc;
    --card-bg: #f1f5f9;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --logo-text:#4C4B4B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
}

.global-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   2. GLOBAL HEADER & FOOTER (跨頁共用頁首與頁尾)
   ========================================================================== */
header {
    background-color: var(--white);
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-right: 0rem;
    padding-bottom: 1rem;
    padding-left: 0rem;
    position: relative;
}


.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo span {
    color: var(--logo-text);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: var(--accent-green);
}

.lang-select {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
}

footer {
    background: #061727;
    color: #a0aec0;
    padding: 3rem 2rem 1.5rem 2rem;
    font-size: 0.85rem;
    position: relative;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    display: grid;
    grid-template-columns: 2fr repeat(5, 1fr);
    gap: 2rem;
}

.footer-col h5 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid #1a202c;
    padding-top: 1.5rem;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-to-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.back-to-top:hover {
    background: rgba(255,255,255,0.1);
}

/* ================= Dropdown Navigation CSS ================= */
nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.2rem; /* 控制主選單項目之間的整體間距 */
}

nav ul li {
    position: relative;
}

nav ul li a, .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.6rem 0.7rem; /* 縮小左右與上下 Padding */
    color: var(--text-dark, #0f172a);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem; /* 微調字級 */
    transition: color 0.3s;
    cursor: pointer;
    white-space: nowrap; /* 避免文字意外斷行 */
}

nav ul li a:hover, .dropdown-toggle:hover {
    color: var(--accent-green, #1a5e3a);
}

/* 下拉選單子項目間距優化 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px; /* 稍微縮小下拉選單寬度 */
    background-color: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease-in-out;
    z-index: 1000;
}

/* Hover 時顯示下拉選單 */
nav ul li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    padding: 0.5rem 1rem; /* 下拉選單項目的上下與左右間距同步縮小 */
    font-size: 0.88rem;
    color: #475569;
    display: block;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu li a:hover {
    background-color: #f1f5f9;
    color: var(--accent-green, #1a5e3a);
}

@media (max-width: 992px) {
    .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        padding-right: 2rem;
        padding-bottom: 1rem;
        padding-left: 2rem;
        position: relative;
    }
}


nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.2rem;
}

nav ul li {
    position: relative;
}

nav ul li a, .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.6rem 0.7rem;
    color: var(--text-dark, #0f172a);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

/* Hover 懸停與 Active 當前頁面效果 */
nav ul li a:hover,
.dropdown-toggle:hover,
nav ul li a.active {
    color: var(--accent-green, #1a5e3a);
    font-weight: 700;
}

/* 如果希望當前頁面底下有一條綠色底線 */
nav ul li > a.active {
    border-bottom: 2px solid var(--accent-green, #1a5e3a);
}

.hero-desc {
    color: var(--text-muted, #475569);
    font-size: 0.92rem;
    line-height: 1.7;
}

.hero-desc p {
    margin-bottom: 1rem;
}


.hero-text {
    max-width: 520px;
    z-index: 2;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

.hero-title span {
    color: var(--accent-green, #008800);
    display: block;
}