/* ==========================================
   VANREX Global GOLD
   Responsive Financial Landing Page CSS
   (Refactored & Optimized by VANREX-羅)
   用途：首頁、Dashboard、圖表容器與 Desktop/Tablet/Mobile RWD。
========================================== */

/* ==========================
   1. 全域設定與變數 (Global)
========================== */
:root {
    --bg-dark: #050505;
    --card-bg: #111111;
    --gold-main: #D4AF37;
    --gold-hover: #F3E5AB;
    --text-white: #E0E0E0;
    --text-gray: #A0A0A0;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth !important;
    margin-top: 0px !important;
    padding-top: 0px !important;
    height: auto !important;
}

body, p, h1, h2, h3, span, div {
    /* 全域防破版：自動安全斷行 */
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    background: var(--bg-dark);
    color: var(--text-white);
    font-family: "Helvetica Neue", Arial, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    line-height: 1.6;
    top: 0px !important;
    position: static !important;
    min-height: 100vh !important;
    
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

iframe {
    width: 100% !important; 
}

/* ==========================
   2. 共用容器與元件 (Components)
========================== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.gold-text { color: var(--gold-main); }
.highlight-gold { color: var(--gold-main); font-weight: bold; }
.highlight-bold { color: #fff; font-weight: bold; border-bottom: 2px solid var(--gold-main); padding-bottom: 2px; }

/* 物理隱形墊片 (防導覽列遮擋錨點) */
section[id]::before {
    content: "";
    display: block;
    height: 120px;
    margin-top: -120px;
    visibility: hidden;
    pointer-events: none;
}

/* 按鈕共用 */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-main);
    color: #000;
    padding: 15px 40px;
    font-weight: bold;
    border-radius: 5px;
    transition: .3s;
    white-space: normal !important;
    text-align: center;
    height: auto !important;
    min-height: max-content;
}

.cta-btn:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
}

/* ==========================
   3. 導覽列與選單 (Header & Nav)
========================== */
header {
    position: sticky !important; 
    top: 0 !important;           
    z-index: 99999 !important;    
    width: 100% !important;
    background-color: #050505 !important; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important; 
    border-bottom: 1px solid rgba(212,175,55,.25);
    overflow: visible !important; 
}

.header-container {
    max-width: 1200px;
    margin: auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: visible !important;
}

/* Logo 設置 */
.logo { flex-shrink: 0 !important; }
.logo a {
    display: flex;
    align-items: center;  
    gap: 0px;             
    white-space: nowrap; 
}

.logo-img {
    width: 100px !important;         
    height: 100px !important;
    max-height: 100px !important;
    border: none;             
    background: transparent;  
    box-shadow: none;         
    flex-shrink: 0; 
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(243, 198, 35, 0.45));
    transition: all 0.3s ease;
}

.logo-text-group {
    display: flex;
    align-items: center; 
    flex-shrink: 0;
    margin-top: 14px;      
    margin-left: -18px;    
}

.logo-title, .brand-main {
    font-size: 1.55rem;   
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1.5px; 
    white-space: nowrap;
    line-height: 1;        
}

/* 選單結構 */
.nav-menu ul { flex-wrap: wrap; }
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 25px;
}
nav ul li { position: relative; }

/* 統一字體與大小 */
nav ul li a, 
nav ul li .dropbtn {
    font-size: 15px;                  
    font-weight: 700;                 
    color: #ffffff;                   
    white-space: nowrap;              
    transition: .3s;
    height: auto !important;
    min-height: max-content;
}

nav ul li a:hover, 
nav ul li .dropbtn:hover {
    color: #f3c623 !important;        
}

/* 下拉選單 */
.dropdown { position: relative; }
.dropbtn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
}
.dropbtn::after {
    content: "▼";                    
    font-size: 10px;                 
    margin-left: 6px;                
    display: inline-block;
    transition: transform 0.25s ease;
    opacity: 0.8;
}
.dropdown:hover .dropbtn::after {
    transform: rotate(180deg);       
    color: #f3c623;                  
    opacity: 1;
}

