/* css/style.css */
:root {
    --primary-color: #0066cc;
    --secondary-color: #2c3e50;
    --accent-color: #00c3ff;
    --light-bg: #f8f9fa;
    --text-color: #333;
    --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 引入 Noto Sans TC 思源黑體 */
body { 
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'Helvetica Neue', Arial, sans-serif; 
    line-height: 1.6; 
    color: var(--text-color); 
    background-color: var(--white); 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; position: relative; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; padding: 15px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 15px; }

/* --- Header & Nav --- */
header { background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 1000; }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }

.logo { display: flex; align-items: center; }
.logo img { 
    max-height: 50px; 
    width: auto;      
    margin-right: 10px;
}

.nav-menu { display: flex; gap: 20px; margin: 0; padding: 0; }
.nav-menu a { font-weight: 500; color: var(--secondary-color); font-size: 16px; }
.nav-menu a:hover { color: var(--primary-color); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-content { display: none; position: absolute; top: 100%; left: 0; background: var(--white); box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-width: 220px; padding: 10px 0; border-radius: 4px; z-index: 1001; }
.dropdown-content a { display: block; padding: 10px 20px; font-size: 14px; border-bottom: 1px solid #eee; }
.dropdown:hover .dropdown-content { display: block; }

/* --- Hero Section (首頁大圖) --- */
.hero {
    position: relative;
    min-height: 700px;
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    padding-top: 180px; 
    text-align: center;
    overflow: hidden; 
}

/* 背景圖層：無遮罩，原圖顯示 */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
    /* 圖片已改由 index.php 讀取資料庫設定 */
    background-color: var(--secondary-color);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    animation: heroZoom 20s ease-in-out infinite alternate;
}

/* 流光特效層 */
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%; 
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg); 
    z-index: 1; 
    pointer-events: none; 
    animation: imageShine 6s infinite linear; 
}

@keyframes heroZoom { 
    0% { transform: scale(1); } 
    100% { transform: scale(1.05); } 
}
@keyframes imageShine { 0% { left: -150%; } 40% { left: 150%; } 100% { left: 150%; } }

/* 文字內容層 */
.hero-content {
    position: relative;
    z-index: 10; 
    opacity: 0; 
    transform: translateY(30px); 
    animation: fadeInUp 1s ease-out forwards; 
    animation-delay: 0.3s; 
}

/* 文字樣式 */
.hero h1 { 
    font-size: 3.8rem; 
    font-weight: 700; 
    margin-bottom: 20px; 
    text-shadow: 0 4px 8px rgba(0,0,0,0.8); 
    letter-spacing: 2px;
    color: #ffffff;
}

.hero p { 
    font-size: 1.6rem; 
    font-weight: 400;
    margin-bottom: 40px; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 1px;
    opacity: 1; 
    color: #ffffff;
}

/* [修改] 按鈕樣式 - 顏色改深 */
.btn { 
    display: inline-block; 
    /* 原本是 var(--accent-color) #00c3ff，現在改深為 #0077cc */
    background: #005fa3; 
    color: var(--white); 
    padding: 15px 40px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 1.1rem;
    letter-spacing: 1px;
    /* 陰影顏色也配合調深 */
    box-shadow: 0 4px 15px rgba(0, 119, 204, 0.4); 
    transition: all 0.3s ease;
}

.btn:hover { 
    /* Hover 時變得更深 */
    background: #0077cc; 
    transform: translateY(-3px); 
    box-shadow: 0 6px 20px rgba(0, 119, 204, 0.6);
}

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* --- Services Grid --- */
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2.5rem; color: var(--primary-color); }
#services { background-color: #eaeef2; }

.service-card {
    background: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 0; 
    text-align: center;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12); 
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}
.service-card:hover::after { width: 100%; }

.service-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #e0e0e0;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.service-card:hover .service-img-top { transform: scale(1.1); }

