/* ========== i18n 載入前隱藏頁面，避免語言閃爍 ========== */
body:not(.i18n-ready) {
    opacity: 0;
}
body.i18n-ready {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* i18n: 與 main_simulation 表單統一的輸入高度，避免不同瀏覽器造成垂直位移 */
.standard-input,
.standard-select {
  height: 36px;
}

/* ========== 按鈕與間距修正 (2026-01-22) ========== */
.container {
    margin-top: 70px !important;
    padding-top: 0px !important;
}
#resetButton, #guideButton, #guidedSetupButton, #open-visual-canvas-btn {
    top: 0px !important;
}
/* 基本資料/進階資料區塊與按鈕的間距 */
.finance-sections {
    margin-top: 70px !important;
    padding-top: 0px !important;
}
@media screen and (max-width: 768px) {
    .container {
        margin-top: 70px !important;
        padding-top: 0px !important;
    }
    .finance-sections {
        margin-top: 80px !important;
        padding-top: 0px !important;
    }
}
/* 通用樣式（不與頁頭頁尾重複） */

.contact-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1565c0; /* 使用相同的深藍色 */
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background: #1e88e5; /* 使用相同的主藍色 */
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #1565c0; /* 使用相同的深藍色 */
}

@media (max-width: 768px) {
    .contact-container {
        margin: 1rem;
    }
    
    .contact-form {
        padding: 1rem;
    }
}

:root {
    --gradient-start: #1e88e5;
    --gradient-end: #64b5f6;
    --dark-blue: #1565c0;
    --light-blue: #90caf9;
}

/* 頁首樣式 */
.gradient-header {
    background: linear-gradient(
        135deg,
        var(--gradient-start) 0%,
        var(--gradient-end) 70%,
        var(--gradient-end) 100%
    );
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    box-sizing: border-box;
    max-width: 100vw;
    overflow: visible;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 50px;
}

.gradient-header .logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.gradient-header .logo img {
    height: 40px;
    width: auto;
    padding: 2px 0;
}

.gradient-header .nav-links {
    display: flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.gradient-header .nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: inline-block;
}

.gradient-header .nav-links a:hover {
    background-color: var(--dark-blue);
}

/* 語言下拉（全站共用樣式） */
.language-dropdown { position: relative; }
/* 讓切換語言外觀與其他導覽連結一致，且不顯示下拉符號 */
.language-toggle {
    display: inline-block; background: transparent; border: none; color: #fff;
    cursor: pointer; padding: 0.3rem 0.5rem; font-size: inherit; font-weight: inherit;
    line-height: 1.2; border-radius: 4px; vertical-align: middle; font-family: inherit;
    -webkit-appearance: none; appearance: none;
}
.language-toggle:hover { background-color: var(--dark-blue); }
.language-toggle:focus { outline: none; }
.language-toggle .dropdown-arrow { display: none !important; }
.language-menu {
    position: absolute; top: calc(100% + 0.5rem); right: 0;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(15px);
    border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.3); min-width: 140px;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.3s ease; z-index: 10000;
}
.language-dropdown.open .language-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.language-option {
    display: flex; width: 100%; align-items: center; gap: 8px;
    background: transparent; border: none; cursor: pointer;
    padding: 10px 14px; color: #333; font-weight: 600;
}
.language-option:hover { background: rgba(0,0,0,0.05); }
.language-option .flag, .language-toggle .current-flag { display: none; }

/* 頁尾樣式 */
.gradient-footer {
    background: linear-gradient(
        135deg,
        var(--gradient-end) 0%,
        var(--gradient-start) 70%,
        var(--gradient-start) 100%
    );
    color: white;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    box-sizing: border-box;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 1000;
}

.gradient-footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.gradient-footer .footer-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.gradient-footer .copyright {
    color: white;
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
    margin-top: 0.25rem;
}

