/* 公開網站基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 90vw;
    margin: 0 auto;
    padding: 0 20px;
}

/* 手機模式 */
@media (max-width: 768px) {
    .container {
        max-width: 98vw;
        margin: 0 auto;
        padding: 0 20px;
    }
}


/* 頂部導航欄 */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.logo-img {
    width: 40px;
    height: 40px;
    margin-right: 0px;
    object-fit: cover;
    border-radius: 4px;
}

.logo-text {
    height: 2.5rem;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 主題切換按鈕 */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}

.theme-icon {
    font-size: 1.2rem;
}

/* 手機選單按鈕 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* 桌面版導航選單 */
.desktop-nav {
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    justify-content: center;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 0.6rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--hover-bg);
    border-bottom-color: var(--primary-color);
}

/* Banner */
.site-banner {
    width: 100%;
    max-height: 100px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.banner-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    object-position: center;
}

/* 手機版選單 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--nav-bg);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    flex-direction: column;
}

.mobile-nav.open {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-header h3 {
    margin: 0;
    color: var(--text-color);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
}

.mobile-nav-link {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.mobile-nav-link:hover {
    background-color: var(--hover-bg);
}

/* 手機選單底部 */
.mobile-nav-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.mobile-theme-toggle {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.mobile-theme-toggle:hover {
    background-color: var(--hover-bg);
}

/* 主要內容區域 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 1rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.content-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* 頁腳 */
.footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
    transition: background-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-info h4,
.footer-links h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
    
    .mobile-nav.open {
        left: 0;
    }
    
    .header-content {
        padding: 0.8rem 0;
        justify-content: center;
    }
    
    .logo {
        margin-left: 20px; /* 為左上角按鈕留出空間 */
    }
    
    .theme-toggle:not(.mobile-theme-toggle) {
        display: none; /* 在手機模式下隱藏右上角的主題切換按鈕，但保留手機選單中的按鈕 */
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
}

/* ========================================
   公開頁面通用內容樣式
   ======================================== */

/* 通用圖片樣式 */
.content-image {
    max-width: 500px;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 圖片說明文字 */
.image-caption {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    margin: 10px auto 20px auto;
    font-size: 14px;
    line-height: 1.5;
}

/* 內容區塊樣式 */
.content-section {
    margin-bottom: 40px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.content-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.content-body p {
    margin-bottom: 16px;
}

.content-body p:last-child {
    margin-bottom: 0;
}

.content-body b {
    font-weight: 600;
    color: var(--text-color);
}

/* 強調文字樣式 */
.highlight-text {
    background: var(--highlight-bg, #fff3cd);
    color: var(--highlight-text, #856404);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* 引用文字樣式 */
.quote-text {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--quote-bg, #f8f9fa);
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
}

/* 列表樣式 */
.content-list {
    margin: 16px 0;
    padding-left: 20px;
}

.content-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 內容樣式響應式設計 */
@media (max-width: 768px) {
    .content-image {
        max-width: 100%;
        margin: 15px auto;
        border-radius: 6px;
    }
    
    .image-caption {
        font-size: 13px;
        margin: 8px auto 15px auto;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .content-body {
        font-size: 15px;
    }
    
    .quote-text {
        padding: 12px 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .content-image {
        margin: 10px auto;
        border-radius: 4px;
    }
    
    .image-caption {
        font-size: 12px;
        margin: 6px auto 12px auto;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .content-body {
        font-size: 14px;
    }
    
    .quote-text {
        padding: 10px 12px;
        margin: 12px 0;
    }
}

/* 內容樣式深色模式調整 */
@media (prefers-color-scheme: dark) {
    .content-image {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .content-image:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
    
    .image-caption {
        color: var(--text-secondary);
    }
    
    .highlight-text {
        background: var(--highlight-bg-dark, #664d03);
        color: var(--highlight-text-dark, #fff3cd);
    }
    
    .quote-text {
        background: var(--quote-bg-dark, #2d3748);
        color: var(--text-secondary);
        border-left-color: var(--primary-color);
    }
}

/* 內容樣式列印樣式 */
@media print {
    .content-image {
        max-width: 100%;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .content-image:hover {
        transform: none;
        box-shadow: none;
    }
    
    .image-caption {
        color: #666;
    }
    
    .highlight-text {
        background: #f0f0f0;
        color: #333;
    }
    
    .quote-text {
        background: #f9f9f9;
        color: #666;
        border-left-color: #ccc;
    }
}

/* ========================================
   最新消息詳情頁面樣式
   ======================================== */

/* 麵包屑導航 */
.breadcrumb {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--text-secondary);
}

.breadcrumb-current {
    color: var(--text-color);
    font-weight: 500;
}

/* 消息詳情樣式 */
.news-detail {
    max-width: 800px;
    margin: 0 auto;
}

.news-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.news-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.news-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.news-category {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.news-date {
    font-weight: 500;
}

.news-content {
    margin-bottom: 30px;
}

.news-body {
    font-size: 16px;
    line-height: 1.2;
    color: var(--text-color);
    
    /* 修改這裡：改成 pre-line */
    white-space: pre-line; 
    
    word-wrap: break-word;
    text-indent: 0;
    padding-left: 0;
}

.news-body p {
    margin-bottom: 16px;
    text-indent: 0;
    padding-left: 0;
}

.news-body p:last-child {
    margin-bottom: 0;
}

.news-actions {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.btn-back {
    display: inline-block;
    background: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 附件區塊樣式 */
.news-attachments {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.attachments-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.attachment-link:hover {
    background: var(--hover-bg);
    transform: translateX(5px);
}

.attachment-icon {
    font-size: 18px;
}

.attachment-name {
    font-size: 14px;
    color: var(--text-color);
}

/* 最新消息詳情響應式設計 */
@media (max-width: 768px) {
    .news-title {
        font-size: 24px;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .news-body {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .news-title {
        font-size: 20px;
    }
    
    .news-body {
        font-size: 14px;
    }
    
    .btn-back {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* 最新消息詳情深色模式調整 */
@media (prefers-color-scheme: dark) {
    .news-header {
        border-bottom-color: #444;
    }
    
    .news-actions {
        border-top-color: #444;
    }
}

/* ========================================
   檔案下載詳情頁面樣式
   ======================================== */

/* 檔案詳情樣式 */
.file-detail {
    max-width: 800px;
    margin: 0 auto;
}

.file-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.file-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.file-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.file-date {
    font-weight: 500;
}

.file-actions {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* 檔案附件區塊樣式 */
.file-attachments {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* 檔案下載詳情響應式設計 */
@media (max-width: 768px) {
    .file-title {
        font-size: 24px;
    }
    
    .file-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .file-title {
        font-size: 20px;
    }
}

/* 檔案下載詳情深色模式調整 */
@media (prefers-color-scheme: dark) {
    .file-header {
        border-bottom-color: var(--border-color);
    }
    
    .file-actions {
        border-top-color: var(--border-color);
    }
}

/* 首頁表格手機模式樣式 */
@media (max-width: 768px) {
    .v-data-table td.v-col-title,
    .v-data-table td.v-col-date {
        color: var(--text-color) !important;
    }
}

/* 手機模式下的表格文字（卡片模式） */
@media (max-width: 600px) {
    .hide-header-on-mobile .v-data-table td.v-col-title,
    .hide-header-on-mobile .v-data-table td.v-col-date {
        color: var(--text-color) !important;
    }
}