/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1a1a2e;
}

/* ===== 顶部导航 ===== */
.navbar-top {
    background: #ffffff;
    border-bottom: 1px solid #e8ecf1;
    padding: 12px 0;
}

.navbar-top .logo {
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-top .logo .logo-icon {
    font-size: 1.2rem;
}

.navbar-top .logo img {
    height: 32px;
    width: auto;
    max-height: 40px;
    object-fit: contain;
}

.navbar-top .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-top .nav-right a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
}

.navbar-top .nav-right a:hover {
    color: #4a6cf7;
}

/* ===== 会员标签 ===== */
.vip-tag {
    background: #d4edda;
    color: #155724;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.svip-tag {
    background: #e9d8fd;
    color: #6d28d9;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

/* ===== 金币显示 ===== */
.coins-display {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== 按钮 ===== */
.btn-publish {
    background: #4a6cf7;
    color: #fff !important;
    padding: 4px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.2s;
    border: none;
}

.btn-publish:hover {
    background: #3b5de7;
    color: #fff !important;
}

.btn-recharge {
    background: #f59e0b;
    color: #fff !important;
    padding: 4px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.2s;
}

.btn-recharge:hover {
    background: #d97706;
    color: #fff !important;
}

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

/* ===== 侧边栏 ===== */
.sidebar-right {
    width: 340px;
    flex-shrink: 0;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 20px;
    border: 1px solid #eef2f6;
}

.sidebar-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 14px;
}

.sidebar-card .card-title i {
    margin-right: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #475569;
    font-size: 0.95rem;
}

.stat-item .num {
    font-weight: 600;
    color: #1e293b;
}

/* ===== 搜索框（一体式圆角搜索条） ===== */
.search-bar {
    display: flex;
    align-items: center;
    background: #f6f8fb;
    border: 1px solid #e8ecf1;
    border-radius: 40px;
    padding: 4px 6px 4px 14px;
    transition: 0.2s;
}
.search-bar:focus-within { border-color: #4a6cf7; background: #fff; box-shadow: 0 0 0 3px rgba(74,108,247,.1); }
.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: .85rem;
    color: #1f2937;
    padding: 6px 0;
}
.search-bar input::placeholder { color: #94a3b8; }
.search-bar button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #4a6cf7;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
}
.search-bar button:hover { background: #3b5bdb; }
.search-hot-wrap { margin-top: 12px; }
.search-hot-label { font-size: .75rem; color: #64748b; font-weight: 500; display: block; margin-bottom: 8px; }
.search-hot-label i { margin-right: 2px; }
.search-hot-card .hot-keywords-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 4px 0;
}

.search-hot-card .keyword-tag {
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 2px 0;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.search-hot-card .keyword-tag:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.search-hot-card .keyword-tag .keyword-count {
    font-size: 0.6rem;
    background: #f1f4f9;
    color: #94a3b8;
    padding: 0 6px;
    border-radius: 10px;
    font-weight: 400;
}

.search-hot-card .keyword-tag:nth-child(1) {
    font-size: 1.1rem;
    font-weight: 700;
}

.search-hot-card .keyword-tag:nth-child(2) {
    font-size: 1.05rem;
    font-weight: 600;
}

.search-hot-card .keyword-tag:nth-child(3) {
    font-size: 1rem;
    font-weight: 600;
}

/* ===== 热门文章 ===== */
.hot-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 22px;
    border: 1px solid #eef2f6;
    margin-bottom: 20px;
}

.hot-card .hot-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a2e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-card .hot-title i {
    color: #f59e0b;
}

.hot-card .hot-item {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

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

.hot-card .hot-item a {
    color: #334155;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-card .hot-item a:hover {
    color: #4a6cf7;
}

.hot-card .hot-item .rank {
    font-weight: 600;
    color: #94a3b8;
    min-width: 24px;
    font-size: 0.8rem;
}

.hot-card .hot-item .rank.top1 {
    color: #f59e0b;
}

.hot-card .hot-item .rank.top2 {
    color: #94a3b8;
}

.hot-card .hot-item .rank.top3 {
    color: #cd7f32;
}

.hot-card .hot-item .hot-views {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: auto;
}

/* ===== 广告 ===== */
.ad-placeholder {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid #eef2f6;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.ad-placeholder a {
    display: block;
    margin-bottom: 10px;
}

.ad-placeholder a:last-child {
    margin-bottom: 0;
}

.ad-placeholder img {
    max-width: 100%;
    border-radius: 8px;
}

/* ===== 底部关注 ===== */
.follow-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.follow-section .follow-title {
    font-weight: 600;
    color: #1a1a2e;
}

.follow-section .follow-title i {
    color: #4a6cf7;
    margin-right: 6px;
}

.follow-section .follow-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.follow-section .follow-links a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.follow-section .follow-links a:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

.follow-section .follow-links a img {
    height: 18px;
    vertical-align: middle;
}

/* ===== 底部 ===== */
.footer-custom {
    background: #ffffff;
    border-top: 1px solid #e8ecf1;
    padding: 16px 0;
    margin-top: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* ===== 分页 ===== */
.pagination-custom .page-link {
    color: #4a6cf7;
    border: none;
    padding: 6px 14px;
    margin: 0 4px;
    border-radius: 30px;
    background: transparent;
}

.pagination-custom .page-item.active .page-link {
    background: #4a6cf7;
    color: #fff;
    border-radius: 30px;
}

.pagination-custom .page-item .page-link:hover {
    background: #eef2ff;
}

/* ===== 空状态 ===== */
.empty-state {
    background: #ffffff;
    border-radius: 16px;
    padding: 60px 20px;
    border: 1px solid #eef2f6;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: #d0d7de;
    display: block;
    margin-bottom: 16px;
}

.empty-state p {
    color: #94a3b8;
    font-size: 1rem;
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
        padding: 12px 16px;
        /* 列布局下必须拉伸子元素到整行宽；
           否则继承桌面版的 align-items:flex-start 会让内容列缩到自身内容宽度、靠左留白（移动端"往左边靠"） */
        align-items: stretch;
    }

    .sidebar-right {
        width: 100%;
    }

    .follow-section {
        flex-direction: column;
        text-align: center;
    }

    .follow-section .follow-links {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .sidebar-card {
        padding: 14px 16px;
    }

    .hot-card {
        padding: 14px 16px;
    }

    .follow-section {
        padding: 14px 16px;
    }

    .follow-section .follow-links a {
        font-size: 0.78rem;
        padding: 3px 12px;
    }

    .search-hot-card .keyword-tag {
        font-size: 0.75rem;
    }

    .search-hot-card .keyword-tag:nth-child(1) {
        font-size: 0.9rem;
    }

    .search-hot-card .keyword-tag:nth-child(2) {
        font-size: 0.85rem;
    }

    .search-hot-card .keyword-tag:nth-child(3) {
        font-size: 0.8rem;
    }

    .search-bar input {
        font-size: 0.8rem;
        padding: 4px 0;
    }

    .search-bar button {
        width: 28px;
        height: 28px;
    }
}
/* ============================================================ */
/* ===== 移动端底部导航（补充） ===== */
/* ============================================================ */

/* 移动端组件基础规则：默认隐藏。原本仅存在于 mobile.css，
   若 mobile.css 加载失败/缺失会导致移动导航以未样式化状态显示、与桌面导航重叠，
   故在 common.css 兜底，保证页面在任一 CSS 缺失时仍能优雅降级。 */
.mobile-bottom-nav,
.mobile-header,
.mobile-category-nav {
    display: none;
}

/* 桌面端隐藏移动导航 */
@media (min-width: 993px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    .mobile-header {
        display: none !important;
    }
    .mobile-category-nav {
        display: none !important;
    }
    .mobile-only {
        display: none !important;
    }
    .desktop-only {
        display: block;
    }
}

/* 移动端顶部导航栏（替代桌面版） */
.mobile-header .vip-tag-mobile,
.mobile-header .svip-tag-mobile {
    font-size: 0.55rem;
    padding: 1px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.mobile-header .vip-tag-mobile {
    background: #d4edda;
    color: #155724;
}
.mobile-header .svip-tag-mobile {
    background: #e9d8fd;
    color: #6d28d9;
}

.mobile-header .coins-display-mobile {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.75rem;
}