﻿/* ============================================================
   新竹市教育新聞網 - 現代科技風格 CSS
   ============================================================ */

/* ------------ 變數定義 ------------ */
:root {
    /* 主色調 */
    --primary-color: #00c6fb;
    --primary-dark: #005bea;
    --secondary-color: #38ef7d;
    --secondary-dark: #11998e;
    --accent-color: #fc6767;
    --accent-dark: #ec008c;
    --neutral-light: #f0f5ff;
    --neutral-dark: #2a3950;
    --text-primary: #212b36;
    --text-secondary: #637381;
    --white: #ffffff;
    --black: #000000;
    /* 背景 */
    --bg-primary: #f7fafc;
    --bg-secondary: #edf2f7;
    --card-bg: var(--white);
    /* 漸變 */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    --gradient-surface: linear-gradient(120deg, #fdfbfb 0%, var(--bg-primary) 100%);
    /* 陰影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    /* 陰影特效 */
    --shadow-primary: 0 10px 20px rgba(0, 198, 251, 0.2);
    --shadow-secondary: 0 10px 20px rgba(56, 239, 125, 0.2);
    --shadow-accent: 0 10px 20px rgba(252, 103, 103, 0.2);
    /* 轉場 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    /* 尺寸 */
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
}

/* ------------ 基本設定與全局樣式 ------------ */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.card-title, .featured-title, .section-heading, .hero-title {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-weight: 700;
}

.card-excerpt, .featured-excerpt, .content-area {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 1.15em;
    line-height: 1.8;
}

/* 頁面容器 */
.news-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
}

/* ------------ 動畫定義 ------------ */
@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ------------ 背景元素 ------------ */
.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25px 25px, rgba(0, 198, 251, 0.05) 2px, transparent 0), radial-gradient(circle at 75px 75px, rgba(56, 239, 125, 0.05) 2px, transparent 0);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: -1;
}

.bg-gradient-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--primary-color) 1px, transparent 1px), radial-gradient(var(--secondary-color) 1px, transparent 1px);
    background-position: 0 0, 25px 25px;
    background-size: 50px 50px;
    opacity: 0.05;
    z-index: -2;
    pointer-events: none;
}

.accent-blob {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.03;
    z-index: -3;
    pointer-events: none;
}

.blob-1 {
    top: -200px;
    right: -100px;
    background: var(--gradient-accent);
}

.blob-2 {
    bottom: -200px;
    left: -100px;
    background: var(--gradient-primary);
}

/* ------------ 頂部英雄區域 ------------ */
.hero-section {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    padding: 70px 30px;
    margin-bottom: 40px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

    .hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #2b5876, #4e4376);
        z-index: -1;
        animation: gradientShift 15s ease infinite;
    }

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-section:hover::before {
    animation-play-state: paused;
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
    animation: fadeIn 0.8s ease-out;
}

.hero-title {
    color: var(--white);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
    display: inline-block;
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

    .hero-title::after {
        content: "";
        display: block;
        width: 60%;
        height: 4px;
        background: rgba(255, 255, 255, 0.7);
        margin: 10px auto 0;
        border-radius: 2px;
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
    }

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    font-weight: 500;
    max-width: 600px;
    margin: 20px auto 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 40%, transparent 60%), radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 30%, transparent 50%);
    opacity: 0.8;
}

/* 特別為「全部新聞」標題添加樣式 */
.hero-title span {
    display: inline-block;
    position: relative;
    padding: 0 10px;
}

    .hero-title span::before {
        content: '';
        position: absolute;
        left: -30px;
        top: 50%;
        width: 30px;
        height: 2px;
        background: rgba(255, 255, 255, 0.7);
        transform: translateY(-50%);
    }

    .hero-title span::after {
        content: '';
        position: absolute;
        right: -30px;
        top: 50%;
        width: 30px;
        height: 2px;
        background: rgba(255, 255, 255, 0.7);
        transform: translateY(-50%);
    }

