/* 最新資訊頁面樣式 */

/* 頁面頭部 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4a2e 100%);
    color: #fff;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 新聞列表區域 */
.news-section {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.news-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 搜索和篩選區域 */
.search-filter-area {
    padding: 30px 50px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-box {
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0 15px;
    transition: border-color 0.3s ease;
}

.search-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 37, 24, 0.1);
}

.search-input-group i {
    color: var(--light-text);
    font-size: 18px;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 0;
    font-size: 16px;
    background: transparent;
}

.search-input::placeholder {
    color: var(--light-text);
}

.search-btn-news {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.search-btn-news:hover {
    background: #1a4a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 37, 24, 0.3);
}

.filter-box {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

/* 自定義下拉選項 */
.custom-dropdown {
    position: relative;
    min-width: 120px;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 2px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    min-height: 42px;
}

.dropdown-trigger:hover {
    border-color: var(--primary-color);
}

.dropdown-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 37, 24, 0.1);
}

.dropdown-trigger i {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--light-text);
}

.dropdown-trigger.active i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 97%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 0;
    min-width: auto;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    border-bottom: 1px solid #f1f3f4;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-item.selected:hover {
    background-color: #1a4a2e;
}

/* 滾動條樣式 */
.dropdown-menu::-webkit-scrollbar {
    width: 0px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #1a4a2e;
}

.clear-filter-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.clear-filter-btn:hover {
    background: #d4b76a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 199, 88, 0.3);
}

/* 新聞列表 */
.news-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding: 40px 50px;
}

.news-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片圖片區域 */
.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* 卡片內容區域 */
.news-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.news-date {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
    flex: 1;
}

/* 按鈕區域 */
.news-buttons {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.feature-btn,
.tx-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    /* flex: 1; */
    text-align: center;
}

.feature-btn {
    background: var(--primary-color);
    color: #fff;
}

.feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.tx-btn {
    background: var(--primary-color);
    color: #fff;
}

.tx-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Layui 分頁樣式 */
#pagination {
    padding: 40px 50px;
    /* background: #f8f9fa; */
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .page-title {
        font-size: 42px;
    }

    .search-filter-area {
        padding: 25px 40px;
    }

    .news-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        padding: 30px 40px;
    }
}

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

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

    .page-header p {
        font-size: 16px;
    }

    .news-section {
        padding: 60px 0;
    }

    .container {
        padding: 0 20px;
    }

    .search-filter-area {
        padding: 20px 30px;
    }

    .filter-box {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .filter-group {
        justify-content: space-between;
    }

    .custom-dropdown {
        min-width: auto;
        flex: 1;
    }

    .clear-filter-btn {
        align-self: center;
        width: 100%;
        max-width: 200px;
    }

    .news-list {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 25px 30px;
    }

    .news-card-image {
        height: 180px;
    }

    .news-card-content {
        padding: 18px;
    }

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

    .feature-btn,
    .tx-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    #pagination {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 0;
        height: 220px;
        display: flex;
        align-items: center;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .page-header p {
        font-size: 14px;
    }

    .news-section {
        padding: 40px 0;
    }

    .search-filter-area {
        padding: 15px 25px;
    }

    .search-input-group {
        padding: 15px;
    }

    .search-input-group i {
        margin-right: 0;
        margin-bottom: 0px;
        font-size: 15px;
    }

    .search-input {
        width: 100%;
        margin-bottom: 0px;
        padding: 0 15px;
    }

    .search-btn {
        width: 100%;
        margin-left: 0;
    }

    .news-list {
        padding: 20px 15px;
        gap: 20px;
    }

    .news-card-image {
        height: 160px;
    }

    .news-card-content {
        padding: 15px;
    }

    .news-title {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .news-date {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .feature-btn,
    .tx-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    #pagination {
        padding: 25px 15px;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:nth-child(1) {
    animation-delay: 0.1s;
}

.news-card:nth-child(2) {
    animation-delay: 0.2s;
}

.news-card:nth-child(3) {
    animation-delay: 0.3s;
}

.news-card:nth-child(4) {
    animation-delay: 0.4s;
}

.news-card:nth-child(5) {
    animation-delay: 0.5s;
}

.news-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* 載入動畫 */
.news-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 空狀態 */
.news-list:empty::after {
    content: '暫無最新資訊';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: var(--light-text);
    font-size: 18px;
}

/* 搜索高亮 */
.news-card.highlight {
    background-color: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
}

/* 圖片載入動畫 */
.card-img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 按鈕點擊動畫 */
.feature-btn:active,
.tx-btn:active {
    transform: scale(0.95);
}

/* 標籤樣式 */
.news-tag {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* 閱讀時間 */
.news-read-time {
    color: var(--light-text);
    font-size: 14px;
    margin-left: 15px;
}

/* 分享按鈕 */
.news-share {
    margin-top: 15px;
}

.news-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f3f4;
    color: var(--light-text);
    margin-right: 8px;
    transition: all 0.3s ease;
}

.news-share a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}