* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft JhengHei", sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #1a365d;
    color: #ffffff;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    font-size: 24px;
    color: #ecc94b;
    letter-spacing: 2px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

nav ul li a:hover,
nav ul li a.active {
    color: #1a365d;
    background-color: #ecc94b;
}

.marquee-container {
    background-color: #ecc94b;
    color: #1a365d;
    padding: 10px 5%;
    font-weight: bold;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.05);
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

.page-content {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.page-content.active {
    display: block;
    opacity: 1;
}

main {
    flex: 1;
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}


.hero-banner {
    position: relative;
    height: 500px;
    overflow: hidden;
    background-color: #2d3748;
    border-radius: 12px;
    margin-bottom: 40px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 54, 93, 0.45);
}

.hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
}

.hero-text h2 {
    font-size: 38px;
    margin-bottom: 15px;
    color: #ecc94b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.hero-text p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.counter-section {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    text-align: center;
    border: 1px solid #e2e8f0;
}

.counter-section h3 {
    font-size: 24px;
    color: #1a365d;
    margin-bottom: 25px;
}
.counter-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}
.counter-box {
    flex: 1;
    min-width: 200px;
    padding: 10px;
}

.counter-box.views-box {
    border-left: 2px dashed #ecc94b;
}
@media (max-width: 768px) {
    .counter-box.views-box {
        border-left: none;
        border-top: 2px dashed #ecc94b;
        padding-top: 20px;
    }
}

.counter-number {
    font-size: 44px;
    font-weight: bold;
    color: #2b6cb0;
    margin-bottom: 10px;
}
.counter-number.views-num {
    color: #dd6b20;
}
.counter-label {
    font-size: 16px;
    color: #718096;
    line-height: 1.4;
}


.story-section {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 50px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}
.story-content {
    max-width: 800px;
    margin: 0 auto;
}
.story-content h3 {
    color: #2b6cb0;
    font-size: 26px;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 1px;
}
.story-content p {
    color: #4a5568;
    line-height: 1.9;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
}

/* ========== 🆕 公司簡介圖片畫廊 - 新增樣式 ========== */
.story-gallery-divider {
    margin: 40px 0 30px;
    text-align: center;
    position: relative;
}
.story-gallery-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e0, transparent);
}
.story-gallery-title {
    display: inline-block;
    position: relative;
    background: #ffffff;
    padding: 0 24px;
    color: #1a365d;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}
.story-gallery-title span {
    color: #ecc94b;
    margin-right: 4px;
}

.story-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: #edf2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4 / 3;
    /* 保持統一比例 */;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.13);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* 圖片上的放大鏡圖示提示 */
.gallery-item::after {
    content: '🔍';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    background: rgba(26, 54, 93, 0.75);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 2;
}
.gallery-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* 圖片下方說明文字 */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(26, 54, 93, 0.85), transparent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 2;
    pointer-events: none;
}

/* ========== 🆕 Lightbox 燈箱樣式 ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    animation: fadeIn 0.25s ease;
}
.lightbox-overlay.active {
    display: flex;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: zoomIn 0.3s ease;
}
@keyframes zoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 38px;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10000;
    line-height: 1;
    user-select: none;
}
.lightbox-close:hover {
    color: #ecc94b;
}

.lightbox-caption {
    color: #cbd5e0;
    font-size: 15px;
    margin-top: 16px;
    text-align: center;
    max-width: 80%;
    cursor: default;
}

/* 響應式：圖片畫廊 */
@media (max-width: 920px) {
    .story-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
@media (max-width: 560px) {
    .story-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .gallery-item {
        aspect-ratio: 16 / 10;
    }
    .story-section {
        padding: 30px 18px;
    }
}


.product-intro-text {
    text-align: center;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto 30px auto;
    font-size: 16px;
    line-height: 1.6;
}

.category-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}
.category-btn {
    background-color: transparent;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.category-btn:hover {
    color: #1a365d;
}
.category-btn.active {
    color: #1a365d;
    font-weight: bold;
}
.category-btn.active::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #1a365d;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.product-img-wrapper {
    width: 100%;
    height: 240px;
    background-color: #ffffff;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #f0f4f8;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #1a365d;
    color: #ffffff;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 2px;
    letter-spacing: 1px;
}

.product-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-name {
    font-size: 19px;
    color: #1a365d;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.product-desc {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 25px;
    flex: 1;
}

