/* Modern Layout Styles - Business Professional */
/* ... (Existing styles unchanged up to Header) ... */

/* =====================================================
   全站版面佈局規範 (Container Layout)
   - 最大寬度限制：max-width: 1280px
   - 居中對齊：margin: 0 auto
   ===================================================== */

/* 主要內容容器 - 強制覆蓋 Bootstrap 預設值 */
.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
}

/* 手機版：保留兩側約 20px 內縮間距 */
@media (max-width: 576px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ===================================================== */

:root {
    /* Merged Variables */
    --header-bg: #ffffff;
    --header-text: #222222;
    --header-hover: #b48e43;
    --footer-bg: #1a1a1a;
    --footer-text: #cccccc;
    --footer-link-hover: #ffffff;
    --border-color: #e0e0e0;

    /* Standardized Tokens */
    --primary-color: #b48e43;
    /* Preserved Brand Color */
    --secondary-color: #2c3e50;
    /* Dark Navy for Headings */
    --accent-color: #e74c3c;
    /* Red for alerts */
    --text-main: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --font-main: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* =====================================================
   全站容器佈局規範 (Container Layout)
   - max-width: 1280px (在 1440px 螢幕下，左右各 80px 邊距)
   - 居中對齊: margin: 0 auto
   - 左右留白: 1440px 以上為 80px，其他螢幕為 20px
   ===================================================== */
.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Typography Standardization */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

/* Modern Components */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #967536;
    /* Darkened #b48e43 */
    color: #fff;
    transform: translateY(-1px);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 16px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(180, 142, 67, 0.1);
    /* Primary color fade */
    outline: none;
}

/* Article Content Styling */
.article-body,
.news-content {
    color: var(--text-main);
}

.article-body p,
.news-content p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    /* Slight bump for readability */
}

.article-body blockquote,
.news-content blockquote {
    border-left: 5px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-light);
    padding: 15px 20px;
}

.article-body ul,
.news-content ul,
.article-body ol,
.news-content ol {
    margin-bottom: 20px;
    padding-left: 40px;
}

.article-body li,
.news-content li {
    margin-bottom: 8px;
}


a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Header Redesign */
header.modern-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    height: 70px;
}

header.modern-header+* {
    margin-top: 0 !important;
    padding-top: 40px;
}

/* Fix Legacy Conflict: rwd.css sets padding-top: 90px on .kv */
.kv {
    padding-top: 20px !important;
    margin-top: 0 !important;
}

/* News Title Link Style */
.plus-link {
    text-decoration: none;
    color: inherit;
    margin-left: 5px;
    transition: color 0.2s;
}

.plus-link:hover {
    color: #fff;
    /* or highlight color depending on background, title is usually dark */
}

/* Ensure title spans handle the link correctly */
.news_list h2.title span a.plus-link:hover {
    color: #b48e43;
}


.pk_box,
.news_list,
.kv {
    margin-top: 0 !important;
}

/* Header 容器 - 與 .container 配合使用 */
/* 佈局屬性由此定義，寬度/對齊由 .container 控制 */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* 當 header-container 未與 .container 一起使用時的 fallback */
.header-container:not(.container) {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    gap: 30px;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    padding: 0 5px;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link:hover,
.nav-link:active,
.nav-link:focus,
.nav-link.active {
    color: var(--header-hover);
}

/* 強制複寫點擊狀態，避免變成預設藍色 */
.header-nav a:active,
.header-nav a:link:active,
.header-nav a:visited:active,
.nav-link:active,
.nav-link:link:active,
.nav-link:visited:active {
    color: var(--header-hover) !important;
    -webkit-tap-highlight-color: transparent;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 10px 0;
    border-top: 3px solid var(--primary-color);
    z-index: 1001;
    border-radius: 0 0 4px 4px;
}

.nav-item:hover .nav-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.dropdown-link:hover,
.dropdown-link:active {
    background: #fdfdfd;
    color: var(--header-hover);
    padding-left: 25px;
}

/* 強制複寫下拉選單點擊狀態 */
.dropdown-link:active,
.dropdown-link:link:active,
.dropdown-link:visited:active {
    color: var(--header-hover) !important;
    -webkit-tap-highlight-color: transparent;
}

/* Header Actions (Search + Mobile Menu) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle {
    color: #555;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 5px;
}

.search-toggle:hover {
    color: var(--header-hover);
}

/* 漢堡選單按鈕 (Prototype 風格) */
.header-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1a1a1a;
    cursor: pointer;
    padding: 5px 10px;
    min-height: 44px;
    min-width: 44px;
    transition: color 0.3s;
}