/* 添加浮動粒子效果 */
.hero-section .particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1;
}

    .hero-section .particle:nth-child(1) {
        top: 20%;
        left: 10%;
        width: 60px;
        height: 60px;
        opacity: 0.1;
        animation: float 10s infinite ease-in-out;
    }

    .hero-section .particle:nth-child(2) {
        top: 60%;
        left: 80%;
        width: 40px;
        height: 40px;
        opacity: 0.1;
        animation: float 13s infinite ease-in-out;
    }

    .hero-section .particle:nth-child(3) {
        top: 40%;
        left: 40%;
        width: 20px;
        height: 20px;
        opacity: 0.1;
        animation: float 7s infinite ease-in-out;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* 響應式調整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

        .hero-title span::before {
            left: -20px;
            width: 20px;
        }

        .hero-title span::after {
            right: -20px;
            width: 20px;
        }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}


/* ------------ 篩選區塊 ------------ */
.filter-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

    .filter-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        background: var(--gradient-primary);
        z-index: 1;
    }

    .filter-container:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 18px; /* 增加欄位間距 */
}

.filter-group {
    flex: 1 1 220px; /* 所有欄位都可伸縮，基準寬 220px */
    min-width: 180px;
    max-width: 320px; /* 避免太寬 */
    position: relative;
}

/* 關鍵字欄位最大寬度更大 */
.filter-group:has(input.neo-input) {
    flex: 2 1 420px;
    max-width: 560px;
}

.filter-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-dark);
    font-size: 1rem;
    z-index: 2;
}

.neo-select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

    .neo-select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(0, 198, 251, 0.15);
    }

    .neo-select:hover {
        background-color: rgba(0, 198, 251, 0.03);
    }

.filter-group::after {
    content: "\f078";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.2em;
}

/* ============================================================
   [FILTER-RESET-GRID] 上排：三下拉置中；下排：關鍵字+搜尋+下載置中
   不新增命名；只用既有 .filter-form / .filter-group
   ============================================================ */

/* 高度與文字垂直置中（保險） */
.neo-input {
    height: 44px;
    padding: 0 15px 0 45px;
}

.neo-select {
    height: 44px;
    line-height: 44px;
    padding: 0 40px 0 45px;
}

.filter-form .btn {
    height: 44px;
    padding: 0 24px;
    white-space: nowrap;
}

