* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 默认浅色主题 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

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

/* 头部控制按钮容器 */
.header-controls {
    display: flex;
    gap: 1rem;
}

/* 主题切换按钮 */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 刷新按钮 */
.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.theme-icon, .refresh-icon {
    font-size: 1.2rem;
}

.container {
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* 平台网格布局 */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* 固定高度的新闻容器 */
.news-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 拖拽时的样式 */
.news-container.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* 拖拽覆盖时的样式 */
.news-container.drag-over {
    border-top: 3px solid #3498db;
}

/* 平台信息标题 */
.platform-header {
    padding: 0.8rem;
    background: #34495e;
    color: white;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; /* 显示拖拽光标 */
}

/* Logo样式 */
.platform-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 2px;
}

/* 刷新按钮 */
.refresh-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.refresh-btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 新闻列表容器 */
.news-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem;
    background: #ffffff;
}

/* 自定义滚动条样式 */
.news-list::-webkit-scrollbar {
    width: 6px;
}

.news-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 新闻卡片 */
.news-card-title-only {
    background: white;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 0.8rem;
    transition: all 0.3s ease;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    border-left: 3px solid #3498db;
}

.news-card-title-only:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #f8f9fa;
}

.news-title-only {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    display: block;
    text-decoration: none;
    flex-grow: 1;
    transition: color 0.2s;
}

.news-title-only:hover {
    color: #3498db;
}

/* 热度排名显示 */
.news-rank {
    width: 20px;
    height: 20px;
    background: #bdc3c7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 前三名特殊颜色 */
.news-rank.rank-1 {
    background: #e74c3c;
}

.news-rank.rank-2 {
    background: #e67e22;
}

.news-rank.rank-3 {
    background: #f1c40f;
    color: #333;
}

.news-score {
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.8rem;
    margin-left: 8px;
    background: #fdf6f5;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
    color: #7f8c8d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(127, 140, 141, 0.3);
    border-top: 3px solid #7f8c8d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.error {
    background: #fdf6f5;
    color: #c0392b;
    padding: 0.8rem;
    border-radius: 2px;
    text-align: center;
    margin: 0.8rem 0;
    font-size: 0.9rem;
    border-left: 3px solid #e74c3c;
}

/* 平台信息底部 */
.platform-footer {
    padding: 0.5rem 0.8rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 2rem;
    background: #ffffff;
}

/* 深色主题 */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        background: #1a1a1a;
        color: #eee;
    }

    body:not(.light-mode) .news-container {
        background-color: #2c2c2c;
        border: 1px solid #444;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    body:not(.light-mode) .news-list {
        background: #2c2c2c;
    }

    body:not(.light-mode) .news-card-title-only {
        background: #363636;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border-left: 3px solid #3498db;
    }

    body:not(.light-mode) .news-card-title-only:hover {
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        background: #3f3f3f;
    }

    body:not(.light-mode) .news-title-only {
        color: #eee;
    }

    body:not(.light-mode) .news-title-only:hover {
        color: #6ab0f3;
    }

    body:not(.light-mode) .news-list::-webkit-scrollbar-track {
        background: #3a3a3a;
    }

    body:not(.light-mode) .platform-footer {
        background: #3a3a3a;
        border-top: 1px solid #444;
        color: #aaa;
    }

    body:not(.light-mode) .error {
        background: #2d1e1e;
        color: #f39c9c;
        border-left: 3px solid #e74c3c;
    }

    body:not(.light-mode) footer {
        background: #2c2c2c;
        color: #aaa;
        border-top: 1px solid #444;
    }

    body:not(.light-mode) .theme-toggle {
        background: rgba(255, 255, 255, 0.1);
    }

    body:not(.light-mode) .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    body:not(.light-mode) .refresh-btn {
        background: rgba(255, 255, 255, 0.1);
    }

    body:not(.light-mode) .refresh-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    body:not(.light-mode) .refresh-btn-small {
        background: rgba(255, 255, 255, 0.1);
    }

    body:not(.light-mode) .refresh-btn-small:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

body.dark-mode {
    background: #1a1a1a;
    color: #eee;
}

body.dark-mode .news-container {
    background-color: #2c2c2c;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

body.dark-mode .news-list {
    background: #2c2c2c;
}

body.dark-mode .news-card-title-only {
    background: #363636;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid #3498db;
}

body.dark-mode .news-card-title-only:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    background: #3f3f3f;
}

body.dark-mode .news-title-only {
    color: #eee;
}

body.dark-mode .news-title-only:hover {
    color: #6ab0f3;
}

body.dark-mode .news-list::-webkit-scrollbar-track {
    background: #3a3a3a;
}

body.dark-mode .platform-footer {
    background: #3a3a3a;
    border-top: 1px solid #444;
    color: #aaa;
}

body.dark-mode .error {
    background: #2d1e1e;
    color: #f39c9c;
    border-left: 3px solid #e74c3c;
}

body.dark-mode footer {
    background: #2c2c2c;
    color: #aaa;
    border-top: 1px solid #444;
}

body.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .refresh-btn {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .refresh-btn-small {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .refresh-btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .platforms-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .platforms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-container {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .platforms-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .news-container {
        height: 400px;
    }
}