/* 全站共用樣式：index.html / tech.html / commitment.html 共用。
   色票以 :root 的 --brand-* 為單一來源，勿在頁面內硬寫 hex。 */
:root {
    --brand-primary: #2A9D8F;    /* 森綠色 */
    --brand-secondary: #E9C46A;  /* 暖陽黃 */
    --brand-accent: #E76F51;     /* 磚紅色 */
    --brand-dark: #264653;       /* 深藍綠 */
    --brand-light: #F4F9F9;      /* 極淺綠灰 */
    --text-body: #4a4a4a;
}

body { font-family: 'Helvetica Neue', 'Segoe UI', "Microsoft JhengHei", sans-serif; color: var(--text-body); background-color: #fff; line-height: 1.6; }

/* --- Navbar --- */
.navbar { background: rgba(255, 255, 255, 0.98); box-shadow: 0 4px 20px rgba(38, 70, 83, 0.1); padding: 15px 0; z-index: 1000; }
.navbar-brand img { height: auto; width: 150px; }
/* @media(max-width: 767px) { .navbar-brand img { width: 40px; } } */
.footer-logo { height: auto; width: 150px; border-radius: 5px; }
@media(max-width: 767px) { .footer-logo { width: 40px; border-radius: 50%;} }
.nav-link { font-weight: 600; color: var(--brand-dark); margin: 0 8px; font-size: 0.95rem; transition: 0.3s; cursor: pointer; white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199px) { .nav-link { margin: 0 5px; font-size: 0.88rem; } }
.nav-link:hover { color: var(--brand-primary); }
.btn-login { background-color: var(--brand-dark); color: white; border-radius: 50px; padding: 8px 30px; font-weight: bold; border: none; transition: 0.3s; }
.btn-login:hover { background-color: var(--brand-primary); transform: translateY(-2px); }
.lang-select { border: 1px solid #ddd; border-radius: 20px; padding: 5px 30px 5px 15px; font-size: 0.85rem; margin-left: 10px; }

/* --- Floating ESG Toolbox --- */
.esg-floating-btn {
    position: fixed; right: 30px; bottom: 30px; width: 70px; height: 70px;
    background: linear-gradient(135deg, var(--brand-secondary), #d4a017); color: var(--brand-dark);
    border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); cursor: pointer; z-index: 1050;
    transition: transform 0.3s ease, box-shadow 0.3s ease; font-weight: 800; font-size: 0.7rem; text-align: center; line-height: 1.1; border: 3px solid white;
}
.esg-floating-btn i { font-size: 1.5rem; margin-bottom: 2px; }
.esg-floating-btn:hover { transform: scale(1.1) translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.3); }

/* --- Hero Section --- */
.hero { 
    background: linear-gradient(135deg, #FDFBF7 0%, #E6F4F1 100%); 
    padding: 160px 0 150px; 
    position: relative;
    overflow: hidden;
    text-align: center;
}
.hero h1 { font-weight: 800; font-size: 3.2rem; margin-bottom: 25px; color: var(--brand-dark); line-height: 1.3; }
.hero-subtitle-wrapper { text-align: left; margin: 0 auto 35px auto; max-width: 800px; }
.hero-subtitle { font-size: 1.15rem; color: #555; font-weight: 400; line-height: 1.8; }

.btn-hero-primary { background: var(--brand-primary); color: white; border-radius: 50px; padding: 15px 50px; font-weight: bold; border: none; transition: 0.3s; box-shadow: 0 10px 20px rgba(42, 157, 143, 0.3); font-size: 1.1rem; }
/* color 需明確重申：Bootstrap 的 .btn:hover（0,2,0）會蓋掉 .btn-hero-* 基礎規則（0,1,0）的文字色 */
.btn-hero-primary:hover { background: #21867a; color: white; transform: translateY(-3px); }
.btn-hero-outline { background: transparent; border: 2px solid var(--brand-dark); color: var(--brand-dark); border-radius: 50px; padding: 15px 40px; font-weight: bold; transition: 0.3s; font-size: 1.1rem; }
.btn-hero-outline:hover { background: var(--brand-dark); color: white; }
/* 次級 CTA：淺底實心 pill，層級低於主按鈕但仍為實心可辨識 */
.btn-hero-soft { background: var(--brand-light); border: 1px solid var(--brand-primary); color: var(--brand-dark); border-radius: 50px; padding: 15px 40px; font-weight: bold; transition: 0.3s; font-size: 1.1rem; }
/* hover 比照 primary/secondary：只上浮。底色/文字/邊框需明確重申，否則 Bootstrap 的 .btn:hover（0,2,0）會蓋掉基礎規則（0,1,0）把底色打成透明 */
.btn-hero-soft:hover { background: var(--brand-light); border-color: var(--brand-primary); color: var(--brand-dark); transform: translateY(-3px); }
.btn-hero-secondary { background: var(--brand-secondary); color: var(--brand-dark); border-radius: 50px; padding: 15px 40px; font-weight: bold; border: none; transition: 0.3s; font-size: 1.1rem; box-shadow: 0 10px 20px rgba(233, 196, 106, 0.3); }
.btn-hero-secondary:hover { background: #d4b15c; color: var(--brand-dark); transform: translateY(-3px); }

/* --- Impact Bar --- */
.impact-bar { background: var(--brand-dark); color: white; padding: 45px 0; margin-top: 0; z-index: 10; border-radius: 15px; box-shadow: 0 15px 50px rgba(0,0,0,0.15); position: relative; top: -50px; }
.impact-number { font-size: 3.5rem; font-weight: 800; color: var(--brand-secondary); line-height: 1; margin-bottom: 10px; }
.impact-label { font-size: 0.95rem; font-weight: 500; opacity: 0.8; letter-spacing: 1px; }

/* --- Components --- */
.section-padding { padding: 90px 0; }
.bg-light-brand { background-color: var(--brand-light); }

/* Cards */
.news-card, .pillar-card, .step-card, .advisor-card, .benefit-display-card, .market-card { background: white; border-radius: 20px; transition: 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid #eee; height: 100%; overflow: hidden; }
.news-card:hover, .pillar-card:hover, .step-card:hover, .advisor-card:hover, .benefit-display-card:hover, .market-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(38, 70, 83, 0.15); }

/* News Scroll */
.news-container-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.news-scroll-wrapper { display: flex; overflow-x: auto; gap: 24px; padding: 20px 5px 40px 5px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; width: 100%; scroll-behavior: smooth; }
.news-scroll-wrapper::-webkit-scrollbar { display: none; }
.news-item { flex: 0 0 350px; scroll-snap-align: start; }
@media(max-width: 768px) { .news-item { flex: 0 0 85vw; } }
.news-nav-btn { background: white; border: 1px solid #eee; color: var(--brand-dark); width: 50px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.1); cursor: pointer; transition: 0.3s; z-index: 5; }
.news-nav-btn:hover { background: var(--brand-primary); color: white; transform: scale(1.1); }
.btn-prev { margin-right: 15px; }
.btn-next { margin-left: 15px; }
.news-img { height: 200px; object-fit: cover; width: 100%; }
.news-content { padding: 25px; }
.news-link { text-decoration: none; color: var(--brand-dark); font-weight: 700; display: inline-flex; align-items: center; transition: 0.3s; }
.news-link:hover { color: var(--brand-primary); }
/* 文章內頁 */
#article-view .article-date { color: var(--brand-primary); font-weight: 700; letter-spacing: 1px; }
#article-view h1 { font-weight: 800; color: var(--brand-dark); line-height: 1.4; font-size: 2rem; }
html { overflow-anchor: none; } /* 防止版面變動時瀏覽器自動改捲動位置，確保切換 view/文章的捲動控制精準 */
#article-view .article-hero { width: 100%; height: 400px; border-radius: 16px; margin-bottom: 30px; object-fit: cover; }
@media(max-width: 767px) { #article-view .article-hero { height: 220px; } }
#article-view .article-body p { font-size: 1.05rem; line-height: 1.95; color: var(--text-body); margin-bottom: 1.4rem; }
#article-view .article-body img { width: 100%; border-radius: 12px; margin: 1.4rem 0; }
@media(max-width: 767px) { #article-view h1 { font-size: 1.5rem; } }
/* 文章 popup（modal 版） */
#articleModal .modal-content { max-height: 90vh; }
#articleModalBody .article-date { color: var(--brand-primary); font-weight: 700; letter-spacing: 1px; }
#articleModalBody h1 { font-weight: 800; color: var(--brand-dark); line-height: 1.4; font-size: 1.55rem; }
#articleModalBody .article-hero { width: 100%; height: 300px; border-radius: 12px; margin-bottom: 22px; object-fit: cover; }
#articleModalBody .article-body p { font-size: 1.02rem; line-height: 1.9; color: var(--text-body); margin-bottom: 1.2rem; }
#articleModalBody .article-body img { width: 100%; border-radius: 10px; margin: 1.2rem 0; }
@media(max-width: 767px) { #articleModalBody h1 { font-size: 1.3rem; } #articleModalBody .article-hero { height: 200px; } }

/* Employee Benefits */
.benefit-display-card { padding: 30px; border-bottom: 5px solid transparent; }
.benefit-display-card:hover { border-bottom-color: var(--brand-secondary); }
.benefit-display-icon { width: 70px; height: 70px; background: rgba(233, 196, 106, 0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #d4b15c; font-size: 2rem; margin-bottom: 20px; }

/* Vision & Roadmap */
.pillar-card { border-bottom: 5px solid transparent; position: relative; }
.pillar-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: var(--brand-dark); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.pillar-card:hover::before { transform: scaleX(1); }
.pillar-icon-wrapper { width: 100px; height: 100px; background: rgba(38, 70, 83, 0.05); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 30px; font-size: 3rem; color: var(--brand-dark); transition: 0.4s; }
.pillar-card:hover .pillar-icon-wrapper { background: var(--brand-dark); color: white; transform: scale(1.1) rotate(5deg); }
.pillar-card.p-1:hover .pillar-icon-wrapper { background: var(--brand-primary); } .pillar-card.p-1::before { background: var(--brand-primary); }
.pillar-card.p-2:hover .pillar-icon-wrapper { background: var(--brand-secondary); color: var(--brand-dark); } .pillar-card.p-2::before { background: var(--brand-secondary); }
.pillar-card.p-3:hover .pillar-icon-wrapper { background: var(--brand-accent); } .pillar-card.p-3::before { background: var(--brand-accent); }

.step-card { padding: 40px 30px; text-align: left; position: relative; z-index: 2; border-top: 5px solid transparent; }
.step-card:hover { border-top-color: var(--brand-primary); }
.step-number { width: 45px; height: 45px; background: var(--brand-secondary); color: var(--brand-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 20px; font-size: 1.2rem; }
.roadmap-connector { position: absolute; top: 60px; left: 15%; right: 15%; height: 4px; background: #e0e0e0; z-index: 1; display: none; }
@media (min-width: 992px) { .roadmap-connector { display: block; } }

/* Logo Wall */
.logo-section { padding: 60px 0; overflow: hidden; background: white; }
/* .logo-section-alt { padding: 60px 0; overflow: hidden; background: var(--brand-light); } */
.logo-section-alt { padding: 60px 0; overflow: hidden; background: white; }
.logo-slider { height: 80px; overflow: hidden; position: relative; width: 100%; }
/* 防 FOUC：有 JS 時先隱藏，loader 佈局完成後加 .logo-ready 淡入 */
html.js .logo-slider { opacity: 0; transition: opacity .4s ease; }
html.js .logo-slider.logo-ready { opacity: 1; }
.logo-slide-track { display: flex; align-items: center; width: max-content; animation: logo-marquee 45s linear infinite; will-change: transform; }
.logo-slide-track-short { animation-duration: 40.8971872s;}
/* 間距用 margin（非 flex gap），使 JS 動態佈局的 translateX(-50%) 剛好等於一份 unit 寬 → 無縫 */
.logo-slide { position: relative; flex: 0 0 auto; width: 220px; height: 80px; display: flex; align-items: center; justify-content: center; padding: 0 8px; margin-right: 15px; }
.logo-slide img { max-height: 52px; max-width: 190px; width: auto; height: auto; object-fit: contain; display: block; }
.logo-slide h4 { color: #999; font-weight: 700; margin: 0; transition: 0.3s; font-size: 1.5rem; }
.logo-slide h4:hover { color: var(--brand-primary); }
/* X * 235 = 3760（無 JS / 抓取前的靜態 fallback 用） */
@keyframes logo-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-3760px); } }
/* JS 動態佈局：軌道放兩份完全相同的 unit，位移一份（-50%）達成無縫無限迴圈 */
@keyframes logo-loop { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .logo-slide-track { animation: none; } }
.logo-slide::after{content: "";position: absolute; right: -9px; top: 10px; width: 1px;height: 60px;background: rgba(0,0,0,0.1);z-index: 1;}

/* --- DASHBOARD STYLES --- */
#dashboard-view { display: none; background-color: #f0f4f8; min-height: 100vh; padding-top: 100px; padding-bottom: 50px; }

.privacy-banner { background: #e3f2fd; color: #0d47a1; padding: 12px; border-radius: 8px; font-size: 0.85rem; display: flex; align-items: center; margin-bottom: 25px; }

/* ESG Reporting Hub */
.esg-reporting-hub { background: white; border-radius: 15px; padding: 25px; margin-bottom: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-left: 6px solid var(--brand-primary); }
.esg-hub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.esg-hub-title { font-size: 1.2rem; font-weight: 800; color: var(--brand-dark); }
.esg-metric-card { background: #f9fbfb; border-radius: 10px; padding: 15px; text-align: center; height: 100%; transition: 0.3s; }
.esg-metric-card:hover { background: #e0f2f1; transform: translateY(-3px); }
.esg-metric-val { font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); margin: 5px 0; }
.esg-metric-label { font-size: 0.85rem; color: #666; font-weight: 600; }
.esg-link-badge { display: inline-block; background: var(--brand-dark); color: white; padding: 2px 8px; border-radius: 4px; font-size: 0.65rem; margin-top: 5px; }

/* Stats & Charts */
.stat-card-adv { background: white; border-radius: 15px; padding: 25px; height: 100%; box-shadow: 0 4px 10px rgba(0,0,0,0.03); border-left: 5px solid transparent; display: flex; flex-direction: column; justify-content: space-between; }
.stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1; margin-bottom: 15px; color: var(--brand-dark); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; border-top: 1px solid #eee; padding-top: 15px; }
.stat-sub-item h6 { font-size: 0.7rem; color: #999; margin-bottom: 2px; } .stat-sub-item .val { font-size: 0.9rem; font-weight: 700; color: #333; }
.trend-up { color: var(--brand-primary); font-size: 0.8rem; }
.progress-micro { height: 6px; background: #eee; border-radius: 3px; margin-top: 4px; }
.progress-micro .bar { height: 100%; border-radius: 3px; }
.esg-badge { background: #E6F4F1; color: var(--brand-primary); font-size: 0.7rem; padding: 4px 10px; border-radius: 12px; font-weight: 700; border: 1px solid var(--brand-primary); }
.esg-insight { background: #FFF9E6; border-left: 3px solid var(--brand-secondary); padding: 12px; font-size: 0.85rem; color: #555; border-radius: 0 8px 8px 0; margin-top: 15px; }

.analysis-card { background: white; border-radius: 15px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); height: 100%; display: flex; flex-direction: column; min-height: 480px; }
.chart-wrapper { position: relative; height: 300px; width: 100%; flex-grow: 1; min-height: 300px; }
.analysis-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
.analysis-title { font-size: 1.1rem; font-weight: 700; color: var(--brand-dark); display: flex; align-items: center; }
.analysis-title i { margin-right: 10px; color: var(--brand-primary); }

.time-selector { background: white; border-radius: 30px; padding: 5px; display: inline-flex; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.time-btn { border: none; background: transparent; padding: 6px 20px; border-radius: 25px; font-size: 0.9rem; color: #666; font-weight: 600; transition: 0.3s; }
.time-btn.active { background: var(--brand-dark); color: white; }

/* --- TECH PAGE --- */
/* padding-top 含 fixed navbar 的高度（80px + 原本的 100px），讓底色延伸到 navbar 底下，
   不要用外層容器 padding —— 那會露出一條 body 白底的空帶。同 .hero 的做法。 */
.tech-hero { background: var(--brand-light); padding: 180px 0 100px; text-align: center; }
.tech-feature-box { background: white; padding: 30px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); height: 100%; border-bottom: 4px solid var(--brand-primary); }
.advisor-card { text-align: center; background: white; padding: 40px 30px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); height: 100%; transition: 0.3s; }
.advisor-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.advisor-img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; border: 4px solid var(--brand-light); }

.solution-box { background: #fff; padding: 40px; border-radius: 15px; border-left: 6px solid var(--brand-secondary); box-shadow: 0 5px 15px rgba(0,0,0,0.03); height: 100%; }
.app-feature-card { background: white; padding: 25px; border-radius: 15px; text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.05); height: 100%; transition:0.3s; }
.app-feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.benefit-box { background: white; border-radius: 15px; padding: 20px; display: flex; align-items: center; box-shadow: 0 5px 15px rgba(0,0,0,0.03); margin-bottom: 20px; transition:0.3s; }
.benefit-box:hover { transform: translateX(5px); }
.benefit-icon { font-size: 2.2rem; color: var(--brand-primary); margin-right: 25px; width: 60px; text-align: center; }

/* Markers Grid */
.markers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-top: 30px; }
.marker-item { background: white; border-radius: 10px; padding: 15px; font-size: 0.9rem; color: #555; text-align: center; transition: all 0.3s; box-shadow: 0 3px 6px rgba(0,0,0,0.05); border: 1px solid transparent; font-weight: 500; }
.marker-item:hover { background: var(--brand-primary); color: white; transform: translateY(-3px); box-shadow: 0 8px 15px rgba(42, 157, 143, 0.3); border-color: var(--brand-primary); }

footer { background: var(--brand-dark); color: #ccc; padding: 60px 0 30px; font-size: 0.9rem; }
footer h6 { color: white; letter-spacing: 1px; }
footer a { color: #ccc; transition: 0.3s; text-decoration: none; }
footer a:hover { color: var(--brand-primary); text-decoration: underline; }

/* --- COMMITMENT PAGE（commitment.html 專用，全部以 .commitment- 前綴 scope） --- */
/* padding-top 同樣含 navbar 高度（80px + 60px），漸層才會延伸到 navbar 底下 */
.commitment-hero { background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-primary) 100%); color: #fff; padding: 140px 0 60px; text-align: center; }
.commitment-hero h1 { font-weight: 800; font-size: 2.4rem; letter-spacing: 1px; margin: 0; }
.commitment-hero .commitment-subtitle { font-size: 1.05rem; opacity: 0.9; margin: 14px auto 0; max-width: 720px; line-height: 1.7; }
@media (max-width: 767px) { .commitment-hero { padding: 120px 0 40px; } .commitment-hero h1 { font-size: 1.7rem; } }
.commitment-lead { background: var(--brand-light); border-left: 4px solid var(--brand-primary); border-radius: 0 8px 8px 0; padding: 22px 26px; font-size: 1.05rem; color: var(--brand-dark); line-height: 1.9; margin-bottom: 32px; }
.commitment-body p, .commitment-body .commitment-para { font-size: 1.05rem; line-height: 1.95; color: var(--text-body); margin-bottom: 1.4rem; text-align: justify; }
/* .commitment-para 是 div：中/日文為純文字，英文版內含 <p> + <ul>。
   收緊導引句與清單的間距，並避免最後一段與容器 margin 疊加。 */
.commitment-body .commitment-para > p { margin-bottom: 1rem; }
.commitment-body .commitment-para > p:last-child { margin-bottom: 0; }
.commitment-list { margin: 0 0 1.2rem; padding-left: 1.5rem; text-align: left; }
.commitment-list li { margin-bottom: 0.5rem; }
.commitment-list li::marker { color: var(--brand-primary); }
.commitment-mech-card { background: var(--brand-light); border: 1px solid #e2e8f0; border-radius: 12px; padding: 26px; height: 100%; }
.commitment-mech-card h3 { color: var(--brand-dark); font-size: 1.12rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: flex-start; line-height: 1.5; }
.commitment-num { background: var(--brand-primary); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; margin-right: 10px; flex-shrink: 0; }
.commitment-mech-card p { font-size: 1rem; line-height: 1.9; color: var(--text-body); margin: 0; text-align: justify; }
.commitment-cta { display: block; text-align: center; margin-top: 2.4rem; color: var(--brand-primary); text-decoration: none; font-weight: 700; font-size: 1.05rem; transition: 0.3s; }
.commitment-cta:hover { color: var(--brand-dark); text-decoration: underline; }
