:root {
    --primary-color: #36454F;
    --secondary-color: #008B8B;
    --accent-color: #008B8B;
    --text-color: #36454F;
    --text-light: #4a5f6f;
    --bg-body: #FFF8F5;
    --bg-light: #FFF5F0;
    --border-color: #e8ddd5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'Noto Sans SC', 'Microsoft YaHei', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Navigation */
.navbar {
    background: var(--bg-body);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.navbar.scrolled {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-height: 60px;
    line-height: 1;
    margin-right: auto;
}

.navbar-logo {
    height: auto;
    width: auto;
    object-fit: contain;
    object-position: left center;
    transition: all 0.3s ease;
    display: block;
    flex-shrink: 0;
    /* 默认尺寸，会被后台设置的内联样式覆盖 */
    max-height: 50px;
    max-width: 100px;
}

.navbar.scrolled .navbar-logo {
    /* 滚动时按比例缩小，但尊重内联样式设置的最大值 */
    transform: scale(0.9);
    transform-origin: left center;
}

.navbar-brand-text {
    display: inline-block;
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 991px) {
    /* 收起後的導航：垂直排列、左對齊、避免下劃線重疊 */
    .navbar-collapse {
        padding-top: 0.5rem;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        gap: 0;
        padding-left: 0;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        justify-content: flex-start;
        width: 100%;
        padding: 0.75rem 0 !important;
        min-height: auto;
        margin-bottom: 0.25rem;
        white-space: normal;
    }

    /* 下劃線不超出文字、不與下一項重疊 */
    .navbar-nav .nav-link::after {
        left: 0;
        transform: none;
        width: 0;
    }

    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after {
        width: 2em;
    }
}

@media (max-width: 768px) {
    /* 在小屏幕上，内联样式（后台设置的尺寸）优先级更高 */
    .navbar-logo:not([style*="max-width"]) {
        max-height: 40px;
        max-width: 100px;
    }

    .navbar.scrolled .navbar-logo {
        transform: scale(0.9);
    }

    .navbar .container {
        flex-wrap: nowrap;
    }

    .navbar-nav {
        order: 4;
        width: 100%;
        margin-left: 0;
    }

    .language-switcher {
        order: 3;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    /* 在超小屏幕上，内联样式优先级更高 */
    .navbar-logo:not([style*="max-width"]) {
        max-height: 35px;
        max-width: 80px;
    }
    
    .navbar.scrolled .navbar-logo {
        transform: scale(0.85);
    }
}

.navbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    min-height: 2.5rem;
    line-height: 1.3;
}

/* 英文選單較長時：略縮字體與間距，避免換行 */
@media (min-width: 992px) {
    .lang-en .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.65rem !important;
    }
    .lang-en .navbar-nav .nav-link.dropdown-toggle {
        padding-right: 1.5rem !important;
    }
}

.nav-link i,
.nav-link .bi {
    font-size: 1em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 70%;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item i,
.dropdown-item .bi {
    font-size: 1em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    width: 1.25em;
    text-align: center;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--secondary-color);
    padding-left: 2rem;
}

.language-switcher {
    margin-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    order: 3;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.lang-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.lang-btn:hover {
    background: var(--bg-light);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    order: 2;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2336454F' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    vertical-align: middle;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: white;
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
}

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

/* 內頁 / blog 頂部區塊 - 與 index hero-section 一致 */
.page-header {
    padding: 100px 0 80px;
}

@media (max-width: 768px) {
    .page-header {
        padding: 80px 0 60px;
    }
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Content Section */
.content-section {
    background: var(--bg-body);
}

.page-card {
    background: #FFFBF9;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.page-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.page-card-content {
    color: var(--text-light);
    line-height: 1.8;
}

.btn-primary-custom {
    background: var(--secondary-color);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-custom:hover {
    background: #007777;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 139, 139, 0.4);
    color: white;
}

/* 首頁服務項目分頁 */
.pages-pagination {
    gap: 0.75rem;
}
.pages-pagination .pages-page-info {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Blog Section */
.blog-section {
    background: var(--bg-light);
}

.blog-card {
    background: #FFFBF9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.blog-card-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex: 1;
}

.blog-card-date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Contact Section */
.contact-section {
    background: var(--bg-body);
}

.contact-form {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 139, 139, 0.25);
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-link:hover {
    color: white;
}

/* Footer Contact Info */
#footerContactInfo {
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
}

#footerContactInfo p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

#footerContactInfo i,
#footerContactInfo .bi {
    margin-top: 0.25rem;
    color: var(--secondary-color);
    flex-shrink: 0;
    width: 1.25em;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    line-height: 1;
}

#footerContactInfo a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footerContactInfo a:hover {
    color: var(--secondary-color);
}

/* Footer Enquiry Form */
.footer-enquiry-form {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
}

.footer-enquiry-form .form-control-sm {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 0.875rem;
}

.footer-enquiry-form .form-control-sm::placeholder {
    color: rgba(255,255,255,0.6);
}

.footer-enquiry-form .form-control-sm:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(0, 139, 139, 0.25);
}

.footer-enquiry-form .btn-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.footer-enquiry-form .alert {
    font-size: 0.875rem;
    padding: 0.5rem;
    margin-bottom: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255,255,255,0.7);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .navbar-nav {
        margin-top: 1rem;
    }

    .language-switcher {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* Page Content */
.page-content {
    padding: 3rem 0;
    min-height: 500px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.page-body {
    line-height: 1.8;
    color: var(--text-color);
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.page-body figure.editor-img-block {
    margin: 1.5rem auto;
    max-width: 100%;
    text-align: center;
}

.page-body figure.editor-img-block img.editor-img {
    margin: 0 auto;
    display: block;
}

.page-body p {
    margin-bottom: 1.5rem;
}

.page-body h1,
.page-body h2,
.page-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

