/* ===== 首頁專屬樣式 ===== */

/* 螢光筆高亮效果 */
mark.highlight {
    background-color: #ffeb3b;
    color: #000;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 235, 59, 0.3);
}

/* 訊息提示樣式 */
.messages {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

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

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

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #38a169;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

/* 文章區域 */
.articles-section {
    padding: 0 0 50px 0;
    background-color: #f8f9fa;
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.article-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    animation: fadeInUp 0.8s ease;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

/* 排程文章樣式 */
.article-card.article-scheduled {
    background: #e8f4fd;
    border-left: 4px solid #3498db;
}

.article-card.article-scheduled:hover {
    box-shadow: 0 20px 50px rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.article-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.article-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

/* 狀態徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.scheduled-badge {
    background: #3498db;
    color: #fff;
}

.article-date {
    display: inline-block;
    font-size: 0.95rem;
    color: #667eea;
    font-weight: 600;
    background: #f0f3ff;
    padding: 0.4rem 1rem;
    border-radius: 15px;
}

.article-content {
    margin: 1.5rem 0;
    padding-bottom: 1rem;
    color: #555;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content p {
    margin: 0;
}

/* 只針對文章卡片中的內文預覽做限制 */
.article-card .article-content {
    min-height: 120px;
    max-height: 120px;
    overflow: hidden;
}

.article-card .article-content p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.article-footer-link {
    display: flex;
    justify-content: flex-end;
}

.article-time {
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
    display: block;
}

.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.no-articles p {
    font-size: 1.3rem;
    color: #666;
    margin: 0;
}

/* 頁面頂部操作列 */
.article-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title {
    margin: 0;
}

/* 按鈕樣式 */
.btn-create-article {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-create-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-my-articles {
    padding: 0.5rem 1.25rem;
    background: #48bb78;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(72, 187, 120, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-my-articles:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-back-to-articles {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
}

/* 搜尋表單 */
.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.search-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #667eea;
}

.search-select:focus {
    outline: none;
    border-color: #667eea;
}

.search-input {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.search-clear {
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    color: #666;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.search-clear:hover {
    background: #e9ecef;
}

/* 搜尋結果提示 */
.search-result-info {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f0f3ff;
    border-radius: 12px;
    color: #667eea;
    font-weight: 500;
}

/* 分頁樣式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pagination.bottom {
    margin-top: 3rem;
    margin-bottom: 0;
}

.page-link {
    padding: 0.75rem 1rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.page-current {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

/* 文章卡片內部連結 */
.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-footer-info .author-name {
    color: #718096;
    font-size: 0.9rem;
}

.article-footer-info .author-link {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
}

.article-footer-info .author-link:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.article-footer-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Version Info Section */
.version-section {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.version-info {
    text-align: center;
}

.version-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.version-info strong {
    color: #374151;
    font-weight: 600;
}

/* 無限滾動 - 載入更多指示器 */
#load-more-container {
    text-align: center;
    padding: 3rem 0;
    margin-top: 2rem;
}

.load-more-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.load-more-spinner p {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

/* 旋轉載入動畫 */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f3ff;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 無更多內容提示 */
#no-more-articles {
    text-align: center;
    padding: 3rem 0;
    margin-top: 2rem;
}

.no-more-content {
    background: linear-gradient(135deg, #f0f3ff 0%, #e8f4fd 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.no-more-content p {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

/* 載入錯誤提示 */
.load-error {
    background: #fed7d7;
    color: #742a2a;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #e53e3e;
    text-align: center;
}

.load-error p {
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.btn-retry {
    padding: 0.5rem 1.5rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-retry:hover {
    background: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

/* 載入中狀態 */
#load-more-container.loading .spinner {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 分頁模式切換按鈕 */
.pagination-mode-toggle {
    text-align: center;
    padding: 2rem 0;
    margin-top: 1rem;
}

.btn-toggle-pagination {
    padding: 0.75rem 2rem;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-toggle-pagination:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-toggle-pagination .toggle-icon {
    font-size: 1.2rem;
    animation: rotateIcon 2s linear infinite;
}

@keyframes rotateIcon {
    0%, 90%, 100% {
        transform: rotate(0deg);
    }
    95% {
        transform: rotate(180deg);
    }
}

.btn-toggle-pagination:hover .toggle-icon {
    animation: rotateIconFast 0.5s linear;
}

@keyframes rotateIconFast {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 改善分頁樣式 */
.pagination-wrapper {
    margin-top: 3rem;
}

/* 分頁按鈕波浪效果 */
.page-link {
    position: relative;
    overflow: hidden;
}

.page-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.page-link:hover::before {
    width: 300px;
    height: 300px;
}

/* 當前頁碼脈衝效果 */
.page-current {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* 文章卡片淡入動畫 */
.article-card {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 骨架屏載入動畫 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 首頁響應式設計 */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .article-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .status-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .btn-toggle-pagination {
        font-size: 0.9rem;
        padding: 0.65rem 1.5rem;
    }

    /* 小螢幕時搜尋表單可以換行 */
    .search-form {
        flex-wrap: wrap;
    }

    .search-input {
        min-width: 150px;
    }

    .search-select {
        font-size: 0.9rem;
        padding: 0.65rem 0.875rem;
    }

    .search-button {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .article-card {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .pagination {
        gap: 0.3rem;
    }

    .page-link,
    .page-current {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-width: 38px;
    }
}
/* 進階搜尋按鈕 */
.search-advanced-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.search-advanced-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
    .search-advanced-btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.9rem;
    }
}