.dropdown-content {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 0 !important;
    min-width: 230px !important;
    padding: 8px 0 !important;
    background: #151515 !important;
    border: 1px solid rgba(212,175,55,.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.8) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: .3s;
    z-index: 100000 !important; 
    text-align: left;
}
.dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: #eee !important;
    text-align: left;
    white-space: normal !important;
    height: auto !important;
    min-height: min-content !important;
    line-height: 1.4 !important;
}
.dropdown-content a:hover {
    background: rgba(212,175,55,.15);
    color: var(--gold-main) !important;
}
.dropdown.active .dropdown-content {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* 隱藏選單也會參與 scrollWidth；最右側選單改靠右展開，避免 1024～1280px 溢出。 */
nav ul > li:nth-child(6) .dropdown-content {
    right: 0 !important;
    left: auto !important;
}

/* ==========================
   4. 語言選擇器 (Language Picker)
========================== */
.language-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    margin-left: 10px;
    flex-shrink: 0;
}
.lang-icon {
    width: 22px;
    height: 22px;
    stroke: #f3c623;
    transition: all 0.3s ease;
}
.language-picker:hover .lang-icon,
.language-picker.active .lang-icon {
    stroke: #ffffff;
    filter: drop-shadow(0 0 8px rgba(243, 198, 35, 0.9));
    transform: scale(1.1);
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 180px;
    max-height: 280px;                              
    overflow-y: auto;                               
    background: #0b1120;                            
    border: 1px solid rgba(243, 198, 35, 0.35);     
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 15px rgba(243, 198, 35, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
}
.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-dropdown::-webkit-scrollbar { width: 5px; }
.lang-dropdown::-webkit-scrollbar-track { background: rgba(11, 17, 32, 0.8); border-radius: 10px; }
.lang-dropdown::-webkit-scrollbar-thumb { background: rgba(243, 198, 35, 0.4); border-radius: 10px; }
.lang-dropdown::-webkit-scrollbar-thumb:hover { background: #f3c623; }

.lang-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: rgba(243, 198, 35, 0.15); color: #f3c623; }
.lang-option.active { color: #f3c623; font-weight: 700; }
.lang-option .lang-check { font-size: 12px; color: #f3c623; }

/* 阻擋 Google 翻譯干擾 */
.goog-te-banner-frame, .skiptranslate > iframe, #goog-gt-tt, 
.goog-te-balloon-frame, .goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background-color: transparent !important; box-shadow: none !important; }

/* ==========================
   5. 首屏英雄區 (Hero)
========================== */
.hero-section { padding: 60px 20px; }
.hero-card {
    width: 100%;
    max-width: 900px;
    margin: auto;
    padding: 80px 40px;
    text-align: center;
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,.8);
    height: auto !important;
    min-height: min-content !important;
}
.badge-newbie {
    display: inline-block;
    background: var(--gold-main);
    color: #000;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: .95rem;
    font-weight: bold;
    margin-bottom: 25px;
}
.hero-card h1 {
    margin: 0 0 20px;
    color: var(--gold-main);
    font-size: clamp(30px,5vw,52px);
    line-height: 1.3;
}
.hero-card p {
    max-width: 700px;
    margin: 0 auto 40px;
    color: var(--text-gray);
    font-size: 1.15rem;
}

/* ============================================================
   Global GOLD 主視覺卡
   僅作用於首頁此區塊，不影響其他內容與共用 hero-card。
============================================================ */
.global-gold-showcase {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    gap: clamp(30px, 4vw, 58px);
    width: 100%;
    max-width: 1180px;
    margin: auto;
    padding: clamp(40px, 5vw, 66px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 20%, rgba(243,198,35,.12), transparent 31%),
        linear-gradient(135deg, #171717 0%, #0d0d0d 55%, #11100c 100%);
    border: 1px solid rgba(243,198,35,.38);
    border-radius: 18px;
    box-shadow: 0 22px 55px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.035);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.global-gold-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .24;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(90deg, transparent 20%, #000 70%);
}

.global-gold-showcase:hover {
    transform: translateY(-3px);
    border-color: rgba(243,198,35,.6);
    box-shadow: 0 26px 62px rgba(0,0,0,.52), 0 0 30px rgba(243,198,35,.045), inset 0 1px 0 rgba(255,255,255,.04);
}

/* 左側產品訴求：以清楚的文字層級與重點清單引導主要 CTA。 */
.global-gold-showcase__content {
    position: relative;
    z-index: 1;
    align-self: center;
}

.global-gold-showcase__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #e8b928;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .2em;
}

.global-gold-showcase__eyebrow::before {
    content: "";
    width: 30px;
    height: 1px;
    background: linear-gradient(90deg, #e8b928, rgba(232,185,40,.2));
}

.global-gold-showcase__content h1 {
    margin: 0 0 18px;
    color: #f1c843;
    font-size: clamp(2.15rem, 3.45vw, 3.45rem);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.global-gold-showcase__content > p {
    max-width: 590px;
    margin: 0 0 25px;
    color: #b8bcc4;
    font-size: 1.04rem;
    line-height: 1.8;
}

.global-gold-showcase__benefits {
    display: grid;
    gap: 11px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.global-gold-showcase__benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e1e3e7;
    font-size: .95rem;
}

.global-gold-showcase__benefits li::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid rgba(243,198,35,.92);
    border-radius: 50%;
    background: rgba(243,198,35,.18);
    box-shadow: 0 0 0 4px rgba(243,198,35,.055);
}

.global-gold-showcase__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.global-gold-showcase__button {
    display: inline-flex;
    min-height: 46px;
    padding: 12px 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: .92rem;
    font-weight: 800;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.global-gold-showcase__button:hover { transform: translateY(-2px); }
.global-gold-showcase__button--primary { color: #080808; background: linear-gradient(135deg, #f3c623, #d9a916); }
.global-gold-showcase__button--primary:hover { background: linear-gradient(135deg, #ffda4d, #e8b928); }
.global-gold-showcase__button--secondary { color: #e8b928; border-color: rgba(243,198,35,.45); background: rgba(255,255,255,.025); }
.global-gold-showcase__button--secondary:hover { border-color: rgba(243,198,35,.75); background: rgba(243,198,35,.06); }

/* ============================================================
   XAUUSD 黃金市場監控視覺
   純 HTML/CSS 呈現抽象 K 線、趨勢與掃描狀態，不包含虛構行情數字。
============================================================ */
.global-gold-showcase__visual {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.global-gold-showcase__visual::before {
    content: "";
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    left: 11%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243,198,35,.12), transparent 66%);
    filter: blur(8px);
}

.global-gold-market-panel {
    position: relative;
    width: 100%;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(243,198,35,.34);
    border-radius: 14px;
    background: linear-gradient(150deg, rgba(29,29,27,.94), rgba(7,7,7,.92));
    box-shadow: 0 24px 50px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.04);
}

.global-gold-market-panel__header,
.global-gold-market-panel__metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.global-gold-market-panel__header strong { display: block; color: #f1c843; font-size: 1.12rem; letter-spacing: .08em; }
.global-gold-market-panel__header div span { color: #7f858e; font-size: .68rem; }
.global-gold-market-panel__status { padding: 6px 9px; color: #dcb540; font-size: .6rem; letter-spacing: .14em; border: 1px solid rgba(243,198,35,.3); border-radius: 20px; background: rgba(243,198,35,.055); }

.global-gold-market-panel__chart {
    position: relative;
    height: 220px;
    margin: 18px 0;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.05);
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 44px 44px;
}

.global-gold-market-panel__scan {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 56%;
    width: 1px;
    background: linear-gradient(transparent, rgba(243,198,35,.8), transparent);
    box-shadow: 0 0 20px rgba(243,198,35,.22);
}

.global-gold-market-panel__trend {
    position: absolute;
    z-index: 2;
    left: 7%;
    bottom: 25%;
    width: 86%;
    height: 2px;
    transform: rotate(-14deg);
    transform-origin: left center;
    background: linear-gradient(90deg, transparent, #cfa733 15%, #f6d65e 70%, transparent);
    box-shadow: 0 0 14px rgba(243,198,35,.18);
}

.global-gold-market-panel__candle {
    position: absolute;
    bottom: var(--bottom);
    left: var(--left);
    width: 9px;
    height: var(--height);
    border: 1px solid rgba(234,194,63,.75);
    background: rgba(234,194,63,.15);
}

.global-gold-market-panel__candle::before {
    content: "";
    position: absolute;
    top: -13px;
    bottom: -13px;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(234,194,63,.48);
}

.global-gold-market-panel__candle--1 { --left: 12%; --bottom: 23%; --height: 31px; }
.global-gold-market-panel__candle--2 { --left: 23%; --bottom: 35%; --height: 46px; }
.global-gold-market-panel__candle--3 { --left: 35%; --bottom: 31%; --height: 36px; border-color: rgba(165,168,173,.6); background: rgba(165,168,173,.1); }
.global-gold-market-panel__candle--4 { --left: 48%; --bottom: 45%; --height: 52px; }
.global-gold-market-panel__candle--5 { --left: 61%; --bottom: 51%; --height: 38px; }
.global-gold-market-panel__candle--6 { --left: 74%; --bottom: 58%; --height: 57px; border-color: rgba(165,168,173,.6); background: rgba(165,168,173,.1); }
.global-gold-market-panel__candle--7 { --left: 86%; --bottom: 66%; --height: 43px; }

.global-gold-market-panel__signal {
    position: absolute;
    z-index: 4;
    width: 8px;
    height: 8px;
    border: 2px solid #f3c623;
    border-radius: 50%;
    background: #15130c;
    box-shadow: 0 0 0 5px rgba(243,198,35,.08);
}

.global-gold-market-panel__signal--1 { left: 25%; bottom: 42%; }
.global-gold-market-panel__signal--2 { left: 51%; bottom: 55%; }
.global-gold-market-panel__signal--3 { right: 11%; top: 22%; }

.global-gold-market-panel__metrics span { flex: 1; min-width: 0; padding: 9px 8px; border-left: 1px solid rgba(243,198,35,.18); }
.global-gold-market-panel__metrics span:first-child { border-left: 0; }
.global-gold-market-panel__metrics small,
.global-gold-market-panel__metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.global-gold-market-panel__metrics small { margin-bottom: 4px; color: #7c8189; font-size: .56rem; letter-spacing: .11em; }
.global-gold-market-panel__metrics strong { color: #d6d8dc; font-size: .7rem; font-weight: 600; }

/* Tablet 與 Mobile：保持內容優先，視覺面板移至下方且禁止水平溢出。 */
@media (max-width: 960px) {
    .global-gold-showcase { grid-template-columns: minmax(0, 1fr) minmax(300px, .95fr); gap: 24px; padding: 38px 30px; }
    .global-gold-showcase__content h1 { font-size: clamp(2rem, 4.8vw, 2.8rem); }
    .global-gold-market-panel__chart { height: 190px; }
}

@media (max-width: 720px) {
    .global-gold-showcase { grid-template-columns: minmax(0, 1fr); padding: 32px 22px; }
    .global-gold-showcase__content h1 { font-size: clamp(1.9rem, 8vw, 2.45rem); }
    .global-gold-showcase__content > p { font-size: .96rem; }
    .global-gold-showcase__visual { width: 100%; }
}

@media (max-width: 420px) {
    .global-gold-showcase { padding: 27px 18px; border-radius: 14px; }
    .global-gold-showcase__actions { display: grid; grid-template-columns: 1fr; }
    .global-gold-showcase__button { width: 100%; }
    .global-gold-market-panel { padding: 15px; }
    .global-gold-market-panel__chart { height: 178px; }
    .global-gold-market-panel__metrics { gap: 3px; }
    .global-gold-market-panel__metrics span { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .global-gold-showcase,
    .global-gold-showcase__button { transition: none; }
    .global-gold-showcase:hover,
    .global-gold-showcase__button:hover { transform: none; }
}

/* ============================================================
   K 線情境圖手機版橫向捲動
   卡片與文字說明維持正常寬度，只有 SVG 圖表區可左右滑動
============================================================ */
.trading-chart-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-gutter: stable;
}

.trading-chart-scroll__inner {
    display: block;
    width: max(100%, 720px) !important;
    min-width: 720px !important;
    max-width: none !important;
    height: auto !important;
}

.trading-chart-scroll-hint {
    display: none;
    margin: 0 0 8px;
    color: #94a3b8;
    font-size: .78rem;
    letter-spacing: .03em;
    text-align: center;
}

.trading-chart-scroll:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 3px;
}

/* Tablet / Mobile 顯示操作提示；圖表維持原始閱讀寬度，不硬縮到裝置寬度。 */
@media (max-width: 960px) {
    .trading-chart-scroll-hint {
        display: block;
    }
}

/* ============================================================
   VANREX 品牌與外匯業務主視覺
   僅作用於首頁 .vanrex-intro-showcase，不影響其他區塊與共用元件。
============================================================ */
.vanrex-intro-showcase {
    position: relative;
    display: grid;
    /* Desktop 小幅增加左側文字欄，讓品牌主標維持完整單行。 */
    grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr);
    gap: clamp(32px, 3vw, 42px);
    width: 100%;
    max-width: 1180px;
    margin: auto;
    padding: clamp(42px, 5vw, 68px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 26%, rgba(232,185,40,.13), transparent 33%),
        radial-gradient(circle at 8% 100%, rgba(138,101,20,.07), transparent 34%),
        linear-gradient(135deg, #171717 0%, #0b0b0b 58%, #11100c 100%);
    border: 1px solid rgba(243,198,35,.36);
    border-radius: 18px;
    box-shadow: 0 22px 56px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.035);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.vanrex-intro-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(90deg, transparent 14%, #000 76%);
}

.vanrex-intro-showcase:hover {
    transform: translateY(-3px);
    border-color: rgba(243,198,35,.58);
    box-shadow: 0 27px 64px rgba(0,0,0,.52), 0 0 32px rgba(243,198,35,.045), inset 0 1px 0 rgba(255,255,255,.04);
}

/* 左側品牌定位：依序說明 VANREX、服務重點與內容入口。 */
.vanrex-intro-showcase__content {
    position: relative;
    z-index: 2;
    align-self: center;
    min-width: 0;
}

.vanrex-intro-showcase__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    color: #e8b928;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .21em;
}

.vanrex-intro-showcase__eyebrow::before {
    content: "";
    width: 32px;
    height: 1px;
    background: linear-gradient(90deg, #e8b928, rgba(232,185,40,.18));
}

.vanrex-intro-showcase__content h1 {
    /* Desktop 主標保持單行；Tablet／Mobile 由下方斷點恢復自然換行。 */
    max-width: none;
    margin: 0 0 19px;
    color: #f1c843;
    /* 寬螢幕限制字級上限，避免單行主標延伸到右側 FX 視覺。 */
    font-size: clamp(1.75rem, 2.2vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.vanrex-intro-showcase__content > p {
    /* 副標僅調整文字寬度與行高，不改文案內容。 */
    max-width: 760px;
    margin: 0 0 26px;
    color: #b9bdc5;
    font-size: 1.03rem;
    line-height: 1.7;
}

.vanrex-intro-showcase__points {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vanrex-intro-showcase__points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e1e3e7;
    font-size: .95rem;
}

.vanrex-intro-showcase__points li::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid rgba(243,198,35,.9);
    border-radius: 50%;
    background: rgba(243,198,35,.16);
    box-shadow: 0 0 0 4px rgba(243,198,35,.05);
}

/* ============================================================
   全球外匯市場視覺
   以 VANREX 為中心連接主要市場、交易平台、券商資訊與績效內容。
============================================================ */
.vanrex-intro-showcase__visual {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.vanrex-intro-showcase__visual::before {
    content: "";
    position: absolute;
    left: 8%;
    width: 84%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243,198,35,.13), transparent 65%);
    filter: blur(8px);
}

.vanrex-fx-visual {
    position: relative;
    width: 100%;
    padding: 19px;
    overflow: hidden;
    border: 1px solid rgba(243,198,35,.32);
    border-radius: 15px;
    background: linear-gradient(150deg, rgba(28,28,26,.94), rgba(6,6,6,.93));
    box-shadow: 0 25px 52px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.04);
}

.vanrex-fx-visual__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.vanrex-fx-visual__header span { color: #777d86; font-size: .61rem; letter-spacing: .17em; }
.vanrex-fx-visual__header strong { color: #e8b928; font-size: .76rem; letter-spacing: .15em; }

.vanrex-fx-visual__canvas {
    position: relative;
    height: 285px;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(255,255,255,.038) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.038) 1px, transparent 1px);
    background-size: 40px 40px;
}

.vanrex-fx-visual__orbit {
    position: absolute;
    left: 50%;
    top: 48%;
    border: 1px solid rgba(243,198,35,.18);
    border-radius: 50%;
    transform: translate(-50%,-50%);
}

.vanrex-fx-visual__orbit--outer { width: 270px; height: 180px; transform: translate(-50%,-50%) rotate(-10deg); }
.vanrex-fx-visual__orbit--inner { width: 205px; height: 128px; transform: translate(-50%,-50%) rotate(18deg); border-color: rgba(255,255,255,.09); }

.vanrex-fx-visual__route {
    position: absolute;
    left: 11%;
    width: 78%;
    height: 1px;
    transform-origin: center;
    background: linear-gradient(90deg, transparent, rgba(243,198,35,.36), transparent);
}

.vanrex-fx-visual__route::after {
    content: "";
    position: absolute;
    left: 72%;
    top: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #dcb540;
    box-shadow: 0 0 12px rgba(243,198,35,.45);
}

.vanrex-fx-visual__route--one { top: 43%; transform: rotate(-20deg); }
.vanrex-fx-visual__route--two { top: 54%; transform: rotate(17deg); }

.vanrex-fx-visual__brand {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 46%;
    width: 178px;
    padding: 18px 14px;
    transform: translate(-50%,-50%);
    text-align: center;
    border: 1px solid rgba(243,198,35,.42);
    background: linear-gradient(145deg, rgba(28,27,22,.96), rgba(8,8,8,.95));
    box-shadow: 0 17px 35px rgba(0,0,0,.48), 0 0 30px rgba(243,198,35,.07), inset 0 1px 0 rgba(255,255,255,.035);
}

.vanrex-fx-visual__brand small,
.vanrex-fx-visual__brand span { display: block; color: #747983; font-size: .54rem; letter-spacing: .11em; }
.vanrex-fx-visual__brand strong { display: block; margin: 7px 0 5px; color: #f1c843; font-size: 1.45rem; letter-spacing: .1em; }

.vanrex-fx-visual__pair {
    position: absolute;
    z-index: 4;
    padding: 6px 9px;
    color: #c8cbd0;
    font-size: .61rem;
    letter-spacing: .06em;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    background: rgba(10,10,10,.88);
    box-shadow: 0 8px 16px rgba(0,0,0,.25);
}

.vanrex-fx-visual__pair--eur { left: 5%; top: 16%; }
.vanrex-fx-visual__pair--gbp { right: 5%; top: 20%; }
.vanrex-fx-visual__pair--xau { left: 7%; bottom: 18%; color: #e8b928; border-color: rgba(243,198,35,.24); }
.vanrex-fx-visual__pair--jpy { right: 6%; bottom: 20%; }

.vanrex-fx-visual__chart {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 8px;
    height: 55px;
    opacity: .55;
}

.vanrex-fx-visual__curve {
    position: absolute;
    left: 0;
    bottom: 15px;
    width: 100%;
    height: 2px;
    transform: rotate(-6deg);
    background: linear-gradient(90deg, transparent, #cfa733 18%, #f2cd50 72%, transparent);
    box-shadow: 0 0 12px rgba(243,198,35,.15);
}

.vanrex-fx-visual__candle {
    position: absolute;
    bottom: var(--bottom);
    left: var(--left);
    width: 7px;
    height: var(--height);
    border: 1px solid rgba(232,185,40,.7);
    background: rgba(232,185,40,.13);
}

.vanrex-fx-visual__candle::before {
    content: "";
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 50%;
    width: 1px;
    background: rgba(232,185,40,.43);
}

.vanrex-fx-visual__candle--1 { --left: 8%; --bottom: 5px; --height: 19px; }
.vanrex-fx-visual__candle--2 { --left: 28%; --bottom: 10px; --height: 26px; }
.vanrex-fx-visual__candle--3 { --left: 50%; --bottom: 15px; --height: 21px; }
.vanrex-fx-visual__candle--4 { --left: 71%; --bottom: 19px; --height: 29px; }
.vanrex-fx-visual__candle--5 { --left: 91%; --bottom: 25px; --height: 22px; }

.vanrex-fx-visual__services {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 1px;
    border-top: 1px solid rgba(255,255,255,.055);
    background: rgba(255,255,255,.045);
}

.vanrex-fx-visual__services span {
    min-width: 0;
    padding: 11px 5px;
    overflow: hidden;
    color: #969ba3;
    font-size: .56rem;
    letter-spacing: .08em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #0d0d0d;
}

/* Tablet 與 Mobile：平板保留雙欄，手機改為品牌文字在上、全球市場視覺在下。 */
@media (max-width: 960px) {
    .vanrex-intro-showcase { grid-template-columns: minmax(0,1fr) minmax(310px,.96fr); gap: 24px; padding: 38px 30px; }
    .vanrex-intro-showcase__content h1 { font-size: clamp(2rem,4.7vw,2.75rem); white-space: normal; }
    .vanrex-fx-visual__canvas { height: 258px; }
    /* 平板縮小服務列字距，避免 PERFORMANCE 被固定四欄裁切。 */
    .vanrex-fx-visual__services span { font-size: .44rem; letter-spacing: .01em; }
}

@media (max-width: 720px) {
    .vanrex-intro-showcase { grid-template-columns: minmax(0,1fr); padding: 32px 22px; }
    .vanrex-intro-showcase__content h1 { font-size: clamp(1.9rem,8vw,2.45rem); }
    .vanrex-intro-showcase__content > p { font-size: .96rem; }
    .vanrex-intro-showcase__visual { width: 100%; }
}

@media (max-width: 420px) {
    .vanrex-intro-showcase { padding: 27px 18px; border-radius: 14px; }
    .vanrex-fx-visual { padding: 14px; }
    .vanrex-fx-visual__canvas { height: 244px; }
    .vanrex-fx-visual__brand { width: 152px; padding: 15px 10px; }
    .vanrex-fx-visual__orbit--outer { width: 235px; height: 158px; }
    .vanrex-fx-visual__orbit--inner { width: 174px; height: 112px; }
    .vanrex-fx-visual__services span { font-size: .44rem; letter-spacing: .01em; }
}

@media (prefers-reduced-motion: reduce) {
    .vanrex-intro-showcase { transition: none; }
    .vanrex-intro-showcase:hover { transform: none; }
}

/* ==========================
   6. 區塊標題與卡片網格 (Grid & Cards)
========================== */
.features-section, .brokers-section { padding: 80px 0; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 10px; }
.section-subtitle { text-align: center; color: var(--text-gray); margin-bottom: 50px; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch; 
    margin: 0 auto;
    width: 100%;
}
.card {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(212,175,55,.2);
    display: flex;
    flex-direction: column;
    height: 100% !important; 
    min-height: min-content !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: normal !important;
    line-height: 1.4 !important;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    border-color: rgba(212,175,55,.5);
}
.card .broker-btn { margin-top: auto; }

/* ============================================================
   Ultima Markets 官方戰略合作券商品牌亮點卡
   僅作用於首頁左側券商卡，維持與右側影片卡相近高度。
============================================================ */
.ultima-broker-card__intro h3 {
    margin: 0 0 4px;
    color: #f3c623;
    font-size: 1.35rem;
    letter-spacing: .08em;
}

.ultima-broker-card__tagline {
    margin: 0 0 7px;
    color: #f8fafc;
    font-size: .82rem;
    font-weight: 700;
}

.ultima-broker-card__description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #aeb4be;
    font-size: .78rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ultima-broker-card__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 12px 0 15px;
}

.ultima-broker-card__feature {
    min-width: 0;
    padding: 9px 6px 8px;
    text-align: center;
    border: 1px solid rgba(243,198,35,.16);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(243,198,35,.055), rgba(255,255,255,.012));
}

.ultima-broker-card__feature strong,
.ultima-broker-card__feature small {
    display: block;
}

.ultima-broker-card__feature strong {
    margin-top: 5px;
    color: #f4d56a;
    font-size: .72rem;
    line-height: 1.25;
    white-space: nowrap;
}

.ultima-broker-card__feature small {
    margin-top: 3px;
    overflow: hidden;
    color: #8f96a2;
    font-size: .62rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ultima-broker-card__icon {
    position: relative;
    display: block;
    width: 20px;
    height: 16px;
    margin: 0 auto;
    color: #f3c623;
}

.ultima-broker-card__icon--platform {
    border: 1px solid currentColor;
    border-radius: 2px;
}

.ultima-broker-card__icon--platform::after {
    position: absolute;
    right: -3px;
    bottom: -2px;
    width: 6px;
    height: 10px;
    content: "";
    border: 1px solid currentColor;
    border-radius: 1px;
    background: #111;
}

.ultima-broker-card__icon--markets {
    border: 1px solid currentColor;
    border-radius: 50%;
}

.ultima-broker-card__icon--markets::before,
.ultima-broker-card__icon--markets::after {
    position: absolute;
    content: "";
    border: 1px solid currentColor;
    border-radius: 50%;
}

.ultima-broker-card__icon--markets::before { inset: 3px 6px; }
.ultima-broker-card__icon--markets::after { inset: 6px 2px; border-left: 0; border-right: 0; border-radius: 0; }

.ultima-broker-card__icon--regulation {
    width: 17px;
    height: 18px;
    border: 1px solid currentColor;
    clip-path: polygon(50% 0, 100% 18%, 86% 75%, 50% 100%, 14% 75%, 0 18%);
}

/* Mobile：特色模組改為三列，避免窄螢幕文字被裁切。 */
@media (max-width: 560px) {
    .ultima-broker-card__features {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .ultima-broker-card__feature {
        display: grid;
        grid-template-columns: 26px max-content minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 8px 10px;
        text-align: left;
    }

    .ultima-broker-card__icon { margin: 0 auto; }
    .ultima-broker-card__feature strong,
    .ultima-broker-card__feature small { margin-top: 0; }
    .ultima-broker-card__feature small { text-align: right; }
}

/* ==========================
   7. 績效數據面板 (Dashboard)
========================== */
.performance-dashboard-section { background-color: #050505 !important; padding: 80px 0; overflow-x: hidden; }
#vanrex-myfxbook-dashboard { 
    background-color: #0f1423; border: 1px solid #1e293b; border-radius: 12px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); padding: 30px; width: 100%; max-width: 1100px; margin: 0 auto; 
}
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 20px; margin-bottom: 25px; gap: 20px; }
.verification-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.badge-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid #22c55e; padding: 3px 10px; border-radius: 4px; font-size: 0.75em; font-weight: bold; }
.dash-strategy-title { color: #f8fafc; font-size: 1.6em; margin: 0 0 5px 0; font-weight: 800; }
.dash-strategy-sub { color: #64748b; font-size: 0.9em; margin: 0; }
.myfxbook-btn { font-size: 0.9em; padding: 10px 20px; white-space: nowrap; border-radius: 6px; }
.dash-body { display: flex; gap: 30px; align-items: stretch; }
.dash-stats-panel { flex: 0 0 35%; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; height: auto !important; min-height: min-content !important; white-space: normal !important;}
.main-gain-box { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.main-gain-box .gain-label { color: #94a3b8; font-size: 1.1em; font-weight: bold; }
.main-gain-box .gain-value { color: #f59e0b; font-size: 2.2em; font-weight: 900; }
.abs-gain-box { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 15px; margin-bottom: 15px; }
.abs-gain-box .abs-label { color: #64748b; font-size: 0.85em; }
.abs-gain-box .abs-value { color: #cbd5e1; font-weight: bold; font-size: 0.95em; }
.stats-grid-2col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: 12px; flex-grow: 1; }
.stat-item { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255,255,255,0.08); padding-bottom: 5px; font-size: 0.85em; }
.stat-item .s-label { color: #64748b; }
.stat-item .s-value { color: #f8fafc; font-weight: bold; }
.stat-list-item { height: auto !important; min-height: min-content !important; white-space: normal !important; line-height: 1.4 !important; }
/* ==========================================
   數據儀表板：單個數據項目的排版優化
========================================== */
.stat-item {
    display: flex;
    justify-content: space-between; /* 🎯 關鍵 1：讓標籤靠最左、數值推到最右 */
    align-items: center;            /* 讓左右兩邊在垂直方向置中對齊 */
    white-space: nowrap;            /* 🛑 關鍵 2：強制絕對不准換行！ */
    padding: 6px 0;                 /* 稍微增加上下間距，讓數據呼吸 */
    font-size: 0.9em;               /* 微調字體大小，避免撐爆兩欄式版面 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* (加分項) 加上極淡的底線，增加閱讀引導感 */
}

/* 確保最後一個項目不需要底線 */
.stat-item:last-child {
    border-bottom: none;
}

/* 確保標籤與數值文字不會互相擠壓 */
.s-label {
    color: #94a3b8;
    margin-right: 15px; /* 在標籤跟數值中間預留安全距離 */
}

.s-value {
    font-weight: bold;
    text-align: right;
}
.update-time { text-align: right; font-size: 0.75em; color: #475569; margin-top: 15px; }
.dash-chart-panel { flex: 1; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.chart-tabs { display: flex; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 10px; margin-bottom: 15px; }
.chart-tabs .tab { color: #64748b; font-size: 0.85em; font-weight: bold; cursor: pointer; }
.chart-tabs .tab.active { color: #f8fafc; border-bottom: 2px solid #f59e0b; padding-bottom: 9px; }
.canvas-wrapper { position: relative; flex-grow: 1; min-height: 280px; width: 100%; }

/* ==========================
   8. MT5 教學區塊 (Tutorial)
========================== */
.tutorial-section {
    padding: 80px 0 120px;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, var(--bg-dark) 60%); 
    width: 100%;
}
.tutorial-header { text-align: center; margin-bottom: 60px; }
.tutorial-title { font-size: clamp(30px, 5vw, 45px); color: var(--gold-main); margin: 0 0 15px 0; }
.tutorial-subtitle { color: var(--text-gray); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

.step-grid {
    display: flex;
    flex-direction: column;
    gap: 70px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}
.rwd-card {
    background: linear-gradient(145deg, #111111, #050505);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    padding: 50px 40px;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;      
    justify-content: center;  
    gap: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.rwd-card:nth-child(even) { flex-direction: row-reverse; }
.rwd-card:hover {
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 1), 0 0 30px rgba(212, 175, 55, 0.15);
}

.step-number {
    position: absolute;
    top: -25px;
    left: 25px; 
    background: linear-gradient(135deg, #f3e5ab, #d4af37, #b8860b); 
    color: #000;
    font-size: 1.4rem;
    font-weight: 900;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid #050505;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    z-index: 10;
}
.rwd-card:nth-child(even) .step-number { left: auto; right: 25px; }

.step-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.step-content h3 { color: var(--gold-main); margin: 0 0 15px 0; font-size: 1.8rem; line-height: 1.3; }
.step-desc {
    color: #cbd5e1;
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* 下載按鈕組 */
.download-buttons { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; }
.app-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 22px; background: linear-gradient(145deg, #151515, #000000);
    border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 12px;
    color: #fff; transition: all 0.3s ease;
}
.app-btn:hover {
    background: linear-gradient(145deg, #1c1c1c, #050505);
    border-color: var(--gold-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}
.app-btn .btn-sub { font-size: 0.65rem; color: #94a3b8; display: block; text-transform: uppercase; }
.app-btn .btn-main { font-size: 1.1rem; font-weight: bold; display: block; }

/* 展示圖片區域 */
.step-visual { flex: 1; display: flex; justify-content: center; align-items: center; min-width: 0; }
.phone-mockup {
    width: 100%; max-width: 260px; position: relative; background: #000;
    border-radius: 35px; padding: 10px; border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4), 0 20px 40px rgba(0,0,0,0.9);
}
.phone-mockup::before {
    content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 35%; height: 20px; background: #050505; border-radius: 0 0 12px 12px;
}
.screen-img { width: 100%; height: auto; border-radius: 25px; display: block; aspect-ratio: 9/19; object-fit: cover; }

.simple-frame {
    width: 100%; max-width: 260px; background: #000; border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.15);
    margin: 0 auto; transition: all 0.3s ease;
}
.simple-frame:hover { border-color: var(--gold-main); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.3); transform: translateY(-3px); }
.framed-img { width: 100%; height: auto; display: block; border-radius: 8px; }

/* 多圖展示 */
.multi-visual { display: flex; gap: 12px; justify-content: center; align-items: center; width: 100%; }
.small-mockup {
    flex: 1 1 30%; max-width: 140px; padding: 6px; border-radius: 20px; background: #000;
    border: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4), 0 15px 30px rgba(0,0,0,0.9);
}
.small-mockup::before { height: 12px; top: 6px; }
.small-mockup .screen-img { border-radius: 15px; }

.mockup-badge {
    position: absolute; top: -12px; left: -12px;
    background: linear-gradient(135deg, #f3e5ab, #d4af37); color: #000;
    font-size: 1rem; font-weight: 900; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 3px solid #000; box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
    z-index: 15; transition: all 0.3s ease;
}
.small-mockup:hover .mockup-badge { transform: scale(1.15) rotate(-5deg); box-shadow: 0 6px 15px rgba(212, 175, 55, 0.6); }

/* 步驟 2 專屬優化 */
.step-card:nth-child(2) .step-content { flex: 0.8; }
.step-card:nth-child(2) .step-visual { flex: 1.4; }
.step-card:nth-child(2) .step-content h3 { font-size: 1.5rem; margin-bottom: 10px; }
.step-card:nth-child(2) .step-desc { font-size: 0.95rem; line-height: 1.6; color: #94a3b8; margin-bottom: 0; }
.step-card:nth-child(2) .small-mockup { max-width: 160px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.step-card:nth-child(2) .small-mockup:hover { transform: translateY(-6px) scale(1.04); border-color: var(--gold-main); box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3); }

/* 步驟 3 專屬優化 */
.step-card:nth-child(3) .step-content { flex: 0.8; }
.step-card:nth-child(3) .step-visual { flex: 1.4; }
.step-card:nth-child(3) .step-content h3 { font-size: 1.5rem; margin-bottom: 10px; }
.step-card:nth-child(3) .step-desc { font-size: 0.95rem; line-height: 1.6; color: #94a3b8; margin-bottom: 0; }
.dual-visual { display: flex; gap: 28px !important; justify-content: center; align-items: center; width: 100%; }
.step-card:nth-child(3) .small-mockup { max-width: 160px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.step-card:nth-child(3) .small-mockup:hover { transform: translateY(-6px) scale(1.04); border-color: var(--gold-main); box-shadow: 0 12px 28px rgba(212, 175, 55, 0.3); }

/* 步驟 4：左右並排強制鎖定 */
.step-04-card {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    align-items: flex-start !important; justify-content: space-between !important;
    gap: 30px !important; width: 100% !important;
}
.step-04-card .step-content { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
.step-04-card .step-visual { flex: 0 0 45% !important; width: 45% !important; max-width: 45% !important; display: flex !important; justify-content: center !important; }
.step-04-card .dual-visual { display: flex !important; flex-direction: row !important; gap: 15px !important; width: 100% !important; justify-content: center !important; }
.step-04-card .phone-mockup { flex: 1 !important; max-width: 180px !important; }
.step-04-card .screen-img { width: 100% !important; height: auto !important; display: block !important; border-radius: 12px !important; }
.step-04-card .step-desc { font-size: 0.95rem !important; line-height: 1.6 !important; color: #94a3b8 !important; letter-spacing: normal !important; margin-bottom: 0 !important; }
.stacked-visual { display: flex; flex-direction: column; gap: 20px; align-items: center; width: 100%; }

/* ==========================
   9. 頁尾區塊 (Footer) - 羅的滿版進化版
========================== */
footer {
    background-color: #020305; 
    padding: 60px 20px 40px; 
    border-top: 1px solid #1a202c;
    
    /* 全站 Overflow 修正：使用容器寬度，不把瀏覽器捲軸寬度計入 Footer。 */
    width: 100% !important;
    position: relative;
    left: auto;
    right: auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.footer-container { 
    width: 100%;
    /* 💡 羅的排版提示：
       1200px 是讓文字維持在中間最舒服的閱讀寬度。
       如果你希望「文字本身」也要跟著貼齊螢幕最左與最右邊，請把這行改成 max-width: 100%; 
    */
    max-width: 1200px; 
    margin: 0 auto;
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 50px; 
}

.footer-contact, .footer-disclaimer { flex: 1; }
.footer-contact h4, .footer-disclaimer h4 { color: var(--gold-main); font-size: 1.2em; margin-top: 0; margin-bottom: 20px; }
.footer-contact ul { list-style: none; padding: 0; margin: 0; }
.footer-contact ul li { margin-bottom: 12px; color: var(--text-gray); line-height: 1.6; }
.footer-contact ul li a { color: var(--text-gray); text-decoration: none; transition: 0.3s; }
.footer-contact ul li a:hover { color: var(--gold-main); }
.footer-disclaimer p { color: #64748b; font-size: 0.9em; line-height: 1.8; margin: 0; }

/* ==========================================================================
   🚀 VANREX-羅 終極防爆版 RWD (統一斷點管理)
========================================================================== */

/* 💻 筆電/大螢幕自適應 (1200px 以下) */
@media (max-width: 1200px) {
    .logo-img { width: 50px !important; height: 50px !important; max-height: 50px !important; }
    .logo-text-group { margin-top: 12px; margin-left: -6px; } 
    .logo-title, .brand-main { font-size: 1.35rem !important; }
    .logo-subtitle, .brand-sub { font-size: 0.7rem !important; }
}

/* 📱 平板/中型螢幕 (992px 以下) */
@media (max-width: 992px) {
    .header-container { flex-direction: column !important; gap: 15px; text-align: center; }
    .logo-img { width: 42px !important; height: 42px !important; max-height: 42px !important; }
    .logo-text-group { margin-top: 10px; margin-left: -5px; }
    .logo-title, .brand-main { font-size: 1.15rem !important; }
    .logo-subtitle, .brand-sub { font-size: 0.62rem !important; }
    nav ul { flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; }
    nav ul li a, nav ul li .dropbtn { min-height: 44px; font-size: 14px; padding: 8px 12px !important; display: inline-flex; align-items: center; justify-content: center; }
    .language-picker { min-width: 44px; min-height: 44px; }
    .logo a { min-height: 44px; }
    .range-btn { min-width: 44px; min-height: 44px; }
    .footer-contact a { min-height: 44px; display: inline-flex; align-items: center; }
    
    .dash-body { flex-direction: column; }
    .dash-stats-panel { flex: none; width: 100%; }
    .canvas-wrapper { height: 300px; }
    
    .rwd-card, .rwd-card:nth-child(even) { flex-direction: column !important; padding: 50px 20px 30px; }
    .step-number { top: -20px; left: -10px; width: 50px; height: 50px; font-size: 1.2rem; border-width: 3px; }
    .rwd-card:nth-child(even) .step-number { left: -10px; right: auto; }
    .app-btn { width: 100%; }
    
    .multi-visual { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 15px; scroll-snap-type: x mandatory; }
    .small-mockup { flex: 0 0 150px; scroll-snap-align: center; }
    .multi-visual::-webkit-scrollbar { height: 5px; }
    .multi-visual::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
    .multi-visual::-webkit-scrollbar-thumb { background: var(--gold-main); border-radius: 10px; }
}

/* 📱 桌機特定佈局 (大於 768px) */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content { visibility: visible; opacity: 1; transform: translateY(0); }
    .step-01-card {
        display: grid !important; grid-template-columns: auto 1fr 1fr;
        grid-template-areas: "num content visual" "num buttons visual";
        gap: 15px 30px !important; align-items: start !important;
    }
    .step-01-card .step-number { grid-area: num; }
    .step-01-card .step-content { grid-area: content; }
    .step-01-card .step-visual { grid-area: visual; }
    .step-01-card .download-buttons { grid-area: buttons; }
}
/* =========================================
   📱 手機版下拉選單點擊展開支援
========================================= */
@media (max-width: 768px) {
    /* 預設先隱藏子選單，並取消純 CSS 的 hover 依賴 */
    .dropdown-content {
        display: none;
        position: static; /* 確保展開時把下方內容往下推 */
        opacity: 1;
        transform: none;
        box-shadow: none;
        padding-left: 20px; /* 讓子選單往內縮，層次更分明 */
    }

    /* 當 JS 加入 .active 類別時，顯示選單 */
    .dropdown.active .dropdown-content {
        display: flex;
        flex-direction: column;
    }

    /* 箭頭旋轉小細節 (若你的箭頭有獨立 class) */
    .dropdown.active .dropbtn .arrow {
        transform: rotate(180deg);
        transition: transform 0.3s ease;
    }
}

/* 📱 手機版專屬優化核心防護網 (768px 以下) */
@media (max-width: 768px) {
    body, html { overflow-x: hidden !important; width: 100% !important; margin: 0; padding: 0; }
    .container, .hero { width: 100% !important; max-width: 100vw !important; padding-left: 15px !important; padding-right: 15px !important; box-sizing: border-box !important; }
    .hero { padding: 50px 10px !important; }
    .hero h1 { font-size: 2em !important; line-height: 1.3 !important; }
    .hero p { font-size: 1em !important; }
    
    img, iframe, canvas { max-width: 100% !important; width: 100% !important; height: auto !important; object-fit: contain !important; min-width: 0 !important; }
    #performance div, div[style*="max-width"], div[style*="width"] { max-width: 100% !important; width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
    
    /* Logo 與選單 */
    .header-container { padding: 10px 12px !important; }
    .logo a { gap: 8px; } 
    .logo-img { width: 34px !important; height: 34px !important; max-height: 34px !important; }
    .logo-text-group { margin-top: 8px; margin-left: -4px; }
    .logo-title, .brand-main { font-size: 0.95rem !important; letter-spacing: 1px !important; }
    .logo-subtitle, .brand-sub { font-size: 0.55rem !important; letter-spacing: 1px !important; }
    nav ul li a, nav ul li .dropbtn { font-size: 13px; }
    .dropdown { position: relative !important; }
    .dropdown-content {
        position: absolute !important; top: 100% !important; left: 50% !important;
        transform: translateX(-50%) !important; width: 250px !important; z-index: 100000 !important;
        box-shadow: 0px 10px 30px rgba(0,0,0,0.9) !important; background: rgba(15, 20, 35, 0.98) !important;
        border: 1px solid rgba(243, 198, 35, 0.3) !important; margin-top: 5px !important;
    }

    /* 網格與 Footer */
    .grid-cards, .features-grid, .report-grid, .brokers-grid { display: flex !important; flex-direction: column !important; gap: 20px !important; }
    .card, .report-card { width: 100% !important; margin-bottom: 0 !important; box-sizing: border-box !important; }
    .footer-container { flex-direction: column !important; text-align: left !important; gap: 40px !important; }
    .card, .report-card, .footer-contact, .footer-disclaimer { max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box !important; }
    
    .tradingview-widget-container, .tradingview-widget-container > div, .tradingview-widget-container iframe, #tradingview_xauusd {
        width: 100% !important; max-width: 100vw !important; margin-left: 0 !important; margin-right: 0 !important;
        padding: 0 !important; box-sizing: border-box !important; overflow: hidden !important; 
    }
    .tradingview-widget-container iframe { height: 380px !important; }

    /* 其他區塊修復 */
    .partnership-showcase { flex-direction: column; gap: 10px; }
    .link-icon .plus { transform: rotate(90deg); margin: 10px 0; }
    .alliance-main-title { font-size: 1.8em !important; }
    .partnership-benefits, .trust-grid, .premium-suite-wrapper { grid-template-columns: 1fr; flex-direction: column !important; gap: 20px !important; }
    .fintech-card { width: 100% !important; max-width: 100vw !important; padding: 30px 20px 25px !important; box-sizing: border-box !important; }
    .card-pill { position: relative !important; top: 0 !important; right: 0 !important; align-self: flex-start !important; margin-bottom: 12px !important; }

    /* MT5 Tutorial 區塊 */
    .step-grid { padding: 0 15px !important; }
    .rwd-card, .rwd-card:nth-child(even) { text-align: center; align-items: center; padding: 45px 20px 30px; }
    .step-number, .rwd-card:nth-child(even) .step-number { top: -20px; left: 50% !important; transform: translateX(-50%); right: auto !important; width: 48px; height: 48px; font-size: 1.2rem; }
    .download-buttons { justify-content: center; width: 100%; }
    .app-btn { width: 100%; max-width: 280px; margin: 0 auto; }
    .mockup-badge { width: 28px; height: 28px; font-size: 0.85rem; top: -8px; left: -8px; border-width: 2px; }
    .multi-visual { width: 100%; }
    .small-mockup { flex: 0 0 140px; }
    .dual-visual { gap: 16px !important; justify-content: center; }

    /* 步驟 1 改寫排序 */
    .step-01-card { display: flex !important; flex-direction: column !important; gap: 20px !important; }
    .step-01-card .step-number { order: 1; }
    .step-01-card .step-content { order: 2; }
    .step-01-card .step-visual { order: 3; }
    .step-01-card .download-buttons { order: 4 !important; width: 100% !important; display: flex !important; flex-direction: column !important; gap: 12px !important; margin-top: 10px !important; }

    /* 步驟 2/3/4 特定微調 */
    .step-card:nth-child(2) .step-content, .step-card:nth-child(3) .step-content { flex: auto; }
    .step-card:nth-child(2) .step-desc, .step-card:nth-child(3) .step-desc, .step-04-card .step-desc { font-size: 0.9rem !important; line-height: 1.6 !important; }
    .step-card:nth-child(2) .small-mockup { max-width: 140px; }
    .step-card:nth-child(3) .small-mockup { max-width: 135px; }
    .step-04-card { flex-direction: column !important; }
    .step-04-card .step-content, .step-04-card .step-visual { flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important; }
}

/* 📱 極小手機螢幕 (390px 以下 - iPhone SE 等) */
@media (max-width: 390px) {
    .logo a { gap: 6px; }
    .logo-img { width: 28px !important; height: 28px !important; max-height: 28px !important; }
    .logo-text-group { margin-top: 6px; margin-left: -3px; }
    .logo-title, .brand-main { font-size: 0.85rem !important; letter-spacing: 0.5px !important; }
}
/* ==========================================
   手機版響應式調整 (小於 768px 時)
========================================== */
@media (max-width: 768px) {
    .stats-grid-2col {
        display: grid;
        grid-template-columns: 1fr; /* 🎯 關鍵：手機版直接變成「單欄」，給文字 100% 的寬度伸展 */
        gap: 8px;
    }
}
/* ==========================================================================
   🎯 頁尾聯絡資訊 & 版權宣告：極致左對齊與平行排版
   ========================================================================== */
.footer-contact {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    flex: 1;
}

.footer-contact h4,
.footer-disclaimer h4 {
    color: var(--gold-main);
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 12px;
    text-align: left !important;
}

.footer-contact p,
.footer-disclaimer p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: left !important;
}

.footer-contact .contact-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
}

.footer-contact .contact-list li {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 !important;
    text-align: left !important;
}

/* Footer 聯絡資訊：固定 Label 欄寬，移除圖示後仍維持五行整齊對齊。 */
.footer-contact .contact-list .label {
    flex: 0 0 86px;
    min-width: 86px;
    flex-shrink: 0;
}

.footer-contact .contact-list li a {
    color: var(--text-gray);
    text-decoration: none;
    transition: 0.3s;
}

.footer-contact .contact-list li a:hover {
    color: var(--gold-main);
}

/* 版權宣告區塊左對齊 */
.footer-bottom {
    width: 100% !important;
    max-width: 1200px;
    margin: 40px auto 0 !important;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left !important;
}

.footer-bottom .copyright {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 !important;
    padding: 0;
    text-align: left !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ==========================================================================
   📱 手機端 RWD 防爆版
   ========================================================================== */
@media (max-width: 768px) {
    .footer-contact { align-items: flex-start !important; }
    .footer-bottom { margin-top: 30px !important; padding-top: 15px; }
    .footer-bottom .copyright { font-size: 0.78rem !important; }
}

/* ==========================================================================
   🎯 資金安全頁面專屬擴充：警示卡片 (Warning Card)
   ========================================================================== */
.warning-card {
    border: 1px solid rgba(239, 68, 68, 0.4) !important; /* 紅色警戒邊框 */
    background: linear-gradient(135deg, rgba(20, 5, 5, 0.9), rgba(10, 10, 10, 1)) !important;
}

.warning-card:hover {
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.15) !important; /* 紅色光暈 */
}

/* ==========================================================================
   📱 VANREX-羅：終極全語系防裁切 Grid 網格版 (已整合框框自動貼合)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. 導覽列網格容器 */
    nav ul {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px 2px !important;
        padding: 8px 3px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 2. 統一項目高寬 */
    nav ul > li {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 44px !important;
        position: relative !important; /* 確保子選單能依據父元素定位 */
    }

    /* 3. 頂部按鈕：開啟動態響應式字體與全域隨處斷字 */
    nav ul > li > a,
    nav ul > li.dropdown .dropbtn {
        font-size: clamp(0.58rem, 2.5vw, 0.7rem) !important; /* 🌟 根據手機螢幕寬度自動微縮 */
        line-height: 1.15 !important;
        padding: 2px 1px !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;  /* 🌟 核心：遇到超長單字自動斷開，絕不撐破格子 */
        hyphens: auto !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        display: flex !important;
        width: 100% !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }

    /* 4. 多語言選擇器：獨佔底部整排 */
    nav ul > li.language-picker {
        grid-column: span 3 !important;
        margin-top: 4px !important;
    }

    /* =========================================
       5. 下拉選單彈出框防跑版與內容防裁切 (框框自動貼合瘦身)
    ========================================= */
    .dropdown-content {
        position: absolute !important;
        top: 100% !important;
        z-index: 9999 !important;
        
        /* 🌟 核心修復：文字少時自動收縮，文字多時防裁切 */
        min-width: 110px !important;    /* 讓字少的選單可以縮到極小 */
        width: max-content !important;  /* 寬度完全根據文字長度自動伸縮！ */
        max-width: 85vw !important;     /* 遇到超長外文時的保險絲，超過螢幕 85% 就強制換行 */

        max-height: 50vh !important;
        overflow-y: auto !important;
        background-color: rgba(15, 20, 35, 0.98) !important;
        border-radius: 6px !important;
        padding: 6px 0 !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85) !important;
        border: 1px solid rgba(255, 215, 0, 0.2) !important;
    }

    /* 下拉選單內部的選項文字：強制允許折行，絕不裁切 */
    .dropdown-content a {
        display: block !important;
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;      /* 🌟 允許長外語自然換行 */
        word-break: break-word !important;   /* 長單字自動換行 */
        overflow-wrap: anywhere !important;
        text-align: left !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-content a:last-child {
        border-bottom: none;
    }

    /* 左邊選單 (最佳外匯經紀商)：靠左對齊 */
    nav ul > li:nth-child(4) .dropdown-content {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
    }

    /* 中間選單 (何謂保證金)：水平置中對齊 */
    nav ul > li:nth-child(5) .dropdown-content {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    /* 右邊選單 (使用指南)：靠右對齊，防止超出螢幕右側 */
    nav ul > li:nth-child(6) .dropdown-content {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
    }
}

/* ============================================================
   Touch 與鍵盤操作安全網
   Touch 裝置不依賴 hover；focus-visible 提供清楚但不干擾滑鼠的焦點提示。
============================================================ */
@media (hover: none), (pointer: coarse) {
    .dropdown:hover:not(.active) .dropdown-content {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
    .dropdown.active .dropdown-content {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    .card:hover,
    .rwd-card:hover,
    .simple-frame:hover,
    .small-mockup:hover,
    .vanrex-intro-showcase:hover { transform: none !important; }
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid var(--gold-main);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
.growth-range-tabs {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.range-btn {
    background: #111827;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
}

.range-btn:hover {
    color: #ffffff;
    border-color: #ffb000;
}

.range-btn.active {
    background: #ffb000;
    color: #111827;
    border-color: #ffb000;
    font-weight: 700;
}

.chart-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Dashboard 真實資料擴充：Balance/Equity 圖表、空資料狀態與 Daily/Monthly 卡片 */
.secondary-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.secondary-chart-header .tab {
    color: #f8fafc;
    font-size: 0.85em;
    font-weight: 700;
}

.chart-unit {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.75em;
    white-space: nowrap;
}

.secondary-canvas-wrapper {
    min-height: 230px;
    flex-grow: 0;
}

.chart-empty-state {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
    background: rgba(15,20,35,0.82);
    border: 1px dashed rgba(148,163,184,0.2);
    border-radius: 8px;
}

.chart-empty-state[hidden] {
    display: none;
}

.period-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.period-performance-card {
    min-width: 0;
    padding: 18px 20px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
}

.period-performance-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 5px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.period-performance-title small {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 400;
    text-align: right;
}

.period-performance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.06);
}

.period-performance-row:last-child {
    border-bottom: 0;
}

.period-performance-label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.period-performance-label strong {
    color: #cbd5e1;
    font-size: 0.82rem;
}

.period-performance-label small {
    overflow: hidden;
    color: #64748b;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.period-performance-value {
    flex: 0 0 auto;
    color: #f59e0b;
    font-size: 0.9rem;
    font-weight: 800;
}

.period-performance-empty {
    padding: 22px 0;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 768px) {
    #vanrex-myfxbook-dashboard {
        padding: 20px 14px;
    }

    .stats-grid-2col,
    .period-performance-grid {
        grid-template-columns: 1fr;
    }

    .chart-tabs {
        align-items: flex-start;
        flex-direction: column;
    }

    .growth-range-tabs {
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .canvas-wrapper,
    .secondary-canvas-wrapper {
        min-height: 240px;
        height: 240px;
    }

    .period-performance-title,
    .period-performance-row {
        align-items: flex-start;
    }

    /* Dashboard Daily / Monthly：日期與數值固定雙欄，避免日期繼承全站斷字後直向排列。 */
    .period-performance-row {
        display: grid;
        grid-template-columns: minmax(110px, 1fr) auto;
        gap: 12px;
        align-items: start !important;
    }

    .period-performance-label {
        min-width: 110px;
        overflow: hidden;
    }

    .period-performance-label strong {
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }

    .period-performance-value {
        white-space: nowrap;
        text-align: right;
    }
}

/* ============================================================
   Dashboard 極窄螢幕數值防裁切
   僅在 340px 以下收緊內距與欄位間距，不隱藏任何內容
============================================================ */
@media (max-width: 340px) {
    #vanrex-myfxbook-dashboard {
        padding-left: 8px;
        padding-right: 8px;
    }

    .performance-dashboard-section .dash-stats-panel {
        padding-left: 12px;
        padding-right: 12px;
        min-width: 0;
    }

    .performance-dashboard-section .stat-item {
        min-width: 0;
        gap: 6px;
        font-size: 0.78em;
    }

    .performance-dashboard-section .s-label {
        min-width: 0;
        margin-right: 0;
    }

    .performance-dashboard-section .s-value {
        flex: 0 1 auto;
        font-size: 0.92em;
    }
}

/* 窄手機將來源說明移到標題下方，避免技術名稱或中文逐字斷行。 */
@media (max-width: 420px) {
    .period-performance-title {
        display: block;
    }

    .period-performance-title small {
        display: block;
        margin-top: 4px;
        text-align: left;
        white-space: nowrap;
    }
}