.header-menu-toggle:hover {
    color: #b48e43;
}

/* 手機版選單 (Prototype 風格) */
.header-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-top: 2px solid #e0e0e0;
    z-index: 999;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
}

.header-mobile-menu.active {
    display: block;
}

.header-mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.header-mobile-nav > a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s, color 0.3s;
}

.header-mobile-nav > a:hover {
    background: #f8f9fa;
    color: #b48e43;
}

/* Submenu Toggle Container */
.header-mobile-nav .nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

/* 文字連結區域 */
.header-mobile-nav .nav-toggle-text {
    flex: 1;
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

.header-mobile-nav .nav-toggle-text:hover {
    background: #f8f9fa;
    color: #b48e43;
}

/* 展開/收合按鈕 */
.header-mobile-nav .nav-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s;
}

.header-mobile-nav .nav-toggle-btn:hover {
    background: #f0f0f0;
}

.header-mobile-nav .nav-toggle .chevron {
    transition: transform 0.3s;
    font-size: 12px;
    color: #999;
}

/* Rotate chevron when active */
.header-mobile-nav .nav-toggle.active .chevron {
    transform: rotate(180deg);
}

.header-mobile-nav .nav-toggle.active .nav-toggle-text {
    color: #b48e43;
}

.mobile-nav-group {
    border-bottom: none;
}

.header-mobile-subnav {
    background: #fafafa;
    display: none;
    overflow: hidden;
}

.header-mobile-subnav.show {
    display: block;
}

.header-mobile-subnav a {
    display: block;
    padding: 12px 20px 12px 40px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s, color 0.3s;
}

.header-mobile-subnav a:hover {
    background: #f8f9fa;
    color: #b48e43;
}

/* 手機版選單搜尋區塊 (Prototype 風格) */
.header-mobile-search {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: block;
}

.header-mobile-search form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-mobile-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.header-mobile-search-input:focus {
    border-color: #b48e43;
}

.header-mobile-search-btn {
    width: 100%;
    padding: 10px;
    background: #b48e43;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header-mobile-search-btn:hover {
    background: #9a7538;
}

/* 舊的選單樣式 (保留兼容性) */
.mobile-menu-btn {
    display: none;
}

.mobile-menu-content {
    padding: 20px;
    overflow-y: auto;
}

/* 手機版選單搜尋區塊 */
.mobile-search-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.mobile-search-form {
    display: flex;
    gap: 0;
}

.mobile-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.mobile-search-input:focus {
    border-color: var(--primary-color);
}

.mobile-search-input::placeholder {
    color: #999;
}

.mobile-search-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
}

.mobile-search-btn:hover {
    background: #967536;
}

.mobile-search-btn i {
    font-size: 16px;
}

.mobile-nav-group {
    border-bottom: 1px solid #f5f5f5;
}

.mobile-link {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
}

.mobile-nav-group .mobile-link {
    border-bottom: none;
}

.mobile-link:hover,
.mobile-link:active {
    color: var(--header-hover);
}

/* 強制複寫手機選單點擊狀態 */
.mobile-link:active,
.mobile-link:link:active,
.mobile-link:visited:active {
    color: var(--header-hover) !important;
    -webkit-tap-highlight-color: transparent;
}

/* 手風琴切換按鈕 */
.nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.chevron-icon {
    font-size: 14px;
    color: #999;
    transition: transform 0.3s ease;
}

