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

:root {
    --primary: #3b5167;
    --secondary: #4d6278;
    --accent: #95a5a6;
    --light: #ecf0f1;
    --dark: #27384b;
    --shadow: rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: #fafafa;
    line-height: 1.8;
    color: #3b5167;
    overflow-x: hidden;
    position: relative;
}

/* ===== 專業背景紋理 ===== */
#wallTexture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.18;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== 導覽列 ===== */
.nav-section {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 25px 50px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Noto Serif TC', serif;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.brand-tagline {
    font-size: 11px;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    gap: 5px;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary);
    font-size: 16px;
    font-weight: 300;
    padding: 12px 28px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(44, 62, 80, 0.05);
}

.nav-link:hover::before,
.nav-link.active::before {
    transform: scaleX(1);
}

.nav-contact {
    display: flex;
    align-items: center;
}

.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
    transition: color 0.3s ease;
}

.nav-phone:hover {
    color: var(--secondary);
}

/* ===== 主視覺區 ===== */
.hero-section {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 100px;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 專業照片輪播 ===== */
.service-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 60px auto;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%;
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider-image.active {
    opacity: 1;
}

/* ===== 區塊標題 ===== */
.section-title {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
}

.title-text {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    font-family: 'Noto Serif TC', serif;
    color: var(--primary);
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.title-accent {
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin: 20px auto 0;
}

.section-title.light .title-text {
    color: white;
}

.section-title.light .title-accent {
    background: white;
}

/* ===== 服務介紹區 ===== */
.services-intro-section {
    padding: 100px 0;
    background: white;
}

.intro-container {
    background: var(--light);
    border-radius: 12px;
    padding: 80px 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.intro-two-column {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 60px;
}

.intro-block {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.intro-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    font-family: 'Noto Serif TC', serif;
    color: var(--primary);
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    letter-spacing: 1px;
}

.intro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-paragraph {
    font-size: clamp(16px, 2vw, 20px);
    line-height: 2;
    color: var(--secondary);
    text-align: justify;
    margin-bottom: 25px;
    font-weight: 400;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
    flex: 1;
    align-content: start;
}

.service-tag {
    padding: 18px 25px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.service-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.25);
}

/* ===== 作品案例區 ===== */
.portfolio-section {
    padding: 100px 0;
    background: #f8f8f8;
}

.portfolio-section > .container {
    max-width: 100%;
    padding: 0;
}

.portfolio-section .section-title {
    padding: 0 40px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 0 15px;
    width: 100%;
}

.portfolio-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.08);
}

.portfolio-item::after {
    content: '查看大圖';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(26, 37, 47, 0.95), transparent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    letter-spacing: 1px;
}

.portfolio-item:hover::after {
    transform: translateY(0);
}

/* ===== 分頁控制 ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 60px;
    padding: 30px 15px;
}

.pagination-btn {
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-family: 'Noto Sans TC', sans-serif;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    padding: 12px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pagination-info span {
    color: var(--secondary);
    font-size: 20px;
}

/* ===== 聯絡資訊區 ===== */
.contact-section {
    position: relative;
    padding: 120px 0 80px;
    background: var(--dark);
    color: white;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    margin-top: 80px;
    margin-bottom: 80px;
}

.contact-item {
    text-align: center;
    padding: 50px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.contact-item.highlight {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.contact-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.contact-value {
    font-family: 'Noto Serif TC', serif;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.contact-value.large {
    font-size: clamp(22px, 3.5vw, 30px);
}

.contact-value.xlarge {
    font-size: clamp(28px, 5vw, 48px);
    color: #fff;
    letter-spacing: 2px;
}

.contact-value.medium {
    font-size: clamp(18px, 3vw, 28px);
    margin: 0;
}

.contact-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.6;
    opacity: 0.9;
}

.contact-desc.emphasis {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.contact-phone-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.contact-phone-link:hover {
    opacity: 0.8;
}

.area-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
}

.area {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.area:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.footer-text {
    text-align: center;
    padding-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ===== 燈箱效果 ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 20px;
    line-height: 1;
    border-radius: 6px;
    z-index: 2001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 25px 20px;
    transition: all 0.3s ease;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    z-index: 2001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* ===== 回到頂部按鈕 ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    display: none;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
    transition: all 0.3s ease;
    font-weight: bold;
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.35);
}

.back-to-top.show {
    display: block;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== 桌面版燈箱活動狀態 ===== */
@media (min-width: 769px) {
    html.lightbox-active {
        overflow: hidden;
        height: 100%;
    }

    body.lightbox-active {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        left: 0;
        right: 0;
    }
}

/* ===== 響應式設計 ===== */
@media (max-width: 1400px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 1024px) {
    .intro-two-column {
        flex-direction: column;
        gap: 40px;
    }
    
    .service-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .portfolio-section .section-title {
        padding: 0 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }
    
    .nav-section {
        padding: 20px 25px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .brand-name {
        font-size: 24px;
    }
    
    .brand-tagline {
        font-size: 10px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .nav-contact {
        margin-top: 5px;
    }
    
    .nav-phone {
        font-size: 16px;
    }
    
    .hero-section {
        height: 70vh;
        min-height: 500px;
    }
    
    .intro-container {
        padding: 50px 30px;
        border-radius: 8px;
    }
    
    .intro-paragraph {
        font-size: 16px;
        line-height: 1.9;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .service-tag {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 20px;
    }
    
    .portfolio-item {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* 手機版聯絡我們改為單欄 */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-item {
        padding: 40px 25px;
        gap: 12px;
    }
    
    .contact-value.xlarge {
        font-size: clamp(24px, 6vw, 34px);
        white-space: normal;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .pagination-btn {
        width: 100%;
        padding: 12px 25px;
    }
    
    .back-to-top {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 30px;
        right: 30px;
    }
    
    /* 手機版隱藏燈箱功能 */
    .lightbox {
        display: none !important;
    }
    
    .portfolio-item::after {
        display: none !important;
    }
    
    .portfolio-item {
        cursor: default;
    }
    
    .portfolio-item:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .portfolio-item:hover img {
        transform: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }
    
    .nav-section {
        padding: 15px 20px;
    }
    
    .brand-name {
        font-size: 20px;
    }
    
    .hero-section {
        margin-bottom: 60px;
    }
    
    .intro-container {
        padding: 40px 20px;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        padding: 0 15px;
    }
    
    .portfolio-section .section-title {
        padding: 0 20px;
    }
    
    .contact-item {
        padding: 35px 20px;
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .portfolio-grid {
        gap: 12px;
        padding: 0 10px;
    }
}