.filter-icon {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* 只在 select 顯示箭頭；輸入框不顯示 */
.filter-group::after {
    content: none;
}

.filter-group:has(select.neo-select)::after {
    content: "\f078";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.2em;
}

/* 桌機：兩列三欄，整體置中 */
@media (min-width: 1200px) {
    .filter-form {
        display: grid;
        grid-template-columns: auto auto auto;
        grid-template-areas:
            "sel1 sel2 sel3" /* 第一列：三下拉 */
            "kw   kw   dl"; /* 第二列：關鍵字(佔兩欄) + 下載 */
        column-gap: 12px;
        row-gap: 16px;
        align-items: center;
        justify-content: center;
        justify-items: start;
    }

        /* 第一列三下拉維持 280px 並置中 */
        .filter-form > .filter-group:has(select[name="schoolName"]) {
            grid-area: sel1;
            width: 280px;
            justify-self: center;
        }

        .filter-form > .filter-group:has(select[name="studyStyle"]) {
            grid-area: sel2;
            width: 280px;
            justify-self: center;
        }

        .filter-form > .filter-group:has(select[name="timePeriod"]) {
            grid-area: sel3;
            width: 280px;
            justify-self: center;
        }

        /* 第二列：關鍵字格子本身置中，內部排成一排（輸入＋按鈕緊鄰） */
        .filter-form > .filter-group:has(input.neo-input) {
            grid-area: kw;
            justify-self: center; /* 這一格置中 */
            display: flex;
            align-items: center;
            gap: 12px; /* 輸入與按鈕的距離 */
        }

            .filter-form > .filter-group:has(input.neo-input) .neo-input {
                width: 420px;
            }

            .filter-form > .filter-group:has(input.neo-input) .btn {
                height: 44px;
                padding: 0 24px;
            }

        /* 第二列：下載維持在第三欄，依內容寬 */
        .filter-form > .filter-group:has(a.btn-outline-primary) {
            grid-area: dl;
            justify-self: center;
        }
}



/* 平板以下：改回彈性直排，但保持置中與等高 */
@media (max-width: 1199.98px) {
    .filter-form {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }

    .filter-group:has(select.neo-select) {
        flex: 0 1 260px;
    }

    .filter-group:has(input.neo-input) {
        flex: 1 1 360px;
        max-width: 560px;
    }
}

/* ============================================================
   [FILTER-MOBILE-FIX] 手機版(iOS/Safari)篩選列修復
   - 改為直向堆疊、全寬欄位
   - 隱藏絕對定位的左側圖示，避免圖示掉行
   - 下拉箭頭與高度置中調整
   - 搜尋/下載改為滿版好點擊
   ============================================================ */
@media (max-width: 767.98px) {
    .filter-form {
        display: block;
        padding: 0 4px;
    }
    .filter-group {
        position: relative;
        width: 100%;
        max-width: 100%;
        margin: 4px 0 8px;
    }
    .neo-select,
    .neo-input {
        width: 100%;
        height: 42px;
        line-height: 42px;
        padding: 0 36px 0 12px;
        font-size: 1rem;
    }
    .filter-icon {
        display: none;
    }
    .filter-group::after {
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.1em;
    }
    .filter-form .btn {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        margin-top: 2px;
        font-size: 1rem;
        border-radius: 8px;
    }
    /* 只保留學校、主題、日期三個欄位，其他隱藏 */
    .filter-group:not(:has(select[name="schoolName"])),
    .filter-group:not(:has(select[name="studyStyle"])),
    .filter-group:not(:has(select[name="timePeriod"])) {
        display: none !important;
    }
}


/* ------------ 區塊標題樣式 ------------ */
.section-heading {
    position: relative;
    margin-bottom: 30px;
    padding: 15px 20px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.8));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

    .section-heading::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 5px;
        height: 100%;
        background: var(--gradient-primary);
    }

    .section-heading::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 5px;
        height: 3px;
        width: 60px;
        background: var(--gradient-primary);
        border-radius: var(--border-radius-full);
    }

.section-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: var(--border-radius-md);
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

    .section-icon.hot {
        background: var(--gradient-accent);
        box-shadow: var(--shadow-accent);
    }

    .section-icon.new {
        background: var(--gradient-secondary);
        box-shadow: var(--shadow-secondary);
    }

/* ------------ 新聞卡片樣式 ------------ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.news-card {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-xl);
    }

    .news-card a.card-link {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
    }

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

    .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease;
    }

.news-card:hover .card-image img {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.badge-hot {
    background: var(--gradient-accent);
}

.badge-new {
    background: var(--gradient-secondary);
}

.badge-tag {
    background: var(--gradient-primary);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 50%);
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color var(--transition-fast);
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    letter-spacing: 0.02em;
}

.news-card:hover .card-title {
    color: var(--primary-dark);
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--bg-secondary);
    margin-top: auto;
}

.card-meta {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    letter-spacing: 0.01em;
}

    .meta-item i {
        margin-right: 5px;
        font-size: 0.95rem;
    }

/* 顏色標籤變化 */
.school-tag-1 {
    color: var(--primary-color);
}

.school-tag-2 {
    color: var(--secondary-color);
}

.school-tag-3 {
    color: var(--accent-color);
}

.school-tag-4 {
    color: #9c27b0;
}
/* 紫色 */

.user-tag-1 {
    color: #4caf50;
}
/* 綠色 */
.user-tag-2 {
    color: #ff9800;
}
/* 橙色 */
.user-tag-3 {
    color: #2196f3;
}
/* 藍色 */
.user-tag-4 {
    color: #9c27b0;
}
/* 紫色 */