.gradient-footer a {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.gradient-footer a:hover {
    background-color: var(--dark-blue);
}

/* 響應式樣式 */
/* 小屏到中屏過渡：451px-576px - 使用漢堡選單 */
@media (max-width: 576px) and (min-width: 451px) {
    .gradient-header {
        padding: 0.65rem 0.9rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        position: relative;
    }
    
    .gradient-header .logo {
        font-size: 1.25rem;
        max-width: 70%;
    }
    
    .gradient-header .logo img {
        max-height: 34px;
        width: auto;
    }
    
    /* 桌面版導航隱藏 */
    .gradient-header .nav-links-desktop {
        display: none !important;
    }
    
    /* 漢堡按鈕顯示 */
    .mobile-menu-btn {
        display: flex !important;
        margin-left: auto;
    }
}

/* 小屏幕：450px以下 - 使用漢堡選單 */
@media (max-width: 450px) {
    .gradient-header {
        padding: 0.6rem 0.8rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        position: relative;
    }
    
    .gradient-header .logo {
        font-size: 1.2rem;
        max-width: 70%;
    }
    
    .gradient-header .logo img {
        max-height: 32px;
        width: auto;
    }
    
    /* 桌面版導航隱藏 */
    .gradient-header .nav-links-desktop {
        display: none !important;
    }
    
    /* 漢堡按鈕顯示 */
    .mobile-menu-btn {
        display: flex !important;
        margin-left: auto;
    }
    
    /* 手機版下拉選單在小屏幕的調整 */
    .mobile-nav-dropdown a {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .gradient-footer {
        padding: 0.6rem 0.8rem;
    }
    
    .gradient-footer .footer-content {
        padding: 0;
        gap: 0.25rem;
    }
    
    .gradient-footer .copyright {
        font-size: 0.8rem;
        margin-top: 0.15rem;
    }
    
    .gradient-footer a {
        font-size: 0.8rem;
        padding: 0.25rem 0.4rem;
    }
}

/* 超小屏幕：320px-380px - 使用漢堡選單 */
@media (max-width: 380px) {
    .gradient-header {
        padding: 0.5rem 0.8rem;
        position: relative;
    }
    
    .gradient-header .logo {
        max-width: 70%;
        font-size: 1.1rem;
    }
    
    .gradient-header .logo img {
        max-height: 28px;
    }
    
    /* 桌面版導航隱藏 */
    .gradient-header .nav-links-desktop {
        display: none !important;
    }
    
    /* 漢堡按鈕顯示 */
    .mobile-menu-btn {
        display: flex !important;
        margin-left: auto;
        width: 36px;
        height: 36px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
    }
    
    /* 手機版下拉選單在超小屏幕的調整 */
    .mobile-nav-dropdown a {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    .gradient-footer .copyright {
        font-size: 0.75rem;
    }
}

/* 漢堡按鈕樣式 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 10000;
    margin-left: auto;
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* 漢堡按鈕動畫 - 轉換成X */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 手機版下拉選單樣式 */
.mobile-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(
        135deg,
        var(--gradient-start) 0%,
        var(--gradient-end) 70%,
        var(--gradient-end) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 0;
    overflow: visible; /* 允許內部下拉（語言選單）超出容器顯示 */
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.mobile-nav-dropdown.active {
    max-height: 400px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.mobile-nav-dropdown a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center; /* 手機下拉文字置中 */
}

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

.mobile-nav-dropdown a:hover,
.mobile-nav-dropdown a:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 確保手機版選單在所有斷點都能正確顯示 */
@media (max-width: 768px) {
    .gradient-header {
        position: relative;
        overflow: visible !important;
    }
    
    .mobile-nav-dropdown {
        display: block !important;
    }
    /* 手機版：語言下拉容器置中且佔滿整列 */
    .mobile-nav-dropdown .language-dropdown {
        width: 100%;
        display: flex;
        justify-content: center;
        position: relative;
        padding: 0.5rem 0; /* 與其他項目留點距離 */
    }
    .mobile-nav-dropdown .language-menu {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -10px) !important;
        min-width: 160px;
    }
    .mobile-nav-dropdown .language-dropdown.open .language-menu {
        transform: translate(-50%, 0) !important;
    }

    /* 移除開始模擬左側裝飾線，置中更協調 */
    .mobile-nav-dropdown a[href="main_simulation.html"] {
        border-left: none;
    }
    
    /* 確保桌面版導航在手機版時隱藏 */
    .nav-links-desktop {
        display: none !important;
    }
    
    /* 確保漢堡按鈕在手機版時顯示 */
    .mobile-menu-btn {
        display: flex !important;
    }
}

/* 特殊處理"開始模擬"按鈕在手機版中的樣式 */
.mobile-nav-dropdown a[href="main_simulation.html"] {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    font-weight: bold;
    border-left: 4px solid white;
}

.mobile-nav-dropdown a[href="main_simulation.html"]:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
}

/* 調試用：強制顯示手機版選單 (可在開發時啟用) */
/*
@media (max-width: 768px) {
    .mobile-nav-dropdown {
        max-height: 400px !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        border: 2px solid red;
        background: rgba(30, 136, 229, 0.9) !important;
    }
}
*/

@media (hover: none) {
    .gradient-header .nav-links a:active {
        background-color: var(--dark-blue);
    }
    
    .mobile-menu-btn:active {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* 桌面版螢幕：769px以上 */
@media (min-width: 769px) {
    /* 確保桌面版導航顯示 */
    .gradient-header .nav-links,
    .gradient-header .nav-links-desktop {
        display: flex !important;
    }
    
    /* 確保漢堡按鈕隱藏 */
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* 確保手機版選單隱藏 */
    .mobile-nav-dropdown {
        display: none !important;
    }
}

/* 中大寬度屏幕：769px-992px */
@media (max-width: 992px) and (min-width: 769px) {
    .gradient-header .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* 中等寬度屏幕：577px-768px - 使用漢堡選單 */
@media (max-width: 768px) and (min-width: 577px) {
    .gradient-header {
        padding: 0.7rem 1rem;
        position: relative;
    }
    
    .gradient-header .logo {
        font-size: 1.3rem;
        max-width: 70%;
    }
    
    .gradient-header .logo img {
        max-height: 35px;
    }
    
    /* 桌面版導航隱藏 */
    .gradient-header .nav-links-desktop {
        display: none !important;
    }
    
    /* 漢堡按鈕顯示 */
    .mobile-menu-btn {
        display: flex !important;
        margin-left: auto;
    }
} 
/* ========== Cookie 同意橫幅 ========== */
#cookieConsentBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e1e2f 0%, #2d2d44 100%);
    color: #fff;
    padding: 16px 20px;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: cookieSlideUp 0.4s ease;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#cookieConsentBanner.cookie-slide-out {
    animation: cookieSlideDown 0.3s ease forwards;
}

@keyframes cookieSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    min-width: 280px;
}

.cookie-consent-content p i {
    color: #f59e0b;
    margin-right: 8px;
}

.cookie-consent-content a {
    color: #a78bfa;
    text-decoration: underline;
}

.cookie-consent-content a:hover {
    color: #c4b5fd;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn-accept {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@media (max-width: 600px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-consent-content p {
        min-width: auto;
    }
}

/* ========================================
   index.html 首頁專用樣式
   從 HTML inline <style> 移出至獨立 CSS 檔案
   由 webpack bundle 打包壓縮
   ======================================== */

:root {
    --bg-color: #e6e6e6;
    --border-color: rgba(30, 136, 229, 0.15); /* 稍微加深邊框 */
    --section-bg: #f1f5f9; /* 更深的分區背景色 */
    --hover-shadow: rgba(30, 136, 229, 0.2); /* 加深懸停陰影 */
}

body {
    background-color: var(--bg-color); /* 修改背景色 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
    width: 100%;
    overflow-x: hidden; /* 防止水平滾動 */
}

html {
    width: 100%;
    overflow-x: hidden;
}

/* 主要內容區 */
.main-content {
    margin-top: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 全寬度區塊容器 */
.section {
    width: 100%;
    max-width: 100%;
    padding: 4rem 0;
    position: relative;
    overflow-x: hidden;
}

/* 漸層背景 - 白色漸層一點點藍色 */
.section.light-gradient {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(240, 248, 255, 1) 30%, 
        rgba(230, 245, 255, 1) 70%, 
        rgba(220, 240, 255, 1) 100%);
}

/* 漸層背景 - 淡紫色漸層白色 */
.section.purple-gradient {
    background: linear-gradient(135deg, 
        rgba(248, 246, 255, 1) 0%, 
        rgba(240, 235, 255, 1) 30%, 
        rgba(235, 230, 255, 1) 70%, 
        rgba(255, 255, 255, 1) 100%);
}

/* 現代化無容器設計 */
.section-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    width: 100%;
    box-sizing: border-box;
}

/* 大標題區域 */
.hero-title {
    text-align: center;
    margin-bottom: 4rem;
    padding: 0 2rem;
}

.hero-title h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-title p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: rgba(0, 0, 0, 0.7);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 400;
}

