/* ==========================================================================
   聯友機電 - 全站統一品牌樣式表 (大亞佈局 + 方案 A 純白融合 + 極光滾動漸層)
   ========================================================================== */

:root {
    /* 大亞/聯友 雙核心識別色 */
    --brand-red: #E60012;       /* 大亞紅 */
    --brand-copper: #B57C59;    /* 紅銅色 - 琥珀銅，象徵專業線纜 */
    
    /* 輔助科技感色系 */
    --dark-charcoal: #121212;   /* 科技炭黑 */
    --dark-gray: #1C1C1C;       /* 深灰 - 用於頁尾 */
    --light-bg: #FFFFFF;        /* 純白卡片背景 */
    --border-color: #E5E8EB;    /* 精緻邊框線 */
    
    /* 文字顏色 */
    --text-primary: #222222;    /* 主要文字 */
    --text-secondary: #666666;  /* 說明文字/副標題 */
    --text-light: #999999;      /* 輔助文字 */
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* 基礎重設 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    
    /* 初始預設底色 */
    background-color: #F5F7FA; 
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0.02) 100%);
    background-attachment: fixed;
    
    /* 背景顏色切換時的平滑轉換：1.5 秒 */
    transition: background-color 1.5s ease-in-out;
}

/* 方案一的極致優化：在最底層生成兩個緩慢流動、發光羽化的冷暖色流體光球 */
body::before, body::after {
    content: "";
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px); /* 極度羽化模糊，形成朦朧柔和的光暈 */
    opacity: 0.15;       /* 保持極度低調、高級的高雅質感 */
    z-index: -1;         /* 確保位於所有卡片的最底層，完全不干擾內容閱讀 */
    pointer-events: none;
}

/* 冰晶電力藍光球 - 在左上方緩慢漂浮 */
body::before {
    background: radial-gradient(circle, #0066CC 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatLightOne 22s infinite alternate ease-in-out;
}

/* 暖琥珀銅色光球 - 在右下方緩慢漂浮 (象徵電線電纜導體核心) */
body::after {
    background: radial-gradient(circle, var(--brand-copper) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation: floatLightTwo 26s infinite alternate ease-in-out;
}

/* 光球緩慢漂流的 CSS 3D 動畫 */
@keyframes floatLightOne {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(120px, 80px) scale(1.15); }
}
@keyframes floatLightTwo {
    0% { transform: translate(0, 0) scale(1.15); }
    100% { transform: translate(-140px, -90px) scale(0.9); }
}

/* 方案三的核心優化：冷暖高對比滾動漸層底色 (大幅拉開色差，消除單調感) */
body.bg-state-1 { background-color: #F5F7FA; } /* 階段 1：冰晶科技灰 */
body.bg-state-2 { background-color: #FAF3EE; } /* 階段 2：大亞琥珀暖銅光 (溫暖、極具質感) */
body.bg-state-3 { background-color: #EBF4FA; } /* 階段 3：冰晶電力藍 */
body.bg-state-4 { background-color: #E5E7EB; } /* 階段 4：洗鍊水泥灰 */

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 隱藏與輔助類別 */
.hidden {
    display: none !important;
}

/* --- 1. 導覽列 Navigation Bar --- */
.site-header {
    position: fixed;            
    top: 20px;                  
    left: 50%;
    transform: translateX(-50%);
    width: 90%;                 
    max-width: 1080px;          
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-radius: 12px;        
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); 
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    padding: 0 40px;
    height: 92px;               
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: relative;
}

/* 左側商標區塊 */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;                  
}

.logo-icon {
    height: 48px;               
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-logo .company-name {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--dark-charcoal);
    letter-spacing: 1px;
}

.brand-logo .company-en {
    font-size: 9px;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
}

/* 預設隱藏手機版漢堡按鈕與隱藏的勾選框 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
}

.hamburger .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* 桌機端導覽選單 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 45px;                  
}

.nav-link {
    font-size: 16px;            
    font-weight: 700;
    color: var(--text-primary);
    padding: 8px 0;
    position: relative;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-red);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--brand-red);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--brand-red);
}

/* 下拉指示符 */
.nav-link.has-dropdown::after {
    content: " ▾";
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-link.has-dropdown:hover::after {
    transform: rotate(180deg);
    color: var(--brand-red);
}

/* --- 2. 英雄橫幅 Hero Section & 懸浮卡片 (方案四：純文字無感疊加) --- */
.hero-section {
    position: relative;
    width: 90%;                 
    max-width: 1080px;          
    margin: 135px auto 40px auto; 
    background-color: transparent; 
    border-radius: 24px;        
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hero-bg {
    width: 100%;
    height: auto;               
    display: block;
    opacity: 1;                 
}

/* 方案四：純文字無感疊加樣式 */
.hero-overlay-card {
    position: absolute;
    bottom: 30px;
    left: 30px;
    max-width: 440px;
    background-color: transparent;     /* 去除卡片白底 */
    border: none;                      /* 去除邊框 */
    box-shadow: none;                  /* 去除投影 */
    backdrop-filter: none;             /* 去除磨砂效果 */
    -webkit-backdrop-filter: none;
    padding: 0;                        /* 內縮歸零，讓字直接浮現於圖面上 */
    text-align: left;
    z-index: 10;
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .hero-overlay-card {
        bottom: 45px;
        left: 45px;
    }
}

.hero-overlay-card h2 {
    font-size: 24px;
    font-weight: 900;
    color: var(--dark-charcoal);       /* 使用深炭黑 */
    margin-bottom: 10px;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.hero-overlay-card h2 span {
    color: var(--brand-red);           /* 標題帶有品牌紅點綴 */
}

.hero-overlay-card p {
    font-size: 13.5px;
    color: var(--text-secondary);      /* 中灰說明文字，與白底羽化完美融合 */
    line-height: 1.7;
    font-weight: 500;
}

/* --- 3. 橫幅下方大標題與引言區塊 --- */
.hero-intro-text {
    display: none;                      /* 預設在寬螢幕/桌機端隱藏 */
    width: 90%;                 
    max-width: 1080px;          
    margin: 40px auto 20px auto; 
    padding: 0 10px;            
    text-align: left;           
    border-left: 4px solid var(--brand-red);
    padding-left: 20px;
}

.intro-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 900;
    color: var(--dark-charcoal);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.intro-title span {
    color: var(--brand-red);
}

.intro-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 800px;           
    line-height: 1.8;
    font-weight: 500;
}

/* --- 4. 卓越亮點 Highlights Section --- */
.section-wrapper {
    max-width: 1080px;          
    margin: 0 auto;
    padding: 60px 20px 80px 20px;
}

.section-header {
    margin-bottom: 50px;
    text-align: left;
    border-left: 6px solid var(--brand-red);
    padding-left: 20px;
}

.section-label {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--brand-copper);
    font-weight: 700;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

.section-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--dark-charcoal);
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.highlight-card {
    background: #FFFFFF;        
    border-top: 4px solid var(--brand-copper);
    padding: 40px 30px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.06);
    border-top-color: var(--brand-red);
}

.highlight-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-copper);
    margin-bottom: 20px;
    display: block;
}

.highlight-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin-bottom: 15px;
}

