/* 基礎樣式重置與設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 區塊樣式設定 */
.section {
    padding: 80px 0;
    position: relative;
}

.dark-bg {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #f0f0f0;
}

.light-bg {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
}

.section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-bg .section-title {
    color: #f0f0f0;
}

.light-bg .section-title {
    color: #1a1a1a;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 50px;
    color: #888;
}

/* 頂部導航樣式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #f0f0f0;
}

.logo img {
    height: 50px;
    /* 已移除文字標題，所以不需要右邊距 */
}

/* 移除原本的logo-text樣式 */
.logo-text {
    display: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.main-nav a:hover {
    color: #e6b325;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #e6b325;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Banner區塊樣式 - 增加彩色度，縮小主標題字體 */
.banner {
    height: 680px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/banner.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
}

/* 增加彩色度效果 */
.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(230, 179, 37, 0.15), 
        rgba(220, 53, 69, 0.1), 
        rgba(0, 123, 255, 0.1), 
        rgba(40, 167, 69, 0.1));
    mix-blend-mode: overlay;
    z-index: 1;
}

/* 光影漸變效果 */
.banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        rgba(255, 255, 255, 0.6),
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: lightEffect 3s infinite;
    z-index: 2;
}

@keyframes lightEffect {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(230, 179, 37, 0.25), 
        rgba(26, 26, 26, 0.25),
        rgba(0, 123, 255, 0.15));
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
}

/* 縮小主標題字體 */
.banner h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.8rem; /* 從3.5rem縮小到2.8rem */
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.subtitle {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #e6b325;
    font-weight: 600;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.banner-text {
    font-size: 1.3rem;
    margin-bottom: 30px;
    max-width: 700px;
    line-height: 1.8;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 25px;
    border-radius: 8px;
    display: inline-block;
}

.btn {
    display: inline-block;
    background: #e6b325;
    color: #1a1a1a;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.btn:hover {
    background: #d4a21e;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 179, 37, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* 手機版返回頁首按鈕 */
.mobile-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #e6b325;
    color: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.mobile-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-back-to-top:hover {
    background: #d4a21e;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(230, 179, 37, 0.5);
}

.mobile-back-to-top i {
    font-size: 1.2rem;
}

/* 產品區塊樣式 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.product-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.light-bg .product-card {
    background: #fff;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-img {
    height: 320px;
    position: relative;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay h3 {
    color: #e6b325;
    font-size: 1.8rem;
    font-weight: 600;
}

.product-card h3 {
    padding: 20px 20px 10px;
    font-size: 1.5rem;
    font-weight: 600;
}

.product-card p {
    padding: 0 20px 20px;
    color: #888;
}

.dark-bg .product-card p {
    color: #ccc;
}

/* 公司簡介樣式 */
.about-content {
    max-width: 900px;
    margin: 0 auto 60px;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: center;
}

.equipment-section {
    margin-top: 60px;
}

.equipment-section h3 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
    color: #e6b325;
}

.equipment-subtitle {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: #888;
}

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

.equipment-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.light-bg .equipment-item {
    background: #fff;
}

.equipment-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.equipment-item p {
    padding: 15px;
    text-align: center;
    font-weight: 500;
}

/* 產品詳細介紹樣式 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 60px;
}

.product-detail.reverse {
    direction: rtl;
}

.product-detail.reverse > * {
    direction: ltr;
}

.product-detail-img {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.product-detail-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-detail-img:hover img {
    transform: scale(1.05);
}

.product-detail-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #e6b325;
}

.product-detail-content p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.project-gallery h3 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    color: #e6b325;
}

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

.gallery-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.light-bg .gallery-item {
    background: #fff;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item p {
    padding: 15px;
    text-align: center;
    font-weight: 500;
}

/* 頁尾樣式 */
.footer {
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-company-name {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #e6b325;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.footer-services {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #aaa;
}

.footer-contact h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #e6b325;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.footer-contact-item i {
    color: #e6b325;
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: #e6b325;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* 右側導航選單 - 修改為滑鼠觸碰時顯示文字 */
.side-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 26, 0.9);
    border-radius: 8px;
    padding: 15px 10px;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    width: auto;
}

.side-nav ul {
    list-style: none;
}

.side-nav li {
    margin-bottom: 15px;
    position: relative;
}

.side-nav a {
    display: flex;
    align-items: center;
    color: #f0f0f0;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    width: 100%;
}

.side-nav a:hover {
    background: rgba(230, 179, 37, 0.2);
    color: #e6b325;
}

.side-nav a.active {
    background: #e6b325;
    color: #1a1a1a;
    font-weight: 600;
}

.side-nav i {
    font-size: 1.3rem; /* 加大圖示 */
    width: 24px; /* 增加寬度 */
    text-align: center;
}

.side-nav span {
    display: none; /* 正常狀態下隱藏文字 */
    white-space: nowrap;
    margin-left: 10px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 滑鼠懸停時顯示文字 */
.side-nav:hover {
    padding-right: 15px;
    background: rgba(26, 26, 26, 0.95);
}

.side-nav:hover span {
    display: inline-block;
    opacity: 1;
    transform: translateX(0);
}

.back-to-top {
    display: block;
    text-align: center;
    background: #333;
    color: #f0f0f0;
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background: #e6b325;
    color: #1a1a1a;
}

.back-to-top i {
    font-size: 1.2rem;
}

.back-to-top span {
    display: none;
    margin-left: 8px;
}

/* 當側邊導航懸停時，顯示回頁首按鈕的文字 */
.side-nav:hover .back-to-top span {
    display: inline-block;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .equipment-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-company-name {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 0;
    }
    
    .main-nav ul {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(26, 26, 26, 0.95);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .main-nav ul.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-nav li {
        margin: 15px 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .banner {
        height: 500px;
        margin-top: 70px;
    }
    
    .banner h1 {
        font-size: 2.2rem; /* 手機上進一步縮小 */
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .equipment-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .side-nav {
        display: none;
    }
    
    /* 手機版顯示返回頁首按鈕 */
    .mobile-back-to-top {
        display: flex;
    }
    
    .footer-company-name {
        font-size: 1.6rem;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .side-nav:hover {
        padding-right: 15px;
    }
    
    /* 桌面版隱藏手機返回頁首按鈕 */
    .mobile-back-to-top {
        display: none;
    }
}