/* 全局变量 - 统一管理颜色和间距 */
:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --radius: 0px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

/* 顶部导航 */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 25px;
    color: var(--primary);
}
/* 🔥 置顶贴样式 */
.post-item.top-post {
    background: #f443360d !important;
    border-left: 2px solid #F44336;
    margin: 0 -5px;
    padding: 5px 5px;
}

.post-item.top-post:hover {
    background: #fef3c7 !important;
}

.top-tag {
    color: #d97706;
    font-weight: 600;
    /*font-size: 18px;*/
    margin-right: 2px;
}

/* 🔥 搜索高亮 */
.search-highlight {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}
.logo img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
}

.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-right a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.header-right a:hover {
    color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #a9cde947;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
    cursor: pointer;
}

.user-avatar:hover {
    border-color: var(--primary);
}

/* 手机版汉堡菜单按钮 */
.hamburger-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
}

/* 主容器 */
.container {
    max-width: 1280px;
    margin: 5px auto;
    display: grid;
    grid-template-columns: 190px 1fr 250px;
    gap: 1px;
    padding: 0 0px;
}

/* 左侧边栏 */
.sidebar-left {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    height: fit-content;
    position: sticky;
    top: 0px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    color: var(--text);
    text-decoration: none;
}
/* 🔥 返回置顶按钮样式（保持原按钮外观） */
.back-to-top {
  position: fixed;
    bottom: 20px;
    right: 20px;
    /* width: 120px; */
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #0808082e;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 999;
    display: none;
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
   background: #55575a;
    color: white;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 中间主内容区 */
.main-content {
    padding: 6px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    padding: 6px 5px;
    border-bottom: 1px solid var(--border);
    gap: 5px;
    overflow-x: auto;
    white-space: nowrap;
}

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

.tab-nav span {
   border: 1px solid var(--border);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
    padding: 5px 8px;
}

.tab-nav span:hover {
    background: var(--bg);
    color: var(--text);
}

.tab-nav span.active {
   background: #f5f6f7;
    color: #161515;
}

.post-list {
    padding: 0 5px;
}

.post-item {
    display: flex;
    gap: 7px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.post-item:last-child {
    /*border-bottom: none;*/
}

.post-item:hover {
    background: var(--bg);
    margin: 0 -5px;
    padding: 5px 5px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 20%; /* 你的修改：圆角20% */
    object-fit: cover;
    flex-shrink: 0;
    background: #a9cde947;
    border: 1px solid var(--border);
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 14px; /* 你的修改：字体14px */
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px; /* 你的修改：间距2px */
    margin-bottom: 2px;
    transition: color 0.2s;
}

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

/* 帖子标签样式 */
.post-tag {
    font-size: 12px;
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
}

.post-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 2px; /* 你的修改：间距2px */
    flex-wrap: wrap;
}

.post-meta .username {
    color: var(--primary);
    font-weight: 500;
}

.post-stats {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination .disabled {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    cursor: not-allowed;
}

/* 右侧边栏 */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.widget {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-title a {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: normal;
}

/* 用户卡片 */
.user-card {
    text-align: center;
}

.user-card .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    object-fit: cover;
    background: #a9cde947;
    border: 1px solid var(--border);
}

.user-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* 勋章样式 */
.badge-icon {
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: none !important;
}

.badge-iconn {
    width: 11px;
    height: 11px;
    border-radius: 0;
    background: none !important;
}

.user-card .level {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.user-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.user-stats .stat {
    text-align: center;
}

.user-stats .num {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.user-stats .label {
    font-size: 12px;
    color: var(--text-light);
}

.btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #000000;
    color: #ffffff;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: #4CAF50;
}

/* 公告 */
.notice-item {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
}

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

.notice-item a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.notice-item a:hover {
    color: var(--primary);
}

/* 热帖 */
.hot-item {
    display: flex;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

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

.hot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 20%;
    object-fit: cover;
    flex-shrink: 0;
    background: #a9cde947;
    border: 1px solid var(--border);
}

.hot-content {
    flex: 1;
    min-width: 0;
}

.hot-title {
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    line-height: 1.4;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.hot-time {
    font-size: 11px;
    color: var(--text-light);
}

/* 友情链接样式 */
.links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.links-list a {
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.links-list a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* 统计 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--primary-light);
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-card .num {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-light);
}

/* 广告位 */
.ad-box {
    border: 2px dashed var(--border);
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.ad-box:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
    font-size: 14px;
}

/* 弹窗 */
.mask {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.pop {
    position: fixed;
    width: 400px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 99999;
    box-shadow: var(--shadow-lg);
}

.pop h4 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.pop input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pop input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.close-btn {
    text-align: right;
    margin-bottom: 16px;
}

.close-btn span {
    cursor: pointer;
    color: var(--text-light);
    font-size: 20px;
    transition: color 0.2s;
}

.close-btn span:hover {
    color: var(--danger);
}

.apply-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    font-weight: 500;
    transition: all 0.2s;
}

.apply-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* 用户中心弹窗 */
.user-center-pop {
    width: 320px;
    left: auto;
    right: 20px;
    top: 70px;
    transform: none;
}

.user-center-pop .user-info {
    text-align: center;
    margin-bottom: 20px;
}

.user-center-pop .user-info .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    background: none !important;
}

.user-center-pop .user-info h4 {
    font-size: 18px;
    margin-bottom: 4px;
    border: none;
    padding: 0;
}

.user-center-pop .user-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-center-pop .user-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.user-center-pop .user-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* 页脚 */
.footer {
    max-width: 1280px;
    margin: 40px auto 0;
    padding: 24px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* 手机版侧边抽屉导航 */
.mobile-drawer {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    background: var(--card);
    z-index: 10000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-drawer-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.mobile-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
}

.mobile-nav-list {
    padding: 16px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
    text-decoration: none;
}

.mobile-nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-nav-item.active {
    background: var(--primary);
    color: white;
}

.mobile-nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 手机版右侧边栏切换按钮 */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    right: 24px;
    bottom: 90px;
    width: 48px;
    height: 48px;
    background: #bebfc1;
    color: #fbfafa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    font-size: 20px;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        margin: 0px auto;
        padding: 0 0px;
    }
    
    .sidebar-left {
        display: none;
    }
    
    .sidebar-right {
        display: none;
        position: fixed;
        right: -320px;
        top: 60px;
        width: 300px;
        height: calc(100vh - 60px);
        background: var(--bg);
        z-index: 999;
        padding: 16px;
        overflow-y: auto;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
    }
    
    .sidebar-right.show {
        right: 0;
        display: flex;
    }
    
    .hamburger-btn {
        display: block;
    }
    
    .sidebar-toggle-btn {
        display: block;
    }
    
    .header-inner {
        padding: 12px 16px;
    }
    
    .search-box {
        margin: 0 20px;
    }
    
    .header-right {
        gap: 16px;
    }
    
    .tab-nav {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .post-list {
        padding: 0 0px;
    }
    
    .post-item:hover {
        margin: 0 -5px;
        padding: 5px 5px;
    }
    
    .user-center-pop {
        right: 10px;
        width: 280px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .search-box {
        order: 3;
        max-width: 100%;
        margin: 0;
    }
    
    .sidebar-right {
        width: 100%;
        right: -100%;
    }
    
    .apply-btn {
        right: 16px;
        bottom: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .sidebar-toggle-btn {
        right: 10px;
    bottom: 250px;
    width: 30px;
    height: 30px;
    font-size: 18px;
    }
}