.nav-toggle.active .chevron-icon {
    transform: rotate(180deg);
}

.nav-toggle.active {
    color: var(--primary-color);
}

/* 子選單 */
.mobile-submenu {
    display: none;
    background: #f8f9fa;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.mobile-submenu.show {
    display: block;
    max-height: 500px;
}

.mobile-submenu-link {
    display: block;
    padding: 10px 0 10px 20px;
    font-size: 15px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.mobile-submenu-link:last-child {
    border-bottom: none;
}

.mobile-submenu-link:hover,
.mobile-submenu-link:active {
    color: var(--primary-color);
    background: #f0f0f0;
    padding-left: 25px;
}

.mobile-link.sm {
    font-size: 15px;
    font-weight: normal;
    color: #666;
}

.mobile-link.sm:hover,
.mobile-link.sm:active {
    color: var(--header-hover);
}

/* Footer & Pagination Styles (Same as before) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 20px 0;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination li {
    display: inline-block;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.pagination li.active span,
.pagination li a:hover {
    background-color: var(--primary-color, #b48e43);
    color: #fff;
    border-color: var(--primary-color, #b48e43);
}

.pagination li.disabled span {
    color: #999;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* 桌面版和手機版分頁切換 */
.pagination-desktop {
    display: flex;
    gap: 5px;
}

.pagination-mobile {
    display: none;
    gap: 5px;
}

/* 桌面版隱藏最前頁/最後頁按鈕 */
.pagination-first,
.pagination-last {
    display: none;
}

/* 手機版分頁優化 */
@media (max-width: 768px) {
    .pagination {
        gap: 3px;
        padding: 15px 0;
        flex-wrap: nowrap;
    }

    .pagination li a,
    .pagination li span {
        min-width: 32px;
        min-height: 32px;
        padding: 4px 8px;
        font-size: 13px;
        border-radius: 4px;
    }

    /* 手機版顯示最前頁/最後頁按鈕 */
    .pagination-first,
    .pagination-last {
        display: inline-block;
    }

    /* 手機版隱藏桌面版分頁，顯示簡化版 */
    .pagination-desktop {
        display: none;
    }

    .pagination-mobile {
        display: flex;
    }

    /* 省略符號樣式 */
    .pagination li.dots span {
        border: none;
        background: transparent;
        padding: 4px 2px;
        min-width: 16px;
        min-height: 32px;
    }

    /* 箭頭圖示尺寸 */
    .pagination li i {
        font-size: 11px;
    }

    /* 導航按鈕（上一頁/下一頁/最前頁/最後頁）稍大一點 */
    .pagination-first a,
    .pagination-last a,
    .pagination li:first-child a,
    .pagination li:last-child a {
        min-width: 36px;
        padding: 4px 6px;
    }
}

footer.modern-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 50px 0 20px;
    font-size: 14px;
    margin-top: 50px;
}

/* Footer 容器 - 遵守全站 1280px 規範 */
.footer-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
    box-sizing: border-box;
}

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

.footer-col h4 {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.footer-logo-url {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}

.footer-desc {
    color: #ccc;
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 20px;
}

.footer-contact-section {
    margin-top: 20px;
}

.footer-contact-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
}

