/* 公司配色变量 */
:root {
    --primary-color: #A0522D;
    --primary-dark: #8B4513;
    --primary-light: #CD853F;
    --primary-lighter: #DEB887;
    --accent-color: #D2691E;
    --background-light: #f8f4f0;
    --shadow-primary: rgba(160, 82, 45, 0.3);
    --shadow-light: rgba(160, 82, 45, 0.1);
    --border-light: rgba(160, 82, 45, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8f4f0 0%, #f5f5f5 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 50%, #CD853F 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    pointer-events: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* 主要内容区域 */
.main {
    flex: 1;
    padding: 2rem;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 0.25rem;
    height: 48px;
    box-sizing: border-box;
    gap: 0.5rem;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    height: 100%;
}

.search-box i {
    color: #666;
    margin-right: 0.5rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: #333;
    padding: 0.5rem 0;
    line-height: 1.5;
}

.search-btn {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(160, 82, 45, 0.3);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.4);
}

.clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    flex-shrink: 0;
    font-size: 0.8rem;
}

.clear-btn:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.filter-box {
    display: flex;
    gap: 1rem;
}

.filter-box select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

/* 区域标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 .time-filter {
    font-size: 0.75rem;
    font-weight: normal;
    color: #666;
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.refresh-btn {
    background: #CD853F;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background: #A0522D;
}

/* 热门新闻区域 */
.top-news-section {
    margin-bottom: 2rem;
}

.top-news-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
    overflow: hidden;
}

.top-news-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.top-news-item:hover {
    background-color: #f8f9fa;
}

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

.news-rank {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 1rem;
    min-width: 40px;
}

.news-rank.rank-1 { color: #CD853F; font-weight: bold; }
.news-rank.rank-2 { color: #A0522D; font-weight: bold; }
.news-rank.rank-3 { color: #8B4513; font-weight: bold; }

.news-content {
    flex: 1;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.news-summary {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 新闻列表 */
.news-section {
    margin-bottom: 2rem;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active {
    background: #A0522D;
    color: white;
    border-color: #A0522D;
}

.news-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.news-item {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.news-item:hover {
    background-color: #f8f9fa;
}

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

.news-item .news-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.news-item .news-meta {
    margin-bottom: 1rem;
}

/* 网格视图 */
.news-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    background: none;
    box-shadow: none;
}

.news-list.grid-view .news-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #A0522D;
    color: white;
    border-color: #A0522D;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #A0522D;
    color: white;
}

.btn-primary:hover {
    background: #8B4513;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 加载和通知 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #A0522D;
    margin-bottom: 1rem;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
}

.notification-content {
    background: #28a745;
    color: white;
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.notification.error .notification-content {
    background: #dc3545;
}

.notification.warning .notification-content {
    background: #ffc107;
    color: #333;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1rem;
}

/* 底部 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* 标签样式 */
.tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 0.1rem;
}

.tag.category {
    background: rgba(160, 82, 45, 0.1);
    color: #8B4513;
    border: 1px solid rgba(160, 82, 45, 0.2);
}

.tag.source {
    background: rgba(205, 133, 63, 0.1);
    color: #A0522D;
    border: 1px solid rgba(205, 133, 63, 0.2);
}

/* 状态指示器 */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-box {
        min-width: auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .news-list.grid-view {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .favorite-item {
        flex-direction: column;
        gap: 1rem;
    }

    .favorite-actions {
        flex-direction: row;
        justify-content: center;
    }

    .favorite-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 收藏按钮样式 */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #666;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.favorite-btn:hover {
    background: rgba(160, 82, 45, 0.1);
    color: var(--primary-color);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #ffd700;
}

.favorite-btn.favorited:hover {
    color: #ffed4e;
}

.favorite-btn.loading {
    color: var(--primary-color);
    cursor: not-allowed;
}

.favorite-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 热门新闻中的收藏按钮 */
.top-news-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-news-favorite:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 新闻列表中的收藏按钮 */
.news-list-favorite {
    margin-left: auto;
    font-size: 14px;
}

/* 新闻项需要相对定位以便收藏按钮绝对定位 */
.top-news-item {
    position: relative;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 收藏按钮动画效果 */
@keyframes favoriteAdded {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.favorite-btn.favorited {
    animation: favoriteAdded 0.3s ease;
}

/* 收藏文本样式 */
.favorite-text {
    font-size: 12px;
    font-weight: 500;
}

/* 收藏页面样式 */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
}

.page-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.page-description {
    color: #666;
    font-size: 1.1rem;
}

.favorites-content {
    max-width: 800px;
    margin: 0 auto;
}

.favorites-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.favorites-list {
    margin-bottom: 2rem;
}

.favorite-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.favorite-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(160, 82, 45, 0.2);
}

.favorite-content {
    flex: 1;
}

.favorite-title {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 1.2rem;
    font-weight: 600;
}

.favorite-title:hover {
    color: var(--primary-dark);
}

.favorite-summary {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.favorite-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
}

.favorite-meta i {
    margin-right: 0.3rem;
}

.favorite-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-remove-favorite,
.btn-external {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-remove-favorite {
    background: #ffd700;
    color: #333;
}

.btn-remove-favorite:hover {
    background: #ffed4e;
    transform: scale(1.1);
}

.btn-external {
    background: #6c757d;
    color: white;
}

.btn-external:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.empty-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(160, 82, 45, 0.1);
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.empty-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.error-icon {
    color: #dc3545;
}

.btn-retry {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-retry:hover {
    background: var(--primary-dark);
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    margin: 0 0.2rem;
}

.page-btn:hover {
    background: #f8f9fa;
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
