/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei',
    'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面标题区域 - 移动端优化 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-title {
    font-size: 1.5rem;
    color: #ffd166;
}

.page-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
    font-weight: 300;
    line-height: 1.4;
}

/* 功能按钮 - 移动端优化 */
.header-actions {
    margin-bottom: 16px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.action-buttons::-webkit-scrollbar {
    display: none;
}

.btn {
    padding: 10px 16px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-text {
    display: inline;
}

.btn-primary {
    background-color: #ff6b6b;
    color: white;
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.btn-outline:hover {
    border-color: white;
}

/* 移动端筛选指示器 */
.mobile-filter-indicator {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.9rem;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

.mobile-filter-indicator i {
    color: #4ade80;
}

.btn-clear-small {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}

/* 来源筛选器 */
.source-filter {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

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

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.filter-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.btn-filter-clear {
    background: none;
    border: none;
    color: #ffd166;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
}

.btn-filter-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

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

.filter-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-tag.active {
    background: #ffd166;
    color: #333;
    font-weight: 600;
    border-color: #ffd166;
}

.filter-tag.active i {
    font-size: 0.8rem;
}

/* 主内容区域 */
.card-body {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.date-group {
    margin-bottom: 32px;
}

.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
}

.date-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-indicator i {
    color: #667eea;
    font-size: 1.1rem;
}

.date-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
}

.news-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 新闻卡片 */
.news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #667eea;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover::before {
    opacity: 1;
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.source-name {
    font-weight: 600;
}

.card-time {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.95rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: #64748b;
}

/* 卡片标题 */
.card-title {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    flex: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.card-title h2:hover {
    color: #667eea;
}

.trending-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 作者信息 */
.card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.card-author i {
    font-size: 0.75rem;
}

/* 卡片内容 */
.card-content {
    margin-bottom: 16px;
    color: #475569;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-meta {
    display: flex;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.meta-item:hover {
    color: #64748b;
}

.meta-item.liked {
    color: #ff6b6b;
}

/* 加载更多 */
.footer-actions {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f1f5f9;
}

.btn-load-more {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.no-more {
    color: #94a3b8;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.no-data i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-data p {
    font-size: 1rem;
    margin-bottom: 16px;
}

.btn-reset {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

/* 页脚 */
.page-footer {
    text-align: center;
    margin-top: 32px;
    padding: 16px;
    color: #64748b;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 20px;
}

.modal-news-title {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

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

.share-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
    font-size: 0.9rem;
}

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

.share-btn.weibo {
    background: #e6162d;
    color: white;
}

.share-btn.copy {
    background: #f1f5f9;
    color: #334155;
}

/* 加载状态样式 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.loading-spinner {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 16px;
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.btn-retry {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* 旋转动画 */
.fa-spin {
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .page-header {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 1.5rem;
        gap: 8px;
    }

    .icon-title {
        font-size: 1.3rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    /* 移动端按钮优化 */
    .action-buttons {
        gap: 8px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-width: auto;
        flex: 1;
    }

    .btn-text {
        display: none;
    }

    .btn i {
        margin: 0;
        font-size: 1rem;
    }

    .btn-primary, .btn-secondary, .btn-outline {
        min-width: 60px;
        justify-content: center;
    }

    /* 显示移动端筛选指示器 */
    .mobile-filter-indicator {
        display: flex;
    }

    /* 筛选器移动端优化 */
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .filter-tags {
        max-height: 200px;
        overflow-y: auto;
    }

    .card-body {
        padding: 16px;
        border-radius: 12px;
    }

    .date-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .date-text {
        font-size: 1rem;
    }

    .news-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-card {
        padding: 16px;
    }

    .card-title h2 {
        font-size: 1.1rem;
    }

    .trending-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .card-content {
        font-size: 0.85rem;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tags {
        width: 100%;
    }

    .card-meta {
        width: 100%;
        justify-content: space-between;
    }

    .footer-actions {
        margin-top: 24px;
        padding-top: 20px;
    }

    .btn-load-more {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .share-options {
        flex-direction: column;
    }

    .share-btn {
        min-width: 100%;
    }
}

/* 超小屏幕手机 */
@media (max-width: 480px) {
    .page-title {
        font-size: 1.3rem;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .btn i {
        font-size: 0.9rem;
    }

    .date-text {
        font-size: 0.95rem;
    }

    .news-count {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}