.highlight-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
}

/* --- 5. 產品服務 Product Cards Grid --- */
.product-showcase {
    background-color: transparent; 
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background-color: #FFFFFF;         /* 改為純白色，與自帶白底的結構組合圖完美融為一體 */
    padding: 16px;                     /* 內縮留白 16px，使圖片不緊貼邊框 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #E5E8EB;  /* 增加極細分割線，精準區隔圖片與下方文字區 */
}

.product-card-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;               /* 完整縮放顯現，不裁切任何部分 */
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-img img {
    transform: scale(1.04);            /* 滑鼠懸停時進行優雅、微幅的放大 */
}

.product-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin-bottom: 10px;
}

.product-card-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    flex-grow: 1;
}

.product-card-btn {
    align-self: flex-start;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-red);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-card-btn::after {
    content: '→';
    transition: transform 0.3s ease;
}

.product-card-btn:hover::after {
    transform: translateX(5px);
}

/* --- 6. 經營精神 Corporate Identity --- */
.values-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
}

.values-intro {
    padding-right: 20px;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.value-item {
    border-left: 3px solid var(--brand-copper);
    padding: 20px 25px;
    background-color: #FFFFFF; 
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.value-item h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin-bottom: 8px;
}

.value-item p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- 7. 企業級多欄式頁尾 Corporate Footer --- */
.site-footer {
    background-color: var(--dark-gray);
    color: #FFFFFF;
    padding-top: 80px;
    padding-bottom: 40px;
    width: 100%;
}

.footer-container {
    max-width: 1080px;          
    margin: 0 auto;
    padding: 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 60px;
    margin-bottom: 40px;
}

.footer-brand .footer-logo-text {
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.footer-brand .footer-logo-en {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.footer-brand .footer-desc {
    color: #888;
    font-size: 13.5px;
    max-width: 320px;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25px;
    height: 2px;
    background-color: var(--brand-red);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #888;
    font-size: 13.5px;
}

.footer-links a:hover {
    color: var(--brand-red);
}

.footer-info {
    font-size: 13.5px;
    color: #888;
    line-height: 2;
}

/* 水平置中對齊 */
.footer-bottom {
    display: flex;
    justify-content: center;     
    text-align: center;
    align-items: center;
    font-size: 12px;
    color: #666;
    width: 100%;
}

/* --- 8. 響應式佈局 (RWD) 與 漢堡選單特效 --- */
@media (max-width: 992px) {
    .highlight-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .values-section {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .site-header {
        top: 10px;
        width: 90%;
    }
    
    .nav-container {
        padding: 0 20px;
        height: 65px;
    }

    /* 手機版：顯示漢堡按鈕 */
    .hamburger {
        display: flex; 
        z-index: 1001;
    }

    /* 漢堡按鈕點擊後的旋轉動畫 */
    .menu-toggle-cb:checked ~ .hamburger .bar:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
        background-color: var(--brand-red);
    }
    .menu-toggle-cb:checked ~ .hamburger .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-cb:checked ~ .hamburger .bar:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
        background-color: var(--brand-red);
    }

    /* 手機版導覽選單包裹層 */
    .nav-menu-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border-radius: 0 0 12px 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    /* 當核取方塊被點擊時，選單向下推展 */
    .menu-toggle-cb:checked ~ .nav-menu-wrapper {
        max-height: 400px; 
    }

    .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 15px 30px !important;
    }

    .nav-link {
        padding: 12px 0 !important;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    }
    
    .nav-link::after {
        display: none !important; 
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }

    /* RWD 佈局落至單欄 */
    .hero-section {
        margin-top: 95px;
    }
    
    /* 手機版隱藏懸浮卡片 */
    .hero-overlay-card {
        display: none !important; 
    }
    
    /* 手機版顯示圖片下方引言區 */
    .hero-intro-text {
        display: block !important; 
    }
    
    .highlight-grid {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .footer-top {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}