.service-body { padding: 30px 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.service-card h3 { margin-bottom: 15px; font-size: 1.4rem; font-weight: 600; color: #333; }
.service-card p { color: #666; margin-bottom: 25px; font-size: 1rem; line-height: 1.6; }

.service-link {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.service-link:hover { border-bottom: 2px solid var(--primary-color); transform: translateX(5px); }

/* --- About Page Styles --- */
.page-header {
    /* 圖片與漸層已改由各頁面 (about.php, service-*.php) 動態載入 */
    background-color: var(--secondary-color);
    padding: 140px 0;
    color: #ffffff;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: ''; position: absolute; top: 30%; left: -100px; width: 150px; height: 2px;
    background: linear-gradient(90deg, transparent, #00c3ff, transparent);
    box-shadow: 0 0 10px #00c3ff; animation: dataFlow 3s infinite linear; opacity: 0.7;
}
.page-header::after {
    content: ''; position: absolute; top: 70%; left: -100px; width: 100px; height: 3px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    box-shadow: 0 0 15px #ffffff; animation: dataFlow 5s infinite linear; animation-delay: 1.5s; opacity: 0.5;
}
@keyframes dataFlow {
    0% { left: -20%; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 120%; opacity: 0; }
}

.page-header .container { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; position: relative; z-index: 2; }
.page-header h1.en-title { color: #ffffff !important; font-size: 3.5rem; font-weight: 800; margin-bottom: 10px; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 4px 10px rgba(0,0,0,0.5); line-height: 1.1; }
.page-header p.en-subtitle { font-size: 1.5rem; font-weight: 300; opacity: 0.9; margin-bottom: 30px; letter-spacing: 1px; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.page-header .zh-label { display: inline-block; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(5px); padding: 8px 25px; border-right: 4px solid #00c3ff; border-left: none; font-size: 1.2rem; font-weight: bold; color: #fff; margin-bottom: 20px; }

.about-label {
    display: inline-block;
    color: #257; 
    font-size: 1.1rem;
    font-weight: 600; 
    letter-spacing: 1px; 
    margin-bottom: 20px;
    padding-left: 15px; 
    border-left: 5px solid var(--accent-color); 
    line-height: 1.2;
    background-color: transparent; 
    box-shadow: none; 
}

.content-section { padding: 80px 0; background-color: #f2f4f6; }
.service-detail-text h2 { color: #0066cc; margin-bottom: 25px; font-size: 2rem; font-weight: 700; text-align: left; }
.service-detail-text p { font-size: 1.1rem; line-height: 1.8; color: #555; margin-bottom: 20px; text-align: justify; }
.highlight { color: #d35400; font-weight: bold; }
.service-detail-img { width: 100%; border-radius: 10px; box-shadow: 0 15px 30px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
.service-detail-img:hover { transform: translateY(-5px); }

/* --- Footer --- */
footer { background: var(--secondary-color); color: var(--white); padding: 60px 0 20px; margin-top: auto; }
.footer-info h4 { margin-bottom: 20px; color: var(--white); font-size: 1.2rem; }
.footer-info p { margin-bottom: 12px; color: #ccc; font-size: 0.95rem; }
.copyright { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #444; font-size: 0.9rem; color: #888; }

/* TOP Button & Animations */
#myBtn { display: none; position: fixed; bottom: 20px; right: 20px; z-index: 99; border: none; outline: none; background-color: var(--primary-color); color: white; cursor: pointer; padding: 15px; border-radius: 50%; font-size: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.3); width: 50px; height: 50px; transition: 0.3s; }
#myBtn:hover { background-color: var(--secondary-color); transform: translateY(-3px); }
.reveal { opacity: 0; transform: translateY(50px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.section-title.reveal.fancy-text { transform: none; transition: none; opacity: 1; }
.section-title.reveal.fancy-text h2, .section-title.reveal.fancy-text p { opacity: 0; }
.section-title.reveal.fancy-text.active h2 { color: var(--primary-color); animation: bounceIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; }
.section-title.reveal.fancy-text.active p { color: #666; animation: trackingIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; animation-delay: 0.3s; }
@keyframes bounceIn { 0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 20% { transform: scale3d(1.1, 1.1, 1.1); } 40% { transform: scale3d(0.9, 0.9, 0.9); } 60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); } 80% { transform: scale3d(0.97, 0.97, 0.97); } 100% { opacity: 1; transform: scale3d(1, 1, 1); } }
@keyframes trackingIn { 0% { letter-spacing: 10px; opacity: 0; } 40% { opacity: 0.6; } 100% { letter-spacing: normal; opacity: 1; } }

/* --- Mobile Menu --- */
.menu-toggle, .menu-icon { display: none; }
@media (max-width: 768px) {
    .col-4, .col-6 { flex: 0 0 100%; max-width: 100%; }
    .hero h1 { font-size: 2.5rem; }
    .page-header { padding: 80px 0; }
    .page-header .container { align-items: center; text-align: center; }
    .page-header h1.en-title { font-size: 2.2rem; }
    .page-header p.en-subtitle { font-size: 1.1rem; }
    .page-header .zh-label { border-right: none; border-bottom: 3px solid #00c3ff; }
    .menu-icon { display: block; cursor: pointer; font-size: 28px; padding: 5px; color: var(--secondary-color); position: absolute; right: 15px; top: 15px; z-index: 1002; }
    .nav-menu { display: none; flex-direction: column; width: 100%; background-color: #ffffff; position: absolute; top: 70px; left: 0; box-shadow: 0 5px 10px rgba(0,0,0,0.1); padding: 0; z-index: 999; text-align: center; max-height: calc(100vh - 70px); overflow-y: auto; }
    .nav-menu li { width: 100%; border-bottom: 1px solid #eee; }
    .nav-menu li a { padding: 15px; display: block; }
    .dropdown-content { position: relative; box-shadow: none; background-color: #f9f9f9; display: none; width: 100%; max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); }
    .dropdown-content a { padding: 12px 20px; font-size: 14px; color: #555; }
    .dropdown:hover .dropdown-content { display: block; }
    #menu-toggle:checked ~ nav .nav-menu { display: flex; }
}

/* --- Footer Contact Icons & Hover Effects --- */

/* 聯絡資訊項目的基本設定 */
.contact-item {
    display: flex;           /* 讓圖示與文字水平排列 */
    align-items: center;     /* 垂直置中 */
    color: #ccc;             /* 預設文字顏色 (淺灰) */
    text-decoration: none;   /* 去除連結底線 */
    margin-bottom: 12px;     /* 項目間距 */
    transition: all 0.3s ease; /*設定動畫過渡時間 */
    cursor: pointer;
    font-size: 0.95rem;      /* 文字大小 */
}

/* 圖示的設定 */
.contact-item i {
    width: 25px;            /* 固定圖示寬度，讓文字整齊對齊 */
    text-align: center;
    margin-right: 10px;     /* 圖示與文字的距離 */
    color: #ccc; /* 圖示預設使用您的強調色 (亮青色) */
    transition: all 0.3s ease;
}

/* --- 滑鼠移過去的發亮特效 (Hover) --- */
.contact-item:hover {
    color: #ffffff;         /* 文字變白 */
    transform: translateX(5px); /* 輕微向右移動，增加動感 */
    /* 文字發光效果 */
    text-shadow: 0 0 8px var(--accent-color); 
}

.contact-item:hover i {
    color: #ffffff;         /* 圖示變白 */
    /* 圖示發光效果 */
    text-shadow: 0 0 10px #ffffff, 0 0 20px var(--accent-color);
    transform: scale(1.1);  /* 圖示稍微放大 */
}

/* 針對原本有的 strong 公司名稱微調 */
.contact-details p {
    margin-bottom: 15px;
    color: var(--white);
    font-size: 1.1rem;
}