.footer-contact {
    color: #ccc;
    font-size: 14px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-contact-item:last-child {
    margin-bottom: 0;
}

.footer-contact-item i {
    color: #999;
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
}

.footer-contact-item a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contact-item a:hover {
    color: var(--primary-color);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.modern-footer .social-icons-large {
    display: flex;
    gap: 15px;
}

footer.modern-footer .social-icons-large a.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background-color: #2c2c2c !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 20px;
    text-decoration: none !important;
    transition: all 0.3s;
    border: none !important;
}

footer.modern-footer .social-icons-large a.social-btn i,
footer.modern-footer .social-icons-large a.social-btn i.fa-brands,
footer.modern-footer .social-icons-large a.social-btn i.fa-solid {
    color: #fff !important;
}

footer.modern-footer .social-icons-large a.social-btn:hover {
    background-color: var(--primary-color) !important;
    transform: translateY(-3px);
    color: #fff !important;
}

/* RSS Feed Section */
.rss-feed-section {
    margin-top: 25px;
}

.rss-feed-title {
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
    margin-bottom: 12px;
}

.rss-feed-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rss-feed-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.rss-feed-link:hover {
    color: var(--primary-color);
}

.rss-feed-link i.fa-rss {
    color: #ff6600;
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #999;
    font-size: 13px;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header.modern-header {
        height: auto;
        padding: 12px 0;
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-container {
        /* No wrap needed if logo and actions fit */
        justify-content: space-between;
    }

    .header-logo img {
        max-height: 30px;
    }

    .header-nav {
        display: none;
        /* Hidden, use hamburger */
    }

    .header-menu-toggle {
        display: block;
    }

    .header-mobile-menu {
        width: 100%;
        right: 0;
    }

    .header-mobile-menu.active {
        display: block;
    }

    .footer-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    /* 手機版：將「網站導覽」和「關於我們」合併為兩欄並排 */
    .footer-grid > .footer-col:nth-child(1) {
        width: 100%;
        order: 1;
        margin-bottom: 30px;
    }

    .footer-grid > .footer-col:nth-child(2) {
        width: calc(50% - 15px);
        order: 2;
        margin-right: 30px;
    }

    .footer-grid > .footer-col:nth-child(3) {
        width: calc(50% - 15px);
        order: 3;
    }

    .footer-grid > .footer-col:nth-child(4) {
        width: 100%;
        order: 4;
        margin-top: 30px;
    }

    .footer-container {
        padding: 0 20px;
    }
}

/* Header Search Box - 直接顯示在 Header 最右側 */
.header-search-inline {
    display: flex;
    align-items: center;
}

.header-search-form {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-search-input {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    width: 200px;
    outline: none;
    transition: border-color 0.3s;
}

.header-search-input:focus {
    border-color: var(--primary-color);
}

.header-search-input::placeholder {
    color: #999;
}

.header-search-btn {
    padding: 9px 15px;
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.header-search-btn:hover {
    background: #967536;
    border-color: #967536;
}

/* 手機版隱藏搜尋框 */
@media (max-width: 768px) {
    .header-search-inline {
        display: none;
    }
}


/* =====================================================
   新聞卡片樣式定義
   ===================================================== */

/* CSS 變數定義 */
:root {
    --color-estate: #b48e43;
    --color-market: #2c3e50;
    --color-power: #d35400;
}

/* =====================================================
   1. 矩形卡片 (.news-card-rectangle)
   用途：首頁「最新新聞」區塊、編輯政策頁面相關文章
   ===================================================== */
.news-card-rectangle {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.news-card-rectangle:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.news-card-rectangle-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.news-card-rectangle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card-rectangle:hover .news-card-rectangle-image {
    transform: scale(1.05);
}

/* 最新新聞卡片標籤容器 */
.news-card-rectangle-tags {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.news-card-rectangle-tag {
    background: rgba(180, 142, 67, 0.85);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.news-card-rectangle-tag.market {
    background: rgba(44, 62, 80, 0.85);
}

.news-card-rectangle-tag.power {
    background: rgba(211, 84, 0, 0.85);
}

/* 矩形卡片廣編標籤 */
.news-card-rectangle-tag.sponsored {
    background: rgba(240, 240, 240, 0.95);
    color: #666;
    font-weight: 500;
    border: 1px solid rgba(200, 200, 200, 0.5);
}

.news-card-rectangle-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-rectangle-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-rectangle-title a {
    color: #222;
    text-decoration: none;
}

.news-card-rectangle-title a:hover {
    color: var(--primary-color);
}

.news-card-rectangle-summary {
    color: #666;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-rectangle-meta {
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: auto;
}

.news-card-rectangle-date,
.news-card-rectangle-author {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* =====================================================
   2. 列表橫幅卡片 (.news-card-list)
   用途：新聞分類列表頁面、作者頁面列表
   ===================================================== */
.news-card-list {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.news-card-list:last-child {
    border-bottom: none;
}

.news-card-list:hover {
    background: #f8f9fa;
    margin: 0 -20px;
    padding: 25px 20px;
    color: inherit;
}

.news-card-list-image {
    width: 200px;
    aspect-ratio: 4 / 3; /* 4:3 比例 (200px × 3/4 = 150px) */
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
}

.news-card-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card-list:hover .news-card-list-image img {
    transform: scale(1.05);
}

.news-card-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card-list-category-wrapper {
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.news-card-list-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: rgba(180, 142, 67, 0.85);
}

.news-card-list-category.market {
    background: rgba(44, 62, 80, 0.85);
}

.news-card-list-category.power {
    background: rgba(211, 84, 0, 0.85);
}

/* 列表卡片廣編標籤 */
.news-card-list-category.sponsored {
    background: rgba(240, 240, 240, 0.95);
    color: #666;
    font-weight: 500;
    border: 1px solid rgba(200, 200, 200, 0.5);
}

.news-card-list-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-list-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-list-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 13px;
    margin-top: auto;
}

.news-card-list-meta i {
    margin-right: 5px;
}

/* =====================================================
   Sidebar Card Container
   ===================================================== */
.sidebar-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    padding: 25px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.sidebar-title.estate {
    border-bottom-color: #b48e43;
}

.sidebar-title.market {
    border-bottom-color: #2c3e50;
}

.sidebar-title.power {
    border-bottom-color: #d35400;
}

.sidebar-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =====================================================
   3. 側欄簡易卡片 (.news-card-sidebar)
   用途：熱門文章、相關新聞側欄
   ===================================================== */
.news-card-sidebar {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.news-card-sidebar:last-child {
    border-bottom: none;
}

.news-card-sidebar a {
    text-decoration: none;
    color: #333;
    display: flex;
    gap: 15px;
    align-items: stretch;
    height: 85px;
}

.news-card-sidebar:hover {
    background: #f8f9fa;
    margin: 0 -25px;
    padding: 15px 25px;
    border-radius: 8px;
}

.news-card-sidebar:hover .news-card-sidebar-title {
    color: var(--primary-color);
}

.news-card-sidebar-thumbnail {
    width: 100px;
    aspect-ratio: 4 / 3;
    height: 75px; /* 明確設置高度：100px × 3/4 = 75px */
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.news-card-sidebar-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-card-sidebar-category {
    display: inline-block;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
    background: rgba(180, 142, 67, 0.85);
}

.news-card-sidebar-category.market {
    background: rgba(44, 62, 80, 0.85);
}

.news-card-sidebar-category.power {
    background: rgba(211, 84, 0, 0.85);
}

.news-card-sidebar-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 8px;
    margin-top: 0;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 固定兩行高度：14px * 1.5 * 2 = 42px */
    min-height: 42px;
    height: 42px;
}

.news-card-sidebar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

.news-card-sidebar-date {
    white-space: nowrap;
}


/* =====================================================
   區塊標題樣式
   ===================================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.section-title.estate {
    border-left: 5px solid var(--color-estate);
    padding-left: 15px;
}

.section-title.market {
    border-left: 5px solid var(--color-market);
    padding-left: 15px;
}

.section-title.power {
    border-left: 5px solid var(--color-power);
    padding-left: 15px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.view-all-link:hover {
    color: var(--primary-color);
}

.view-all-link .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.view-all-link:hover .arrow {
    transform: translateX(3px);
}

/* =====================================================
   麵包屑導覽
   ===================================================== */
.breadcrumb-nav {
    padding: 15px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb-nav .current {
    color: #333;
    font-weight: 500;
}

/* =====================================================
   頁面標題區域
   ===================================================== */
.page-header {
    padding: 30px 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px;
    font-weight: bold;
    color: #222;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 16px;
    color: #999;
    font-style: italic;
}

.page-description {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-top: 15px;
}

/* =====================================================
   AI理家導流卡片 (文章末端)
   ===================================================== */
.ai-assistant-cta {
    background: linear-gradient(135deg, #00415A 0%, #003044 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    display: flex;
    align-items: center;
    gap: 25px;
}

.ai-assistant-cta-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.ai-assistant-cta-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.ai-assistant-cta-content {
    flex: 1;
}

.ai-assistant-cta-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-assistant-cta-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.ai-assistant-cta-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
}

.ai-assistant-cta-btn {
    background: #fff;
    color: #00415A;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.ai-assistant-cta-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .ai-assistant-cta {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .ai-assistant-cta-btn {
        width: 100%;
    }
}

/* =====================================================
   廣告版位
   ===================================================== */
.ad-banner-section {
    background: #f8f9fa;
    padding: 40px 0;
    margin: 40px 0;
}

.ad-banner-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.ad-banner-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.ad-banner-slide {
    min-width: 100%;
    position: relative;
}

.ad-banner-slide img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.ad-banner-slide a {
    display: block;
    text-decoration: none;
}

/* =====================================================
   響應式調整
   ===================================================== */
@media (max-width: 992px) {
    .news-card-list {
        flex-direction: column;
        padding: 20px 0;
        gap: 15px;
    }

    .news-card-list:hover {
        margin: 0;
        padding: 20px 0;
    }

    .news-card-list-image {
        width: 100%;
        height: 200px;
        border-radius: 8px;
    }

    .news-card-list-content {
        padding: 0;
    }
}

@media (max-width: 768px) {
    /* 手機版優化規範 */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    html {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        width: 100%;
        max-width: 100%;
        /* 不在 body 上設置 overflow，以確保 sticky 正常工作 */
    }

    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* 新聞列表頁手機版優化 */
    .news-card-list {
        padding: 20px 0;
        gap: 15px;
    }

    .news-card-list:hover {
        background: transparent;
        margin: 0;
        padding: 20px 0;
    }

    .news-card-list-image {
        width: 120px;
        aspect-ratio: 4 / 3; /* 4:3 比例 (120px × 3/4 = 90px) */
    }

    .news-card-sidebar-thumbnail {
        width: 80px;
        aspect-ratio: 4 / 3;
        height: 60px; /* 明確設置高度：80px × 3/4 = 60px */
    }

    .news-card-list-title {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 8px;
    }

    .news-card-list-summary {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 10px;
    }

    .news-card-list-meta {
        font-size: 12px;
    }

    /* 確保卡片樣式與首頁一致 */
    .news-card-rectangle-image-wrapper {
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
    }

    .section-title {
        font-size: 20px;
    }

    .page-title {
        font-size: 24px;
    }
}

/* ============================================
   Breadcrumb Section
   ============================================ */
.breadcrumb-section {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb-item {
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 8px;
    color: #999;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: #333;
}

/* ============================================
   Category Header Section
   ============================================ */
.category-header-section {
    padding: 40px 0 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.category-title {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    font-size: 36px;
    font-weight: bold;
    color: #222;
    margin: 0;
    padding-left: 20px;
    border-left: 5px solid var(--primary-color);
}

.category-title.estate {
    border-left-color: #b48e43;
}

.category-title.market {
    border-left-color: #2c3e50;
}

.category-title.power {
    border-left-color: #d35400;
}

.category-description {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin: 0;
}

/* 響應式 - Breadcrumb & Category Header */
@media (max-width: 768px) {
    .breadcrumb-section {
        padding: 12px 0;
    }

    .breadcrumb {
        font-size: 13px;
    }

    .category-header-section {
        padding: 25px 0 20px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .category-title {
        font-size: 24px;
        padding-left: 15px;
        border-left-width: 4px;
        margin-bottom: 10px;
    }

    .category-description {
        font-size: 14px;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 20px;
        padding-left: 12px;
    }

    .category-description {
        font-size: 13px;
    }
}