/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header Navigation */
.header {
    background: linear-gradient(90deg, #9BAFD9 0%, #B8C5E0 25%, #ffffff 50%, #B8C5E0 75%, #9BAFD9 100%);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.nav-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.nav-link {
    color: #2C3E50;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.logo {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Service Section */
.service-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    background: linear-gradient(135deg, #1a3a52 0%, #2d5670 100%);
    border-radius: 15px;
    padding: 15px 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(26, 58, 82, 0.3);
}

.section-header h2 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.service-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.service-content.reverse {
    direction: rtl;
}

.service-content.reverse>* {
    direction: ltr;
}

.service-image {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-image:hover img {
    transform: scale(1.05);
}

.service-description {
    padding: 20px;
}

.service-description p {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

.highlight-text {
    color: #2d5670;
    font-weight: 500;
}

/* Service Tags */
.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding: 0 30px;
}

.tag {
    background: linear-gradient(135deg, #9BAFD9 0%, #B8C5E0 100%);
    color: #2C3E50;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(155, 175, 217, 0.3);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 175, 217, 0.5);
}

/* CTA Button */
.cta-button-container {
    text-align: center;
    margin: 60px 0 40px 0;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #1a8b7e 0%, #22a89a 100%);
    color: white;
    padding: 15px 50px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(26, 139, 126, 0.4);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(26, 139, 126, 0.6);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a3a52 0%, #2d5670 100%);
    color: white;
    padding: 50px 20px 30px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo img {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    background: white;
    border-radius: 50%;
    padding: 5px;
}

.footer-logo h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.footer-logo p {
    font-size: 16px;
    color: #B8C5E0;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-column h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #B8C5E0;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: #9BAFD9;
}

.footer-social {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1200px;
    margin: 0 auto;
}

.social-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    line-height: 40px;
    text-align: center;
    margin: 0 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* ====================================
   響應式設計 - 平板 (1024px 以下)
   ==================================== */
@media (max-width: 1024px) {
    .nav-items {
        gap: 20px;
    }

    .nav-link {
        padding: 8px 15px;
        font-size: 14px;
    }

    .service-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-content.reverse {
        direction: ltr;
    }

    .service-image {
        min-height: 300px;
    }
}

/* ====================================
   響應式設計 - 手機橫向 (768px 以下)
   ==================================== */
@media (max-width: 768px) {

    /* 導航列 - 緊湊型雙行布局 */
    .header {
        padding: 12px 0;
    }

    .nav-container {
        padding: 0 15px;
    }

    .nav-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        justify-items: center;
    }

    .logo {
        width: 50px;
        height: 50px;
        grid-column: 1 / -1;
        /* Logo 佔滿整行 */
        justify-self: center;
        margin-bottom: 8px;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .nav-link {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }

    /* 主要內容優化 */
    .main-content {
        padding: 20px 10px;
    }

    .service-section {
        margin-bottom: 40px;
    }

    /* 區塊標題優化 */
    .section-header {
        padding: 12px 20px;
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .section-header h2 {
        font-size: 20px;
        text-align: center;
    }

    /* 服務內容優化 */
    .service-content {
        padding: 20px 15px;
        gap: 15px;
    }

    .service-image {
        min-height: 250px;
    }

    .service-description {
        padding: 10px 5px;
    }

    .service-description p {
        font-size: 14px;
        line-height: 1.7;
        text-align: left;
    }

    /* 標籤優化 */
    .service-tags {
        padding: 0 15px;
        gap: 8px;
        justify-content: center;
    }

    .tag {
        font-size: 13px;
        padding: 8px 16px;
    }

    /* CTA 按鈕優化 */
    .cta-button-container {
        margin: 40px 0 30px 0;
    }

    .cta-button {
        padding: 14px 40px;
        font-size: 16px;
    }

    /* 頁尾優化 */
    .footer {
        padding: 30px 15px 20px 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-logo {
        align-items: center;
        text-align: center;
    }

    .footer-logo h3 {
        font-size: 20px;
    }

    .footer-logo p {
        font-size: 14px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-column {
        text-align: center;
    }

    .footer-column h4 {
        font-size: 16px;
    }

    .footer-column ul li a {
        font-size: 14px;
    }
}

/* ====================================
   響應式設計 - 小手機 (480px 以下)
   ==================================== */
@media (max-width: 480px) {

    /* 導航列 - 超緊湊單行滾動 */
    .header {
        padding: 10px 0;
    }

    .nav-container {
        padding: 0 10px;
    }

    .nav-items {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
        padding-bottom: 5px;
        justify-content: flex-start;
    }

    /* 隱藏滾動條 */
    .nav-items::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari */
    }

    .logo {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
        margin: 0;
    }

    .logo img {
        width: 38px;
        height: 38px;
    }

    .nav-link {
        padding: 8px 16px;
        font-size: 13px;
        flex-shrink: 0;
        width: auto;
    }

    /* 主要內容 */
    .main-content {
        padding: 15px 8px;
    }

    .service-section {
        margin-bottom: 30px;
    }

    /* 區塊標題 */
    .section-header {
        padding: 10px 15px;
        margin-bottom: 12px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    /* 服務內容 */
    .service-content {
        padding: 15px 12px;
        gap: 12px;
    }

    .service-image {
        min-height: 200px;
        border-radius: 8px;
    }

    .service-description {
        padding: 5px 0;
    }

    .service-description p {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 12px;
    }

    /* 標籤 */
    .service-tags {
        padding: 0 10px;
        gap: 6px;
    }

    .tag {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* CTA 按鈕 */
    .cta-button-container {
        margin: 30px 0 20px 0;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 15px;
        width: 90%;
        max-width: 300px;
    }

    /* 頁尾 */
    .footer {
        padding: 25px 10px 15px 10px;
    }

    .footer-content {
        gap: 20px;
        margin-bottom: 20px;
    }

    .footer-logo img {
        width: 50px;
        height: 50px;
    }

    .footer-logo h3 {
        font-size: 18px;
    }

    .footer-logo p {
        font-size: 13px;
    }

    .footer-links {
        gap: 20px;
    }

    .footer-column h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .footer-column ul li {
        margin-bottom: 8px;
    }

    .footer-column ul li a {
        font-size: 13px;
    }

    .footer-social {
        padding-top: 20px;
    }

    .social-icon {
        width: 36px;
        height: 36px;
        line-height: 36px;
        margin: 0 6px;
        font-size: 14px;
    }
}

/* ====================================
   超小手機優化 (360px 以下)
   ==================================== */
@media (max-width: 360px) {
    .nav-link {
        padding: 6px 12px;
        font-size: 12px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .service-description p {
        font-size: 12px;
    }

    .tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .cta-button {
        padding: 10px 25px;
        font-size: 14px;
        width: 95%;
    }
}

/* ====================================
   觸控裝置優化
   ==================================== */
@media (hover: none) and (pointer: coarse) {

    /* 移除 hover 效果 */
    .nav-link:hover {
        transform: none;
    }

    .service-image:hover img {
        transform: none;
    }

    .tag:hover {
        transform: none;
    }

    .cta-button:hover {
        transform: none;
    }

    /* 增加點擊區域 */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}