/* 頁首 */
.page-header {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.back-link {
    position: absolute;
    left: 20px;
    top: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-dark);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid var(--gold-primary);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--gold-primary);
    color: white;
    transform: translateX(-5px);
}

.page-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: var(--gold-dark);
    margin-bottom: 15px;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0px var(--gold-light);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-brown);
    letter-spacing: 1px;
}

/* 分類導航 */
.category-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0;
    padding: 0 20px;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.category-btn {
    padding: 10px 25px;
    border: 2px solid var(--gold-primary);
    background: rgba(255, 255, 255, 0.9);
    color: var(--gold-dark);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif TC', serif;
}

.category-btn:hover {
    background: var(--gold-light);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: white;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

/* 文章網格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 0 20px;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* 文章卡片 */
.article-card {
    background: var(--card-bg);
    border: 2px solid var(--gold-primary);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(218, 165, 32, 0.15));
    transition: left 0.5s ease;
    z-index: 0;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(139, 105, 20, 0.3);
    border-color: var(--gold-shine);
}

.article-card:hover::before {
    left: 0;
}

.article-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(218, 165, 32, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-dark);
    font-size: 3rem;
}

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

.article-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.article-category {
    display: inline-block;
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
}

.article-date {
    color: var(--text-brown);
    font-size: 0.9rem;
}

.article-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-summary {
    color: var(--text-brown);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
}

.article-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-brown);
    font-size: 0.9rem;
}

.article-views {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gray-dark);
    font-size: 0.9rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-dark);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--gold-shine);
    transform: translateX(5px);
}

/* 載入中 */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--gold-dark);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 無文章 */
.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-brown);
}

.no-articles i {
    font-size: 4rem;
    color: var(--gold-primary);
    margin-bottom: 20px;
}

.no-articles p {
    font-size: 1.2rem;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.page-btn {
    padding: 10px 20px;
    border: 2px solid var(--gold-primary);
    background: var(--card-bg);
    color: var(--gold-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-btn:hover, .page-btn.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: white;
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 頁尾 */
.articles-footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px solid rgba(184, 134, 11, 0.3);
    animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

.footer-decoration {
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--gold-primary), transparent);
    margin: 0 auto 20px;
    position: relative;
}

.footer-decoration::before,
.footer-decoration::after {
    content: '◆';
    position: absolute;
    color: var(--gold-primary);
    font-size: 0.8rem;
    top: -7px;
}

.footer-decoration::before {
    left: -20px;
}

.footer-decoration::after {
    right: -20px;
}

.footer-text {
    font-size: 1rem;
    color: var(--text-brown);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.footer-subtext {
    font-size: 0.9rem;
    color: var(--gold-dark);
    font-weight: 600;
    letter-spacing: 2px;
}

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

    .back-link {
        position: static;
        margin-bottom: 20px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-nav {
        gap: 10px;
    }

    .category-btn {
        padding: 8px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 30px 15px;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .article-content {
        padding: 20px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}