/* 頁面標題 */
.page-header {
    text-align: center;
    margin-bottom: 0;
    padding: 60px 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/football-pattern.png') repeat;
    opacity: 0.1;
    z-index: 1;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    position: relative;
    z-index: 2;
}

.main-container {
    flex-direction: column;
    padding-top: 40px;
}

/* 新聞區域樣式 */
.news-section {
    padding: 20px 0;
    background-color: #f5f5f5;
    min-height: 100vh;
    padding-top: 0px;
}

.news-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 篩選器樣式 */
.news-filters {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 35px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 桌面版篩選器 */
.desktop-filters {
    display: block;
}

/* 移動端篩選器 */
.mobile-filters {
    display: none;
}

/* 移動端篩選器組 */
.mobile-filter-group {
    margin-bottom: 15px;
}

.mobile-filter-group:last-child {
    margin-bottom: 0;
}

.mobile-filter-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 自定義下拉框 */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.dropdown-selected:hover {
    border-color: #D00D09;
}

.dropdown-selected.active {
    border-color: #D00D09;
    box-shadow: 0 0 0 3px rgba(208, 13, 9, 0.1);
}

.dropdown-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown-selected.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #D00D09;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.dropdown-options.show {
    display: block;
}

.dropdown-option {
    padding: 12px 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

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

.dropdown-option:hover {
    background-color: #f8f9fa;
    color: #D00D09;
}

.dropdown-option.selected {
    background-color: #D00D09;
    color: #fff;
}

.dropdown-option.selected:hover {
    background-color: #b00a07;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: inline-block;
    font-weight: 600;
    color: #333;
    margin-right: 15px;
    min-width: 80px;
    font-size: 14px;
}

.filter-options {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #D00D09;
    color: #D00D09;
}

.filter-btn.active {
    background: #D00D09;
    border-color: #D00D09;
    color: #fff;
}

/* 新聞列表樣式 */
.news-list {
    display: grid;
    gap: 20px;
}

.news-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    min-height: 160px;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.news-image {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.news-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(208, 13, 9, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

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

.news-source {
    font-weight: 500;
    color: #D00D09;
}

.news-time,
.news-views {
    position: relative;
}

.news-time::before,
.news-views::before {
    content: "•";
    margin-right: 8px;
    color: #ddd;
}

/* 載入更多按鈕 */
.load-more-section {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 12px 30px;
    background: #D00D09;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.load-more-btn:hover {
    background: #B00B08;
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 隱藏新聞項目 */
.news-item.hidden {
    display: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .news-container {
        padding: 0 15px;
    }

    .news-filters {
        padding: 15px;
    }

    .filter-group {
        margin-bottom: 12px;
    }

    .filter-group label {
        display: block;
        margin-bottom: 8px;
        margin-right: 0;
    }

    .filter-options {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    .news-item {
        flex-direction: column;
        min-height: auto;
    }

    .news-image {
        width: 100%;
        height: 200px;
    }

    .news-content {
        padding: 15px;
    }

    .news-title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }

    .news-summary {
        font-size: 13px;
        -webkit-line-clamp: 2;
        margin-bottom: 10px;
    }

    .news-meta {
        gap: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .news-section {
        padding: 15px 0;
        padding-top: 0;
    }

    .news-container {
        padding: 0 10px;
    }

    .news-filters {
        padding: 12px;
        margin-bottom: 25px;
    }

    .filter-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .news-content {
        padding: 12px;
    }

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

    .news-summary {
        font-size: 12px;
    }

    .news-meta {
        font-size: 11px;
        gap: 8px;
    }

    .load-more-btn {
        padding: 10px 25px;
        font-size: 13px;
    }
}

/* 載入動畫 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #D00D09;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 無結果提示 */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.no-results::before {
    content: "📰";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 新聞詳情頁樣式 */
.news-detail-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* 麵包屑導航 */
.breadcrumb-nav {
    margin-bottom: 30px;
    font-size: 14px;
    color: #666;
}

.breadcrumb-nav a {
    color: #222;
    text-decoration: none;
}

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

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

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

/* 內容包裝器 */
.content-wrapper {
    display: flex;
    gap: 30px;
}

/* 主要內容區域 */
.main-content {
    flex: 1;
    min-width: 0;
}

/* 文章樣式 */
.news-article {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-image {
    margin-bottom: 25px;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.content-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #D00D09;
}

.content-text h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 25px 0 12px 0;
}

.content-text p {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.8;
}

.content-text ul,
.content-text ol {
    margin: 16px 0;
    padding-left: 25px;
}

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

.content-text strong {
    color: #D00D09;
    font-weight: 600;
}

/* 文章標籤 */
.article-tags {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.tag-label {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 5px;
    border: 1px solid #e9ecef;
}

.tag:hover {
    background: #D00D09;
    color: #fff;
    border-color: #D00D09;
}

/* 分享按鈕 */
.article-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.share-label {
    font-weight: 600;
    color: #333;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.wechat {
    background: #07c160;
}

/* 相關文章 */
.related-articles {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #D00D09;
    position: relative;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.related-item:hover {
    border-color: #D00D09;
    box-shadow: 0 2px 8px rgba(208, 13, 9, 0.1);
}

.related-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    flex: 1;
}

.related-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.related-content h4 a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.related-content h4 a:hover {
    color: #D00D09;
}

.related-date {
    font-size: 12px;
    color: #999;
}

/* 側邊欄樣式 */
.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-widget.ads {
    padding: 0px;
    background: none;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #D00D09;
    position: relative;
}

/* 熱門文章樣式 */
.popular-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.popular-item:hover {
    border-color: #D00D09;
    background: #fafafa;
}

.popular-rank {
    width: 24px;
    height: 24px;
    background: #D00D09;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.popular-content {
    flex: 1;
    min-width: 0;
}

.popular-content h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.popular-content h4 a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-content h4 a:hover {
    color: #D00D09;
}

.popular-views {
    font-size: 12px;
    color: #999;
}

/* 最新文章樣式 */
.latest-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.latest-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.latest-item:hover {
    border-color: #D00D09;
    background: #fafafa;
}

.latest-image {
    width: 60px;
    height: 45px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
}

.latest-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-content {
    flex: 1;
    min-width: 0;
}

.latest-content h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.latest-content h4 a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-content h4 a:hover {
    color: #D00D09;
}

.latest-date {
    font-size: 12px;
    color: #999;
}

/* 文章分類樣式 */
.categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    margin-bottom: 8px;
}

.categories li:last-child {
    margin-bottom: 0;
}

.categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.categories a:hover {
    background: #f8f9fa;
    color: #D00D09;
}

.categories span {
    background: #e9ecef;
    color: #666;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

/* 廣告樣式 */
.advertisement {
    position: relative;
    background: linear-gradient(135deg, #8BC34A 0%, #689F38 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.advertisement:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ad-content {
    position: relative;
    color: #fff;
    text-align: center;
    padding-bottom: 15px;
}

.ad-content img {
    max-width: 100%;
}

.ad-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    margin-top: 12px;
}

.ad-cta {
    background: #1565C0;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.ad-cta:hover {
    background: #0D47A1;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
}


/* 響應式設計 */
@media (max-width: 1024px) {
    .news-detail-container {
        padding: 15px;
    }

    .content-wrapper {
        gap: 20px;
    }

    .sidebar {
        width: 250px;
    }

    .news-article {
        padding: 25px;
    }

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

@media (max-width: 768px) {
    .page-header {
        padding: 40px 20px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

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

    /* 移動端顯示下拉框，隱藏按鈕 */
    .desktop-filters {
        display: none;
    }

    .mobile-filters {
        display: block;
    }

    .news-filters {
        padding: 15px;
        margin-bottom: 25px;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 25px;
    }

    .sidebar {
        width: 100%;
        order: -1;
    }

    .news-article {
        padding: 20px;
    }

    .article-title {
        font-size: 22px;
    }

    .content-text h2 {
        font-size: 20px;
    }

    .content-text h3 {
        font-size: 18px;
    }

    .popular-item {
        align-items: flex-start;
    }

    .popular-rank {
        align-self: flex-start;
    }

    .popular-content {
        width: 100%;
    }

    .latest-item {
        align-items: flex-start;
    }

    .latest-image {
        align-self: flex-start;
    }

    .latest-content {
        width: 100%;
    }
}


@media (max-width: 568px) {
    .news-filters {
        padding: 12px;
        margin-bottom: 20px;
    }

    .dropdown-selected {
        padding: 10px 12px;
        font-size: 13px;
    }

    .dropdown-option {
        padding: 10px 12px;
        font-size: 13px;
    }

    .mobile-filter-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

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

    .news-detail-container {
        padding: 0px 10px;
    }

    .breadcrumb-nav{
        margin-bottom: 20px;
    }
    
    .main-content {
        order: 1;
    }

    .sidebar {
        order: 2;
    }

    .main-container {
        padding-top: 17px;
        padding-left: 2px;
        padding-right: 2px;
    }

    .article-title {
        text-align: center;
        font-size: 18px;
    }

    .article-meta {
        font-size: 13px;
        justify-content: center;
    }

    .news-article {
        padding-left: 13px;
        padding-right: 13px;
    }

    .content-text p {
        font-size: 13px;
    }

    .widget-title {
        margin-bottom: 13px;
    }




}