/* 內容網格佈局 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.content-block {
    padding: 0;
    margin: 0;
}

.content-block h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gradient-start);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.content-block h3 i {
    font-size: 0.9em;
    opacity: 0.8;
}

.content-block p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* 重點小容器 */
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.highlight-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.highlight-card .icon {
    font-size: 2.5rem;
    color: var(--gradient-start);
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

/* 增強的卡片懸停效果 */
.highlight-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.highlight-card:hover .icon {
    transform: scale(1.1);
}

.highlight-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gradient-start);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.highlight-card p {
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.5;
    margin: 0;
}

/* 簡化列表 */
.simple-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.simple-list li {
    padding: 0.8rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
    position: relative;
    padding-left: 1.5rem;
}

.simple-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--gradient-start);
    font-weight: bold;
}

/* 全寬內容區域 */
.full-width-content {
    width: 100%;
    padding: 0 3rem;
}

.text-center {
    text-align: center;
}

/* 新聞項目重新設計 */
.news-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border-left: 4px solid var(--gradient-start);
    transition: all 0.3s ease;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(8px);
}

.news-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gradient-start);
    margin-bottom: 0.5rem;
    display: block;
}

.news-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .section {
        padding: 2rem 0;
        width: 100%;
        max-width: 100%;
    }

    .section-content {
        padding: 0 1rem;
        max-width: 100%;
        width: 100%;
    }
    
    .main-content {
        width: 100%;
        max-width: 100%;
    }

    .content-container {
        padding: 0 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .content-card {
        padding: 2rem;
    }
    
    /* 五大模組響應式調整 */
    .highlight-grid[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .highlight-grid[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* 調整全寬內容區域的間距 */
    .full-width-content {
        padding: 0 1rem;
    }
    
    /* 調整重點卡片在小螢幕的間距 */
    .highlight-grid {
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .highlight-card {
        padding: 1.5rem;
    }
}

/* 平板尺寸調整 */
@media (max-width: 991px) and (min-width: 769px) {
    .section-content {
        padding: 0 2rem;
    }
    
    .highlight-grid[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    .full-width-content {
        padding: 0 2rem;
    }
    
    /* 平板尺寸的時間線調整 */
    .news-timeline {
        padding: 0 1.5rem;
        max-width: calc(100% - 3rem);
    }
    
    .timeline-content {
        padding: 1.3rem;
    }
}

/* YouTube 影片區塊樣式 */
.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 60vh;
    margin-top: 0;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw; /* 設置為視窗寬度 */
    height: 56.25vw; /* 保持 16:9 的比例 (9/16 = 0.5625) */
    min-height: 100%;
    min-width: 177.77vh; /* 保持 16:9 的比例 (16/9 = 1.7777) */
}

.video-bg iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    z-index: 2;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.1) 0%, 
        rgba(0,0,0,0.05) 40%, 
        rgba(0,0,0,0.05) 60%, 
        rgba(0,0,0,0.1) 100%);
}

