:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #fff;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* 顶部整合导航栏 */
.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.top-bar .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.top-bar .logo img {
    height: 28px;
    width: auto;
}

/* 横向分类导航 */
.cat-nav {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.cat-nav::-webkit-scrollbar { display: none; }

.cat-nav .cat-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    font-weight: 500;
    flex-shrink: 0;
    padding: 4px 0;
}

.cat-nav .cat-item:hover { color: var(--primary-color); }

.cat-nav .cat-item.is-active {
    color: var(--primary-color);
    font-weight: 700;
}

/* 搜索框（紧凑） */
.search-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 180px;
}

.search-mini input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 0;
}

.search-mini input::placeholder { color: var(--text-muted); }

/* 主容器 */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.content-left {
    flex: 1;
    min-width: 0;
    background: #fff;
}

.content-right {
    flex-shrink: 0;
    width: 280px;
}

/* Top10 阅读榜卡片 */
.top10-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.top10-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.top10-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.top10-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.top10-list {
    display: flex;
    flex-direction: column;
}

.top10-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

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

.top10-item:hover {
    background: var(--bg-light);
}

.top10-item .top-rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
}

.top10-item.rank-1 .top-rank { background: linear-gradient(135deg, #f43f5e, #dc2626); }
.top10-item.rank-2 .top-rank { background: linear-gradient(135deg, #fb923c, #ea580c); }
.top10-item.rank-3 .top-rank { background: linear-gradient(135deg, #fbbf24, #d97706); }

.top10-item .top-title {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top10-item:hover .top-title {
    color: var(--primary-color);
}

.top10-loading,
.top10-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* 文章列表（简洁列表式） */
.article-list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 0 18px;
}

/* 单篇文章（列表项） */
.article-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

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

.article-item:hover {
    background: var(--bg-light);
    margin: 0 -12px;
    padding: 18px 12px;
    border-radius: 8px;
}

.article-item .item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-item .item-title .top-tag {
    display: inline-block;
    padding: 1px 6px;
    background: #fef3c7;
    color: #d97706;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.article-item:hover .item-title {
    color: var(--primary-color);
}

.article-item .item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.article-item .item-meta .meta-author {
    font-size: 12px;
    color: var(--text-secondary);
}

.article-item .item-meta .meta-divider {
    color: var(--border-color);
}

.article-item .item-meta .meta-views {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 0.95rem;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.pagination .page-current {
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 900px) {
    .main-container { flex-direction: column; }
    .content-right { width: 100%; }
    .top10-card { position: static; }
}

@media (max-width: 767.98px) {
    .top-bar { padding: 0 12px; gap: 12px; }
    .cat-nav { gap: 14px; }
    .cat-nav .cat-item { font-size: 0.82rem; }
    .search-mini { width: 140px; }
    .main-container { padding: 12px; }
    .article-item .item-title { font-size: 0.98rem; }
}