.date-tag-1 {
    color: #3f51b5;
}
/* 靛藍色 */
.date-tag-2 {
    color: #e91e63;
}
/* 粉紅色 */
.date-tag-3 {
    color: #009688;
}
/* 藍綠色 */
.date-tag-4 {
    color: #ff5722;
}
/* 深橙色 */

/* 查看詳情按鈕（已隱藏） */
.card-action {
    display: none;
}

/* ------------ 輪播區塊 ------------ */
.featured-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.carousel-container {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.featured-carousel {
    position: relative;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

    .carousel-slide.active {
        display: block;
    }

.featured-card {
    position: relative;
    height: 100%;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
}

    /* 新增：整個卡片可點擊 */
    .featured-card a.card-link {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
    }

.featured-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

    .featured-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease;
    }

.featured-card:hover .featured-image img {
    transform: scale(1.08);
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 60%);
}

.featured-content {
    padding: 25px;
}

.featured-title {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.featured-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.featured-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.featured-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 隱藏查看詳情按鈕 */
.featured-action {
    display: none;
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    z-index: 20; /* 提高控制按鈕的層級，確保可點擊 */
}

    .carousel-control:hover {
        background: var(--white);
        color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

.tech-carousel {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.carousel-item {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

    .carousel-item.active {
        display: block;
    }

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* 特殊英文字與數字樣式 */
.special-text {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

/* 內文閱讀優化 */
.card-excerpt, .featured-excerpt {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    line-height: 1.7;
}
   

/* ------------ 點贊按鈕樣式 (覆蓋 like-button.css) ------------ */
.like-button, .like-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    color: #6c757d; /* 默認狀態的灰色 */
    font-size: 0.9rem;
    padding: 5px 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-full);
    z-index: 15; /* 提高層級，確保可以點擊 */
    position: relative;
}

    .like-button:hover, .like-btn:hover {
        color: #ff3366; /* 懸停時的顏色 */
        background: rgba(255, 51, 102, 0.1);
    }

    .like-button.liked, .like-btn.liked {
        color: #ff3366; /* 點讚後的顏色 */
    }

    .like-button i, .like-btn i {
        margin-right: 5px;
        font-size: 1rem;
    }

    .like-button:disabled, .like-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    /* 保留動畫效果 */
    .like-button.pulse, .like-btn.pulse {
        animation: pulse 0.3s ease-in-out;
    }

    .like-button.error-shake, .like-btn.error-shake {
        animation: errorShake 0.4s ease-in-out;
    }


/* ------------ 分頁導航樣式 ------------ */
.pagination-container {
    margin: 40px 0;
}

.modern-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--border-radius-md);
    background: var(--white);
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

    .page-link:hover {
        background: var(--bg-secondary);
        color: var(--primary-dark);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.page-item.active .page-link {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ------------ 空狀態樣式 ------------ */
.empty-state {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 15px;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* ------------ 特效元素 ------------ */
.animated-title {
    background-image: linear-gradient(90deg, var(--primary-dark), var(--primary-color), var(--primary-dark));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ------------ 刪除新聞頁面樣式調整 ------------ */
.container .table {
    font-size: 1.1rem; /* 增加字體大小 */
    line-height: 1.4; /* 減少行高 */
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

    .container .table th {
        font-size: 1.2rem; /* 標題略大於內容 */
        font-weight: 600;
        background-color: var(--bg-secondary);
        padding: 12px 15px;
    }

    .container .table td {
        padding: 10px 15px; /* 增加單元格內部間距 */
        vertical-align: middle;
    }

.container h1 {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.05em;
    margin-bottom: 25px;
}

/* 更緊湊的警告提示框 */
.container .alert {
    padding: 12px 16px;
    font-size: 1.05rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* 調整分頁導航樣式 */
.container .pagination {
    margin-top: 25px;
}

    .container .pagination .page-link {
        font-size: 1rem;
    }

/* 按鈕樣式調整 */
.container .btn {
    font-size: 0.95rem;
    padding: 6px 12px;
}

/* ------------ 新聞詳情頁樣式 ------------ */
.container h1 {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: 0.03em;
    line-height: 1.2;
    position: relative;
    padding-bottom: 15px;
}

    .container h1::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 80px;
        height: 4px;
        background: var(--gradient-primary);
        border-radius: 2px;
    }

/* 發布資訊樣式 */
.container .d-flex small {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

/* 內容區域樣式 */
.content-area {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 1.15rem;
    line-height: 1.5; /* 從1.8降低到1.5 */
    color: var(--text-primary);
    margin: 25px 0;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}


    /* 內容區域內的各元素樣式 */
    .content-area p {
        margin-bottom: 0.8em; /* 降低段落間距 */
    }


    .content-area h2 {
        font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
        font-size: 1.8rem;
        font-weight: 600;
        margin-top: 1.2em; /* 從1.5em降低 */
        margin-bottom: 0.6em; /* 從0.8em降低 */
        color: var(--text-primary);
    }

    .content-area h3 {
        font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 1em; /* 從1.2em降低 */
        margin-bottom: 0.5em; /* 從0.7em降低 */
    }

    .content-area ul, .content-area ol {
        padding-left: 1.5rem; /* 從2rem降低 */
        margin-bottom: 0.8em; /* 從1.5em降低 */
    }

    .content-area li {
        margin-bottom: 0.3em; /* 從0.5em降低 */
    }

    .content-area img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 1em 0;
    }

    .content-area blockquote {
        border-left: 4px solid var(--primary-color);
        padding-left: 1.5rem;
        font-style: italic;
        color: var(--text-secondary);
        margin: 1.5em 0;
    }

/* 新聞圖片區域 */
.news-gallery h4 {
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* 返回按鈕樣式 */
.container .btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 10px 20px;
    font-family: 'Iansui', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-primary);
    transition: all var(--transition-normal);
}

    .container .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 15px rgba(0, 198, 251, 0.3);
    }

/* 點贊按鈕容器 */
.like-button-container {
    display: flex;
    align-items: center;
}

    .like-button-container .like-btn {
        font-size: 1.1rem;
        padding: 8px 15px;
    }

        .like-button-container .like-btn i {
            font-size: 1.2rem;
        }



/* 響應式調整 */
@media (max-width: 768px) {
    .container h1 {
        font-size: 2.2rem;
    }

    .content-area {
        font-size: 1.1rem;
        padding: 20px;
    }

        .content-area h2 {
            font-size: 1.6rem;
        }

        .content-area h3 {
            font-size: 1.3rem;
        }
}

@media (max-width: 576px) {
    .container h1 {
        font-size: 1.8rem;
    }

    .container .d-flex {
        flex-direction: column;
        gap: 10px;
    }

    .content-area {
        font-size: 1rem;
        padding: 15px;
    }
}

/* ------------ 響應式調整 ------------ */
@media (max-width: 992px) {
    .featured-section {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    .featured-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
    }

    .hero-section {
        padding: 50px 20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

        .hero-title span::before,
        .hero-title span::after {
            width: 20px;
        }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-heading {
        font-size: 1.3rem;
    }

    .featured-content {
        padding: 20px;
    }

    .featured-title {
        font-size: 1.2rem;
    }
}

.school-name { color: #388e3c; }
.announcer   { color: #6d4c41; }
.post-date   { color: #0288d1; }

.news-card {
    position: relative; /* 讓子元素可用 absolute 定位 */
}

    .news-card .post-date {
        position: absolute;
        top: 10px;
        left: 15px;
        font-size: 0.85rem;
        color: var(--text-secondary);
        background: rgba(255,255,255,0.85); /* 淺白底，避免壓到圖 */
        padding: 2px 8px;
        border-radius: 6px;
        z-index: 5;
        display: flex;
        align-items: center;
        gap: 4px; /* icon 和文字的距離 */
    }

        .news-card .post-date i {
            font-size: 0.9rem;
            margin-right: 3px;
        }