.video-overlay h1 {
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.9);
    padding: 0 1rem;
}

.play-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* 調整主要內容區域的邊距 */
.main-content {
    margin-top: 0;
}

@media (max-width: 768px) {
    .video-container {
        height: 40vh;
    }

    .video-overlay h1 {
        font-size: 1.8rem;
    }
}

/* 微調 gradient-header（保留 header-footer.css 的 position:fixed） */
.gradient-header {
    height: 52px;
    padding: 4px 1rem;
}

/* 調整 logo 容器 */
.gradient-header .logo {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 10px;  /* 微調 logo 的左側間距 */
}

.simulation-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.simulation-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: #666;
}

.input-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 0.9rem;
}

#stdDev {
    display: none; /* 隱藏標準差輸入欄位 */
}

.simulation-controls {
    margin: 1rem 0;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 450px;  /* 增加高度以提高解析度 */
    width: 100%;
    margin: 1rem 0;
}

canvas#simulationChart {
    width: 100% !important;
    height: 100% !important;
}

.simulation-summary {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.8rem;  /* 降低字體大小 */
}

.simulation-summary p {
    margin: 0.2rem 0;
}

/* 現代化按鈕樣式 */
.run-simulation-btn {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.run-simulation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(30, 136, 229, 0.4);
    background: linear-gradient(45deg, var(--gradient-end), var(--gradient-start));
}

.run-simulation-btn:active {
    transform: translateY(-1px);
}

/* 現代化輸入框樣式 */
.input-group input {
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    width: 50%;
    max-width: 200px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    border-color: var(--gradient-start);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    background: white;
}

.input-group label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: rgba(0, 0, 0, 0.8);
    font-weight: 600;
    display: block;
}

