/* 通用樣式 */
:root {
    --primary-color: #003366; /* Deep Blue */
    --secondary-color: #f4f4f4; /* Light Gray */
    --accent-color: #FFD700; /* Gold */
    --text-color: #333;
    --light-text-color: #fff;
}

body {
    font-family: 'Arial', 'Microsoft JhengHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--light-text-color);
    text-decoration: none;
    padding-left: 20px;
    display: flex;
    align-items: center;
}

.company-logo {
    height: 40px;
    margin-right: 10px;
}

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header nav {
    padding-right: 20px;
}

header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: var(--light-text-color);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--accent-color);
}

.lang-switch, .lang-switch-mobile {
    cursor: pointer;
    color: var(--light-text-color);
    margin-left: 20px;
    font-weight: bold;
}

.lang-switch:hover, .lang-switch-mobile:hover {
    color: var(--accent-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding-right: 20px;
    z-index: 1001;
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    background-color: var(--primary-color);
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.mobile-menu.active {
    max-height: 300px;
    padding: 10px 0;
}

.mobile-menu a {
    color: var(--light-text-color);
    padding: 15px 20px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.mobile-menu a:hover {
    background-color: #004488;
}

/* 主視覺區塊 - 左右佈局 (index.html) */
.hero-optimized {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 40px 0;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.hero-image-wrapper {
    flex: 1;
    max-width: 50%;
    text-align: center;
}

.hero-image-new {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
}

.hero-content-optimized {
    flex: 1;
    max-width: 50%;
    padding: 20px;
    text-align: left;
}

.hero-content-optimized h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
}

.hero-content-optimized p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards 0.3s;
}

.hero-content-optimized .cta-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: inline-block;
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards 0.6s;
}

.hero-content-optimized .cta-button:hover {
    background-color: #e5b800;
}

/* 左滑入動畫 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section {
    padding: 60px 20px;
    text-align: center;
}

.section.services {
    padding-bottom: 30px;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 0;
    display: flex;
    align-items: center;
}

.service-card h3 i {
    margin-right: 15px;
    font-size: 2rem;
    color: var(--accent-color);
}

.service-card p {
    font-size: 1rem;
}

.service-card .read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
}

.service-card .read-more:hover {
    text-decoration: underline;
}

/* 關於我們區塊 - 樣式 (index.html) */
.about-section {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 40px 20px;
}

.about-content {
    max-width: 800px;
    margin: auto;
    text-align: center;
}

.about-content h2 {
    color: var(--accent-color);
}

/* 新增的按鈕樣式 */
.about-section .cta-button {
    display: inline-block;
    margin-top: 30px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.about-section .cta-button:hover {
    background-color: #e5b800;
}

/* 關於我們主內容區塊 - (about.html) */
.about-main-content {
    padding: 80px 20px;
    background-color: #fff;
    text-align: left;
}

.about-us-container h1 {
    font-size: 3rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.about-us-container h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
}

.about-us-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text-content h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-text-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 30px;
}

.about-text-content ul {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
}

.about-text-content ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}

.about-text-content ul li::before {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 0;
}

.about-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-page-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

footer {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 40px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: left;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li a {
    color: var(--light-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 8px;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-links a {
    color: var(--light-text-color);
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

#back-to-top.show {
    display: flex;
}

#back-to-top:hover {
    background-color: #e5b800;
}

@media (max-width: 768px) {
    header nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    header .header-content {
        justify-content: space-between;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .social-links {
        margin-top: 15px;
    }
    .social-links a {
        margin: 0 10px;
    }

    /* 重新修正主視覺區塊的行動版佈局 */
    .hero-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-image-wrapper {
        order: -1;
        max-width: 100%;
        margin-bottom: 20px;
    }

    .hero-image-new {
        width: 100%;
        max-width: 400px;
    }

    .hero-content-optimized {
        max-width: 100%;
        padding: 0 20px;
        text-align: center;
    }

    .hero-content-optimized h1,
    .hero-content-optimized p {
        text-align: center;
    }
    
    .hero-content-optimized .cta-button {
        margin: 20px auto 0;
        display: block;
    }

    /* 修正 about.html 的行動版佈局問題 */
    .about-us-grid {
        grid-template-columns: 1fr;
    }

    .about-image-wrapper {
        order: -1;
    }

    .about-main-content {
        padding: 40px 20px;
    }

    .about-us-container h1 {
        font-size: 2.5rem;
    }

    /* 漢堡選單的修正 */
    .mobile-menu {
        top: 60px;
        position: absolute;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        visibility: hidden;
        /* 新增：確保選單內容不被裁切 */
        padding: 10px 0;
        box-sizing: border-box; /* 確保 padding 不會增加寬度 */
        width: 100%; /* 讓選單填滿寬度 */
        right: 0;
        left: 0;
    }

    .mobile-menu.active {
        transform: translateY(0);
        visibility: visible;
        max-height: 500px; /* 確保有足夠空間 */
    }
    
    /* 修正手機選單內的連結與語言切換樣式，確保文字完整顯示 */
    .mobile-menu a, .lang-switch-mobile {
        padding: 15px 20px;
        text-align: left; /* 確保文字靠左對齊 */
        width: 100%;
        box-sizing: border-box;
    }

    .lang-switch-mobile {
        margin: 0; /* 移除額外 margin */
        display: block;
    }
}