/* 全局樣式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

h1, h2, h3, h4 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--dark-color);
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 按鈕樣式 */
.cta-button, .submit-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.cta-button:hover, .submit-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 導航欄 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* 英雄區 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/background.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

.hero-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease;
}

/* 關於我們 */
.about-section {
    padding: 5rem 0;
    background-color: var(--light-color);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-text ul {
    margin-top: 1.5rem;
}

.about-text li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.about-text i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* 服務 */
.services-section {
    padding: 5rem 0;
    background-color: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 客戶評價 */
.testimonials-section {
    padding: 5rem 0;
    background-color: var(--light-color);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px);
}

.testimonial-content {
    padding: 2rem;
    position: relative;
}

.testimonial-content p {
    font-style: italic;
    position: relative;
    padding-left: 20px;
}

.testimonial-content p::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.3;
}

.testimonial-author {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: #f9f9f9;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.testimonial-author h4 {
    margin-bottom: 0.3rem;
}

.testimonial-author p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* 聯繫我們 */
.contact-section {
    padding: 5rem 0;
    background-color: white;
}

.contact-content {
    display: flex;
    gap: 3rem;
}

.contact-info, .contact-form {
    flex: 1;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-info i {
    margin-right: 10px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.social-media {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.social-media a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-media a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.contact-form {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 頁腳 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

/* 動畫 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        top: 80px;
        background-color: white;
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.5s ease;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .burger {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-content, .contact-content {
        flex-direction: column;
    }

    .about-image {
        order: -1;
        margin-bottom: 2rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* 導航欄滾動效果 */
.nav-scroll {
    padding: 0.5rem 5%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 漢堡菜單動畫 */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.toggle .line2 {
    opacity: 0;
}
.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}


/* 圖片放大基本樣式 */
.zoomable-image {
    cursor: zoom-in;
    transition: transform 0.3s;
}

.zoomable-image:hover {
    transform: scale(2.5);
}

/* 模態框樣式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ccc;
}

#caption {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
}

/* 通用移動端樣式 */
@media (max-width: 768px) {
    /* 導航欄調整 */
    nav {
        padding: 0.5rem 3%;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo img {
        height: 30px;
    }
    
    /* 漢堡菜單樣式 */
    .burger {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        transform: translateY(-150%);
        transition: transform 0.4s ease;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links li {
        margin: 1rem 0;
    }
    
    /* 英雄區調整 */
    .hero {
        height: 80vh;
        padding-top: 70px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* 關於我們區調整 */
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        order: -1;
        margin-bottom: 1.5rem;
    }
    
    /* 服務區調整 */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* 客戶評價區調整 */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    /* 聯繫表單區調整 */
    .contact-content {
        flex-direction: column;
    }
    
    .contact-form {
        margin-top: 2rem;
    }
    
    /* 按鈕調整 */
    .cta-button, .submit-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* 字體大小調整 */
    h2 {
        font-size: 1.8rem;
    }
    
    /* 圖片放大調整 */
    .modal-content {
        width: 95%;
    }
    
    .close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }
}

/* 小屏幕手機專用樣式 */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .service-card, .testimonial-card {
        padding: 1.2rem;
    }
    
    .testimonial-author img {
        width: 50px;
        height: 50px;
    }
}

/* 觸控反饋效果 */
.cta-button:active, .submit-button:active,
.nav-links a:active {
    transform: scale(0.96);
    transition: transform 0.1s;
}

/* 圖片觸控效果 */
.zoomable-image.touched {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 表單輸入優化 */
input, textarea, select {
    font-size: 16px; /* 防止iOS縮放 */
    min-height: 44px; /* 觸控友好尺寸 */
}

/* 防止移動端點擊延遲 */
a, button, input, textarea, select {
    touch-action: manipulation;
}