.story-section {
    margin: 1rem 0 2rem 0;
    padding: 1.5rem;
    background: var(--section-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gradient-start);
}

.story-section h3 {
    color: var(--gradient-start);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* 影片容器後面的標題需要更小的上邊距 */
.story-section .video-container + h3 {
    margin-top: 0.5rem;
}

.story-content {
    color: #333;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.story-hint {
    color: #666;
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* 調整預設值 */
#returnRate {
    value: "5"
}

.explanation-section {
    margin-top: 1rem;
}

.explanation-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.explanation-section li {
    margin: 0.5rem 0;
    color: #555;
}

.ai-analysis {
    margin-top: 1.5rem;
}

.analysis-section {
    margin: 1.2rem 0;
}

.analysis-section h4 {
    color: var(--gradient-start);
    margin-bottom: 0.5rem;
}

.analysis-section ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.analysis-section li {
    margin: 0.5rem 0;
    color: #555;
}

/* 進階說明區塊樣式 */
.advanced-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #ccc;
}

.advanced-section h3 {
    color: var(--gradient-start);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-content {
    background: var(--section-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.advanced-content ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.advanced-content li {
    margin: 1rem 0;
    color: #555;
    line-height: 1.6;
}

.advanced-content strong {
    color: var(--gradient-start);
}

.technical-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* 修改 VIP 標籤樣式 */
.vip-badge {
    position: absolute;
    top: 2.1rem; /* 調整與標題的對齊 */
    right: 2rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: shine 2s infinite;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    margin-top: 2px; /* 微調垂直位置 */
}

@keyframes shine {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 調整頁尾樣式 */
.gradient-footer {
    margin-top: 3rem; /* 增加與內容的間距 */
}

/* 移除舊的分區樣式，已由新的 content-card 樣式取代 */

/* 功能表格樣式 */
.feature-table-container {
    margin-top: 1.5rem;
    overflow: visible;
}

.feature-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--section-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.feature-table th,
.feature-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.feature-table th {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white;
    font-weight: normal;
}

.feature-table tr:last-child td {
    border-bottom: none;
}

.feature-table tr:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* 勾叉符號樣式 */
.check {
    color: #4CAF50;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cross {
    color: #FF5252;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.check i {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.cross i {
    background: rgba(255, 82, 82, 0.1);
    border-radius: 50%;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.check i:hover, .cross i:hover {
    transform: scale(1.1);
}

.premium {
    position: relative;
}

.premium::after {
    display: none;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .feature-table th,
    .feature-table td {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* 修改工具提示基礎樣式 */
.tooltip-text,
.scenario-tooltip,
.record-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed #666;
}

/* 工具提示容器 */
.tooltip-container {
    position: relative; /* 改為固定定位 */
    z-index: 1000;
    pointer-events: none;
    max-width: 400px;
    background: #2c3e50;
    color: white;
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

/* JavaScript 動態添加的類 */
.tooltip-container.visible {
    opacity: 1;
    visibility: visible;
}

/* 移除原有的 after 偽元素 */
.tooltip-text::after,
.scenario-tooltip::after,
.record-tooltip::after {
    display: none;
}

.story-points,
.vision-points {
    margin: 1.2rem 0;
    padding-left: 1.5rem;
    list-style-type: none;
}

.story-points li,
.vision-points li {
    margin: 0.8rem 0;
    position: relative;
    line-height: 1.6;
    color: #555;
}

.story-points li::before {
    content: "•";
    color: var(--gradient-start);
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
}

.vision-points li::before {
    content: "✧";
    color: var(--gradient-end);
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
}

.story-content {
    color: #333;
    line-height: 1.8;
    margin: 1.2rem 0;
}

@media (max-width: 576px) {
    .section {
        padding: 1.5rem 0;
    }

    .section-content {
        padding: 0 0.8rem;
        max-width: 100%;
        width: 100%;
    }

    .content-container {
        padding: 0 0.8rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .chart-container {
        height: 300px;
    }
    
    /* 進一步減少小螢幕的間距 */
    .full-width-content {
        padding: 0 0.8rem;
    }
    
    .highlight-grid {
        gap: 0.8rem;
        margin: 1rem 0;
    }
    
    .highlight-card {
        padding: 1.2rem;
    }
    
    .hero-title {
        padding: 0 1rem;
        margin-bottom: 2rem;
    }
}

#changing-title {
    transition: opacity 0.5s ease-in-out;
}

/* 重新設計的時間線消息樣式 */
.news-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem; /* 添加左右內邊距 */
    box-sizing: border-box; /* 確保padding包含在寬度內 */
    width: 100%; /* 確保容器不會超出父元素 */
    overflow: visible; /* 改為可見，讓圖標和徽章能顯示 */
    z-index: 5; /* 提高整個時間線區塊的層級 */
}

.timeline-item {
    display: flex;
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 1rem;
    width: 100%; /* 確保項目不會超出容器 */
    box-sizing: border-box;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 3.5rem;
    top: 0;
    bottom: -2.5rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(30, 136, 229, 0.3) 0%, rgba(74, 144, 226, 0.1) 100%);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-date {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    min-width: 70px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

.timeline-date .month {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gradient-start);
}

.timeline-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.timeline-date .year {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.timeline-content {
    flex: 1;
    margin-left: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    padding-top: 2rem; /* 增加頂部邊距來容納圖標和徽章 */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transition: all 0.3s ease;
    min-width: 0; /* 防止flex項目超出容器 */
    overflow-wrap: break-word; /* 確保長文字會換行 */
    word-wrap: break-word;
    z-index: 1; /* 確保內容容器有基礎層級 */
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.timeline-icon {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    width: 2rem;
    height: 2rem;
    background: var(--gradient-start);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
    z-index: 10; /* 大幅提高圖標層級 */
}

.timeline-content h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.timeline-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.timeline-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    z-index: 10; /* 大幅提高徽章層級 */
    max-width: calc(100% - 1rem); /* 防止徽章超出容器 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-item.featured .timeline-content {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 255, 255, 0.6) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.timeline-item.featured .timeline-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

@media (max-width: 767px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 0;
        width: 100%;
        max-width: 100%; /* 確保不會超出容器 */
    }

    .timeline-item::before {
        display: none;
    }

    .timeline-date {
        margin-bottom: 1rem;
        align-self: flex-start;
    }

    .timeline-content {
        margin-left: 0;
        width: 100%;
        padding: 1.2rem; /* 減少小螢幕的內邊距 */
        padding-top: 1.7rem; /* 為圖標和徽章保留空間 */
        max-width: 100%; /* 確保內容不會超出容器 */
    }
    
    /* 調整時間線在小螢幕的間距 */
    .news-timeline {
        padding: 0 0.8rem; /* 減少小螢幕的左右邊距 */
        max-width: 100%; /* 確保不會超出螢幕邊緣 */
        width: 100%;
    }
}

@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

/* 極小螢幕的額外調整 */
@media (max-width: 480px) {
    .section-content {
        padding: 0 0.5rem;
        max-width: 100%;
        width: 100%;
    }
    
    .news-timeline {
        padding: 0 0.3rem; /* 進一步減少極小螢幕的邊距 */
        max-width: 100%; /* 確保不會超出螢幕邊緣 */
        width: 100%;
    }
    
    .timeline-content {
        padding: 1rem; /* 進一步減少內容內邊距 */
        padding-top: 1.5rem; /* 為圖標和徽章保留空間 */
        margin-left: 0;
        max-width: 100%; /* 確保內容不會超出容器 */
    }
    
    .timeline-date {
        min-width: 60px; /* 減少日期容器的最小寬度 */
        padding: 0.6rem;
    }
    
    .timeline-content h5 {
        font-size: 1.1rem; /* 減少標題字體大小 */
    }
    
    .timeline-content p {
        font-size: 0.9rem; /* 減少內容字體大小 */
    }
    
    .timeline-icon {
        width: 1.8rem; /* 稍微縮小圖標 */
        height: 1.8rem;
        font-size: 0.8rem;
    }
    
    .timeline-badge {
        padding: 0.2rem 0.6rem; /* 減少徽章內邊距 */
        font-size: 0.7rem;
        max-width: calc(100% - 0.5rem); /* 調整最大寬度 */
    }
}

/* 超小螢幕的額外調整 */
@media (max-width: 360px) {
    .section-content {
        padding: 0 0.3rem;
        max-width: 100%;
        width: 100%;
    }
    
    .news-timeline {
        padding: 0 0.2rem; /* 極小螢幕的邊距 */
        max-width: 100%;
        width: 100%;
    }
    
    .timeline-content {
        padding: 0.8rem; /* 極小螢幕的內容內邊距 */
        padding-top: 1.3rem; /* 為圖標和徽章保留空間 */
    }
    
    .main-content {
        width: 100%;
        max-width: 100%;
    }
    
    .section {
        width: 100%;
        max-width: 100%;
    }
}

/* 確保所有螢幕尺寸下都不會有水平滾動 */
@media (max-width: 480px) {
    * {
        max-width: 100% !important;
    }
    
    .section-content,
    .news-timeline,
    .timeline-content,
    .timeline-item {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 開始模擬按鈕動畫效果 */
.nav-links a[href="main_simulation.html"] {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white !important;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.nav-links a[href="main_simulation.html"]:hover {
    box-shadow: 0 6px 25px rgba(30, 136, 229, 0.4);
    transform: translateY(-2px);
}

.nav-links a[href="main_simulation.html"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3498db, #2980b9, #1abc9c, #3498db);
    background-size: 300% 300%;
    border-radius: 27px;
    z-index: -1;
    animation: gradient-flow 3s ease infinite;
}

.nav-links a[href="main_simulation.html"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s ease-in-out infinite;
    border-radius: 25px;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 語言下拉選單樣式 */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-toggle {
    display: inline-block; /* 與導覽連結一致 */
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.3rem 0.5rem; /* 與連結高度一致 */
    font-size: inherit; /* 使用導覽連結字體大小 */
    font-weight: inherit; /* 與其他連結一致 */
    line-height: 1.2;
    border-radius: 4px;
    vertical-align: middle;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    text-decoration: none;
}

.language-toggle:hover { background-color: var(--gradient-start); }

.current-flag {
    font-size: 1.1rem;
    display: none; /* 隱藏國旗 */
}

.current-text {
    font-weight: 500;
}

.dropdown-arrow { display: none !important; }

.language-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

    .language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
        right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
        transform: translateY(-10px);
    transition: all 0.3s ease;
        z-index: 10000; /* 提升層級，避免被手機選單遮擋 */
}

    .language-dropdown.open .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
}

.language-option:first-child {
    border-radius: 12px 12px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 12px 12px;
}

.language-option:hover {
    background: rgba(30, 136, 229, 0.1);
    color: var(--gradient-start);
}

.language-option.active {
    background: rgba(30, 136, 229, 0.15);
    color: var(--gradient-start);
    font-weight: 600;
}

.language-option .flag {
    font-size: 1rem;
    display: none; /* 隱藏國旗 */
}

.language-option .text {
    font-weight: 500;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .nav-links a[href="main_simulation.html"] {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* 手機版語言下拉選單調整 */
    .language-toggle {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .current-text {
        display: inline; /* 手機版顯示文字，避免只見旗幟 */
    }
    
    .current-flag {
        font-size: 1.2rem;
    }
    
    /* 手機：在漢堡選單中置中顯示 */
    .mobile-nav-dropdown .language-dropdown { 
        width: 100%; display: flex; justify-content: center; position: relative; padding: 0.5rem 0; 
    }
    .mobile-nav-dropdown .language-menu { 
        left: 50% !important; right: auto !important; transform: translate(-50%, -10px) !important; min-width: 160px; 
    }
    .mobile-nav-dropdown .language-dropdown.open .language-menu { 
        transform: translate(-50%, 0) !important; 
    }
    
    .language-option {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .language-option .text {
        font-size: 0.85rem;
    }
}

/* 響應式影片容器 */
.responsive-video-container {
    width: 100%;
    margin: 2rem 0;
}

.responsive-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #000;
    transition: all 0.3s ease;
}

.responsive-video-wrapper:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.responsive-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
    object-fit: cover;
    transform: scale(1.1);
    transform-origin: center;
}

/* 大螢幕影片顯示 */
@media (min-width: 1200px) {
    .video-showcase .responsive-video-container {
        width: 100%;
        max-width: none;
    }
}

/* 中等螢幕影片顯示 */
@media (min-width: 768px) and (max-width: 1199px) {
    .video-showcase .responsive-video-container {
        width: 100%;
    }
}

/* 手機螢幕影片顯示 */
@media (max-width: 767px) {
    .video-showcase .responsive-video-container {
        width: 100%;
        margin: 1.5rem 0;
    }
    
    .responsive-video-wrapper {
        border-radius: 12px;
    }
    
    /* 手機版改為單欄顯示 */
    .video-showcase .content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* 平板螢幕影片顯示 */
@media (max-width: 991px) {
    .video-showcase .content-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}