.product-action {
    border-top: 1px solid #edf2f7;
    padding-top: 15px;
}
.detail-btn {
    background-color: #ffffff;
    color: #1a365d;
    border: 1px solid #1a365d;
    padding: 10px 0;
    width: 100%;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.detail-btn:hover {
    background-color: #1a365d;
    color: #ffffff;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}
.page-item {
    background-color: #ffffff;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
}
.page-item.active {
    background-color: #1a365d;
    color: #ffffff;
    border-color: #1a365d;
    font-weight: bold;
}
.page-item.disabled {
    background-color: #edf2f7;
    color: #a0aec0;
    cursor: not-allowed;
}


.featured-post {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
}
.featured-img {
    flex: 1.2;
    min-height: 300px;
}
.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.post-meta {
    font-size: 13px;
    color: #b7791f;
    font-weight: bold;
    margin-bottom: 10px;
}
.featured-title {
    font-size: 24px;
    color: #1a365d;
    margin-bottom: 15px;
}
.featured-excerpt {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 25px;
}


.contact-wrapper {
    max-width: 700px;
    margin: 0 auto;
}
.contact-info-card {
    background-color: #ffffff;
    padding: 50px 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    border-top: 5px solid #1a365d;
    text-align: center;
}
.contact-info-card h3 {
    color: #1a365d;
    font-size: 24px;
    margin-bottom: 35px;
}
.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}
.info-icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.info-text h4 {
    font-size: 16px;
    color: #718096;
    margin-bottom: 8px;
}
.info-text p {
    font-size: 28px;
    font-weight: bold;
}
.phone-link {
    color: #2b6cb0;
    text-decoration: none;
    background-color: #edf2f7;
    padding: 10px 25px;
    border-radius: 30px;
    display: inline-block;
}
.phone-link:hover {
    background-color: #ecc94b;
    color: #1a365d;
}

.page-header {
    text-align: center;
    margin-bottom: 15px;
}
.page-header h2 {
    font-size: 32px;
    color: #1a365d;
    font-weight: bold;
}

/* ===== 修改後的 footer（支援左文右圖排版）===== */
footer {
    background-color: #2d3748;
    color: #a0aec0;
    padding: 30px 5%;               /* 稍微增加內距，左右留白更多 */
    font-size: 14px;
    margin-top: auto;
    border-top: 3px solid #ecc94b;

    /* ✅ 新增這四行，讓 footer 變成左右排列 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;                /* 畫面太小時自動換行，手機版也適用 */
}

/* 左側文字區塊 */
.footer-left {
    text-align: left;               /* 文字靠左（原本是置中，現在左對齊） */
    max-width: 70%;                 /* 避免太寬擠到圖片，可依需求調整 */
    line-height: 1.8;
}

/* 右側圖片 */
.footer-right-img {
    max-width: 120px;               /* 限制圖片最大寬度 */
    height: auto;
    flex-shrink: 0;                 /* 防止圖片被擠壓變形 */
}

/* --- 手機版調整：窄螢幕時圖片移到下方並置中 --- */
@media (max-width: 600px) {
    footer {
        flex-direction: column;     /* 改為上下排列 */
        align-items: center;
        text-align: center;
    }
    .footer-left {
        text-align: center;
        max-width: 100%;
    }
    .footer-right-img {
        margin-top: 20px;
        max-width: 90px;            /* 手機上圖片稍微小一點 */
    }
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 920px) {
    .featured-post {
        flex-direction: column;
    }
    .featured-img {
        width: 100%;
        min-height: 250px;
    }
}
@media (max-width: 650px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    nav ul li {
        margin: 5px;
    }
    .counter-grid {
        flex-direction: column;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 聯絡表單樣式 ========== */
.contact-form-section .contact-info-card {
    text-align: left;
    padding: 40px;
}
.contact-form-section h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a365d;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
}
.captcha-group {
    background: #f7fafc;
    padding: 15px 18px;
    border-radius: 8px;
}
.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.captcha-question {
    font-size: 22px;
    font-weight: 700;
    color: #1a365d;
    background: #edf2f7;
    padding: 6px 18px;
    border-radius: 6px;
    letter-spacing: 2px;
    user-select: none;
}
.captcha-equal {
    font-size: 22px;
    font-weight: 700;
    color: #4a5568;
}
#captchaInput {
    width: 120px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}
.captcha-refresh {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}
.captcha-refresh:hover {
    background: #ecc94b;
    border-color: #ecc94b;
}
.captcha-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #e53e3e;
    min-height: 18px;
}
.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: #1a365d;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}
.submit-btn:hover {
    background-color: #ecc94b;
    color: #1a365d;
}
.form-message {
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    min-height: 20px;
}
.form-message.success {
    color: #2f855a;
}
.form-message.error {
    color: #e53e3e;
}
@media (max-width: 600px) {
    .captcha-box {
        flex-direction: column;
        align-items: flex-start;
    }
    #captchaInput {
        width: 100%;
    }
}
