/* ==============================================
   PAGE BANNER
   ============================================== */
.page-banner {
    background: #427096;
    padding: 48px 5%;
    text-align: center;
    color: white;
}

.page-banner h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.page-banner p {
    font-size: 14px;
    opacity: 0.75;
    letter-spacing: 1px;
}

/* ==============================================
   BREADCRUMB
   ============================================== */
.breadcrumb {
    background: #f5f7fa;
    border-bottom: 1px solid #e5eaf0;
}

.breadcrumb-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 5%;
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.breadcrumb-inner a {
    color: #427096;
    text-decoration: none;
}

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

.breadcrumb-inner span[aria-current] {
    color: #333;
}

/* ==============================================
   NEWS SECTION
   ============================================== */
.news-section {
    padding: 48px 5% 60px;
    background: #fff;
}

.news-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- 篩選標籤 --- */
.news-tabs {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.news-tab {
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #427096;
    background: #f0f4f8;
    border: 1.5px solid #c8d8e8;
    border-radius: 20px;
    cursor: pointer;
    -webkit-transition: background 0.18s, color 0.18s, border-color 0.18s;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    font-family: inherit;
    line-height: 1.5;
    white-space: nowrap;
}

.news-tab:hover {
    background: #dce8f4;
    border-color: #427096;
}

.news-tab.active       { background: #004c99; color: #fff; border-color: #004c99; font-weight: 700; }
.news-tab.ord.active   { background: #427096; border-color: #427096; }
.news-tab.tech.active  { background: #2e7d32; border-color: #2e7d32; }
.news-tab.alumni.active{ background: #b84c00; border-color: #b84c00; }
.news-tab.incub.active { background: #6a1b9a; border-color: #6a1b9a; }

/* --- 新聞列表 --- */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 組別 badge */
.news-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.news-badge.ord    { background: #427096; }
.news-badge.tech   { background: #2e7d32; }
.news-badge.alumni { background: #b84c00; }
.news-badge.incub  { background: #6a1b9a; }
.news-badge.badge-new { background: #e63e3e; }

.news-date {
    font-size: 13px;
    color: #888;
}

/* ==============================================
   有縮圖樣式 (card)
   ============================================== */
.news-item--thumb {
    border-bottom: 1px solid #eee;
    padding: 24px 0;
}

.news-item--thumb:first-child {
    border-top: 1px solid #eee;
}

.news-card {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 24px;
    text-decoration: none;
    color: inherit;
    -webkit-transition: opacity 0.18s;
    transition: opacity 0.18s;
}

.news-card:hover {
    opacity: 0.85;
}

.news-thumb {
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    overflow: hidden;
    border-radius: 6px;
    background: #e5eaf0;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.news-card:hover .news-thumb img {
    -webkit-transform: scale(1.04);
    -ms-transform: scale(1.04);
    transform: scale(1.04);
}

.news-body {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 8px;
}

.news-body .news-meta {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.news-item--thumb .news-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a3a52;
    line-height: 1.5;
    margin: 0;
}

.news-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==============================================
   無縮圖樣式 (plain row)
   ============================================== */
.news-item--plain {
    border-bottom: 1px solid #eee;
}

.news-item--plain:first-child,
.news-item--thumb + .news-item--plain {
    border-top: 1px solid #eee;
}

.news-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    text-decoration: none;
    color: inherit;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    border-radius: 4px;
}

.news-row:hover {
    background: #f5f8fb;
}

.news-row .news-meta {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.news-item--plain .news-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a3a52;
    margin: 0;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    line-height: 1.5;
}

.news-row:hover .news-item--plain .news-title,
.news-row:hover .news-title {
    color: #004c99;
}

/* ==============================================
   分頁
   ============================================== */
.news-pagination {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #c8d8e8;
    background: #fff;
    color: #427096;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    -webkit-transition: background 0.15s, color 0.15s, border-color 0.15s;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: #427096;
    color: #fff;
    border-color: #427096;
}

.page-btn.active {
    background: #004c99;
    color: #fff;
    border-color: #004c99;
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.page-prev, .page-next {
    font-size: 18px;
}

/* ==============================================
   DETAIL PAGE
   ============================================== */
.detail-section {
    padding: 48px 5% 60px;
    background: #fff;
}

.detail-container {
    max-width: 1100px;
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 48px;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
}

/* --- 主文章 --- */
.detail-article {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5eaf0;
}

.detail-meta {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.detail-date {
    font-size: 13px;
    color: #888;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a3a52;
    line-height: 1.5;
    margin: 0;
}

.detail-cover {
    margin-bottom: 28px;
    border-radius: 8px;
    overflow: hidden;
}

.detail-cover img {
    width: 100%;
    height: auto;
    max-height: 400px;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
}

/* 文章內容 */
.detail-content {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
    margin-bottom: 36px;
}

.detail-content h2 {
    font-size: 17px;
    font-weight: 700;
    color: #004c99;
    margin: 28px 0 10px;
    padding-left: 10px;
    border-left: 3px solid #004c99;
}

.detail-content p {
    margin-bottom: 14px;
}

.detail-content ul,
.detail-content ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.detail-content li {
    margin-bottom: 6px;
}

/* 附件 */
.detail-attachments {
    background: #f5f7fa;
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 36px;
}

.detail-attachments h3 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.detail-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-attachments li + li {
    margin-top: 8px;
}

.attachment-link {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    color: #004c99;
    font-size: 14px;
    text-decoration: none;
    -webkit-transition: color 0.15s;
    transition: color 0.15s;
}

.attachment-link:hover {
    color: #427096;
    text-decoration: underline;
}

/* 上下篇 */
.detail-nav {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.detail-nav-btn {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 200px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border: 1.5px solid #e5eaf0;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    -webkit-transition: border-color 0.18s, background 0.18s;
    transition: border-color 0.18s, background 0.18s;
}

.detail-nav-btn:hover {
    border-color: #427096;
    background: #f5f8fb;
}

.detail-nav-btn.next {
    text-align: right;
}

.detail-nav-label {
    font-size: 11px;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-nav-title {
    font-size: 13px;
    color: #1a3a52;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 返回列表 */
.detail-back {
    margin-top: 8px;
}

.btn-back {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1.5px solid #004c99;
    color: #004c99;
    text-decoration: none;
    font-size: 13px;
    border-radius: 20px;
    -webkit-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
}

.btn-back:hover {
    background: #004c99;
    color: #fff;
}

/* --- 側邊欄 --- */
.detail-sidebar {
    width: 280px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.sidebar-block {
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    overflow: hidden;
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
}

.sidebar-title {
    background: #427096;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 16px;
    margin: 0;
}

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

.sidebar-list li + li {
    border-top: 1px solid #eee;
}

.sidebar-list a {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
}

.sidebar-list a:hover {
    background: #f5f8fb;
}

.sidebar-list time {
    font-size: 11px;
    color: #999;
}

.sidebar-list span {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==============================================
   法規下載列表 (regulations)
   ============================================== */
.reg-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reg-item {
    border-bottom: 1px solid #eee;
}

.reg-item:first-child {
    border-top: 1px solid #eee;
}

.reg-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.reg-row:hover {
    background: #f5f8fb;
}

.reg-meta {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.reg-title {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 160px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a52;
    line-height: 1.5;
}

.reg-row:hover .reg-title {
    color: #004c99;
}

/* 發布時間標籤 */
.reg-row .news-date {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.reg-row .news-date::before {
    content: "發布時間：";
    font-size: 11px;
    color: #aaa;
}

.reg-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* 檔案類型標籤 */
.file-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
}

.file-tag.pdf  { background: #fce4e4; color: #c0392b; border: 1px solid #f5c6c6; }
.file-tag.doc  { background: #e3f0fb; color: #1565c0; border: 1px solid #b3d4f0; }
.file-tag.xls  { background: #e4f5ea; color: #2e7d32; border: 1px solid #b8dfc1; }
.file-tag.zip  { background: #fff3e0; color: #e65100; border: 1px solid #ffd9a0; }

/* 下載按鈕 */
.btn-download {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: #004c99;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    -webkit-transition: background 0.18s;
    transition: background 0.18s;
    line-height: 1;
}

.btn-download:hover {
    background: #427096;
}

.btn-download svg {
    width: 13px;
    height: 13px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* 法規分類動態色（對應後台 Element Plus 索引順序） */
:root {
  --bc0: #409eff; --bc1: #67c23a; --bc2: #e6a23c;
  --bc3: #606266; --bc4: #f56c6c; --bc5: #909399;
}
.news-badge.badge-c0 { background: #409eff; }
.news-badge.badge-c1 { background: #67c23a; }
.news-badge.badge-c2 { background: #e6a23c; }
.news-badge.badge-c3 { background: #606266; }
.news-badge.badge-c4 { background: #f56c6c; }
.news-badge.badge-c5 { background: #909399; }

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 1024px) {
    .detail-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .page-banner {
        padding: 36px 5%;
    }

    .page-banner h1 {
        font-size: 22px;
    }

    /* 有縮圖：改直排 */
    .news-card {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .news-thumb {
        width: 100%;
        height: 180px;
    }

    .news-item--thumb .news-title {
        font-size: 15px;
    }

    /* 無縮圖 */
    .news-row {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: flex-start;
        gap: 6px;
    }

    /* 法規下載：換行 */
    .reg-row {
        gap: 10px;
    }

    .reg-title {
        -webkit-box-ordinal-group: 4;
        -ms-flex-order: 3;
        order: 3;
        width: 100%;
        min-width: 0;
        -webkit-box-flex: 0;
        -ms-flex: none;
        flex: none;
    }

    .reg-actions {
        -webkit-box-ordinal-group: 5;
        -ms-flex-order: 4;
        order: 4;
    }

    /* 詳情：側邊欄移到下方 */
    .detail-container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 32px;
    }

    .detail-sidebar {
        width: 100%;
        position: static;
    }

    .detail-title {
        font-size: 18px;
    }

    .detail-nav {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .detail-nav-btn.next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .news-tabs {
        gap: 6px;
    }

    .news-tab {
        padding: 5px 12px;
        font-size: 12px;
    }

    .news-thumb {
        height: 140px;
    }

    .detail-cover img {
        max-height: 220px;
    }
}
