/* ============================================================
   news_common.css · 新闻模块公共样式
   （index / category_list / tags_list / search / topic_detail 共享）
   ============================================================ */

/* 基础 Reset & 全局 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: linear-gradient(180deg, #fffdf5 0%, #fef4eb 100%); background-attachment: fixed; color: #333; font-size: 16px; line-height: 1.7; padding-top: 64px; }
a { color: #333; text-decoration: none; transition: color 0.2s; }
a:hover { color: #ff4000; }
img { max-width: 100%; height: auto; display: block; }

/* 顶部导航 */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: linear-gradient(90deg, #ff4000 0%, #ff6b00 100%); height: 64px; display: flex; align-items: center; justify-content: center; padding: 0 20px; box-shadow: 0 2px 10px rgba(255, 64, 0, 0.2); }
.header-inner { width: 100%; max-width: 1200px; display: flex; align-items: center; justify-content: space-between; }
.header .logo { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: 1px; flex-shrink: 0; text-shadow: 1px 1px 2px rgba(0,0,0,0.1); }
.header .logo span { color: #ffeb3b; }
.header .nav-links { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.header .nav-links a { padding: 6px 14px; border-radius: 4px; white-space: nowrap; color: #fff; font-weight: 500; }
.header .nav-links a:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.header .nav-links a.active { color: #ffeb3b; font-weight: 700; }
.header .nav-links .btn-publish { background: #ffeb3b; color: #d32f2f !important; padding: 6px 20px; border-radius: 20px; font-weight: 700; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.header .nav-links .btn-publish:hover { background: #fff59d; }
.header .nav-links .btn-login { border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 20px; }
.header .nav-links .btn-register { background: #fff; color: #ff4000 !important; border-radius: 20px; font-weight: 600; }

/* 分类导航条 */
.category-bar { background: #fff; border-bottom: 1px solid #ffe0cc; padding: 12px 20px; box-shadow: 0 2px 4px rgba(255, 100, 0, 0.03); }
.category-bar-inner { max-width: 1200px; margin: 0 auto; display: block; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-bar-inner::-webkit-scrollbar { display: none; }
.category-bar a { display: inline-block; padding: 5px 18px; margin-right: 6px; font-size: 14px; color: #666; border-radius: 16px; background: #fdf6f0; transition: all 0.2s; font-weight: 500; }
.category-bar a:hover { background: #ffe6d9; color: #ff4000; text-decoration: none; }
.category-bar a.active { background: linear-gradient(90deg, #ff4000, #ff6b00); color: #fff; box-shadow: 0 2px 6px rgba(255, 64, 0, 0.3); }

/* 主布局（左右两列） */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 20px; display: flex; gap: 24px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }

/* 列表卡片 & 列表项 */
.topic-list { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(255, 100, 0, 0.05); }
.topic-item { padding: 20px; border-bottom: 1px dashed #f0e6df; transition: all 0.2s; cursor: pointer; }
.topic-item:last-child { border-bottom: none; }
.topic-item:hover { background: #fffaf5; transform: translateX(4px); }
.topic-item .topic-title { font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; color: #222; }
.topic-item .topic-title a { color: #222; }
.topic-item .topic-title a:hover { color: #ff4000; }
.topic-item .topic-excerpt-wrap { overflow: hidden; }
.topic-item .topic-thumb { float: left; width: 150px; height: 100px; border-radius: 8px; overflow: hidden; background: #f0f0f0; margin-right: 16px; }
.topic-item .topic-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.topic-item:hover .topic-thumb img { transform: scale(1.05); }
.topic-item .topic-thumb .no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #ffe6d9; color: #ff8a65; font-size: 36px; }
.topic-item .topic-excerpt { font-size: 14px; color: #666; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.topic-item .clearfix { clear: both; }
.topic-item .topic-meta { margin-top: 12px; font-size: 13px; color: #999; display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }
.topic-item .topic-meta .author { color: #ff4000; font-weight: 600; background: #fff0e6; padding: 2px 10px; border-radius: 12px; }
.topic-item .topic-meta .tag { background: #fff3e0; color: #f57c00; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }

/* 侧边栏卡片 */
.sidebar-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(255, 100, 0, 0.04); }
.sidebar-card .card-title { font-size: 16px; font-weight: 700; color: #333; padding-bottom: 12px; border-bottom: 2px solid #ffe0cc; margin-bottom: 15px; position: relative; }
.sidebar-card .card-title::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: #ff4000; }
.sidebar-card .side-item { padding: 10px 0; border-bottom: 1px dashed #f0f0f0; font-size: 14px; line-height: 1.5; }
.sidebar-card .side-item:last-child { border-bottom: none; }
.sidebar-card .side-item a { color: #444; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all 0.2s; }
.sidebar-card .side-item a:hover { color: #ff4000; transform: translateX(4px); }
.sidebar-card .side-item .side-meta { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 30px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 14px; color: #555; background: #fff; border: 1px solid #ffe0cc; min-width: 34px; text-align: center; transition: all 0.2s; }
.pagination a:hover { background: #fff3e0; color: #ff4000; border-color: #ff4000; }
.pagination .current { background: #ff4000; color: #fff; border-color: #ff4000; box-shadow: 0 2px 6px rgba(255, 64, 0, 0.3); }
.pagination .disabled { color: #ccc; pointer-events: none; border-color: #eee; }

/* 空状态 */
.empty-state { text-align: center; padding: 80px 20px; color: #999; }
.empty-state .icon { font-size: 60px; margin-bottom: 16px; opacity: 0.8; }
.empty-state h3 { font-size: 22px; color: #444; margin-bottom: 8px; }

/* 底部 */
.footer { text-align: center; padding: 30px 20px; color: #6e1010; font-size: 13px; background: #fff; margin-top: 30px; border-top: 4px solid #ffe0cc; }
.footer a { color: #0a227c; }
.footer a:hover { color: #ff4000; }
.footer .footer-links { margin-top: 8px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

/* 响应式公共部分 */
@media (max-width: 992px) {
    .container { flex-direction: column; }
    .side-col { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .side-col .sidebar-card { flex: 1; min-width: 250px; }
}

@media (max-width: 768px) {
    body { padding-top: 56px; }
    .header { height: 56px; padding: 0 12px; }
    .header .logo { font-size: 18px; }
    .header .nav-links { font-size: 13px; gap: 6px; }
    .header .nav-links a { padding: 4px 10px; }
    
    .category-bar { padding: 10px; }
    .category-bar a { font-size: 13px; padding: 4px 14px; }

    .container { padding: 12px; gap: 16px; }
    .side-col { display: none; }
    
    .topic-item { padding: 16px; }
    .topic-item .topic-title { font-size: 16px; }
    .topic-item .topic-thumb { width: 110px; height: 74px; margin-right: 12px; }
    .topic-item .topic-excerpt { font-size: 13px; -webkit-line-clamp: 2; }
    .pagination { gap: 4px; }
    .pagination a, .pagination span { padding: 4px 10px; font-size: 13px; min-width: 28px; }
}

@media (max-width: 480px) {
    .header .logo { font-size: 16px; }
    .header .nav-links .btn-publish, 
    .header .nav-links .btn-login, 
    .header .nav-links .btn-register { padding: 3px 8px; font-size: 12px; }
    .topic-item .topic-thumb { width: 80px; height: 56px; margin-right: 10px; }
    .topic-item .topic-title { font-size: 15px; }
    .topic-item .topic-meta { font-size: 11px; gap: 8px; }
}