/* ==================== 论坛全局样式 ==================== */
:root {
    --sidebar-width: 260px;
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --accent: #e94560;
    --accent-dark: #d63050;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #2d3748;
    --text-light: #718096;
    --text-lighter: #a0aec0;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
    --max-width: 1200px;
    --min-width: 1200px;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== 布局框架 - 居中限制宽度 ==================== */
.forum-layout {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.forum-container {
    display: flex;
    width: 100%;
    max-width: var(--max-width);
    min-width: var(--min-width);
    margin: 0 auto;
    position: relative;
}

/* ==================== 左侧边栏 ==================== */
.forum-sidebar-left {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* 品牌区 */
.forum-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.brand-info h1 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.brand-info p {
    font-size: 11px;
    color: var(--text-light);
    margin: 2px 0 0;
}

/* 用户区域 - 未登录 */
.forum-user-section.guest {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.guest-actions {
    display: flex;
    gap: 10px;
}

.guest-actions a {
    flex: 1;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-login {
    background: var(--primary);
    color: white;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.btn-register {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-register:hover {
    background: var(--border);
}

/* 用户区域 - 已登录 */
.forum-user-section.logged-in {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.user-logged-in {
    cursor: pointer;
    position: relative;
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-default-large {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 700;
}

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

.user-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

/* 用户下拉菜单 */
.user-menu-dropdown {
    display: none;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 6px;
    margin-top: 12px;
}

.user-logged-in.expanded .user-menu-dropdown {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.15s;
}

.user-menu-dropdown a:hover {
    background: var(--card-bg);
    color: var(--primary);
}

.user-menu-dropdown a.logout {
    color: var(--accent);
    margin-top: 4px;
}

.user-menu-dropdown i {
    width: 18px;
    text-align: center;
    color: var(--text-light);
}

/* 统计卡片 */
.forum-stats-card {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    color: var(--text-lighter);
    text-transform: uppercase;
    margin-top: 4px;
    display: block;
    font-weight: 600;
}

/* 导航菜单 */
.forum-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-lighter);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 8px 12px;
}

.forum-nav ul {
    list-style: none;
}

.forum-nav li {
    margin-bottom: 2px;
}

.forum-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all 0.15s;
    position: relative;
}

.forum-nav li a:hover {
    background: var(--bg);
    color: var(--text);
}

.forum-nav li.active a {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(233,69,96,0.05) 100%);
    color: var(--primary);
    font-weight: 600;
}

.forum-nav li a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.forum-nav .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.category-nav .count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-lighter);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* ==================== 主内容区 ==================== */
.forum-main {
    flex: 1;
    padding: 20px;
    min-height: 100vh;
    max-width: calc(1200px - 260px);
}

/* ==================== 移动端适配 ==================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.mobile-overlay.show {
    display: block;
}

/* ==================== 悬浮发布按钮 ==================== */
.fab-publish {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.35);
    transition: all 0.3s;
    z-index: 999;
}

.fab-publish:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(233, 69, 96, 0.45);
}

/* ==================== 手机端底部悬浮导航栏 ==================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-list {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 11px;
    height: 100%;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

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

/* ==================== 移动端媒体查询 (max-width: 1200px) ==================== */
@media (max-width: 1200px) {
    .forum-container {
        min-width: auto;
        max-width: 100%;
    }
    
    .forum-sidebar-left {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    
    .forum-sidebar-left.open {
        transform: translateX(0);
    }
    
    .forum-main {
        margin-left: 0;
        padding: 70px 16px 80px;
        max-width: 100%;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 手机端隐藏文章上方的发布按钮 */
    .filter-bar .btn-primary {
        display: none !important;
    }
    
    /* 手机端筛选标签栏调整 */
    .filter-bar {
        flex-direction: column;
        padding: 12px 14px;
    }
    
    .filter-tabs {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-tabs a {
        flex: 1;
        justify-content: center;
    }
    
    /* 手机端显示底部导航 */
    .mobile-bottom-nav {
        display: block;
    }
    
    /* 手机端调整悬浮发布按钮位置，避免被底部导航遮挡 */
    .fab-publish {
        bottom: 80px !important;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 18px;
        z-index: 1001;
    }
}

@media (max-width: 640px) {
    .forum-main {
        padding: 65px 12px 80px;
    }
    
    .fab-publish {
        bottom: 75px !important;
    }
    
    .mobile-bottom-nav {
        height: 55px;
    }
    
    .mobile-bottom-nav .nav-item {
        font-size: 10px;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 18px;
    }
}

/* ==================== 通用组件 ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(233, 69, 96, 0.3);
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 18px;
}

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

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}

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

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-light);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

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

.pagination .current {
    background: var(--primary);
    color: white;
    font-weight: 700;
}
@media (max-width: 1200px) {
    /* 手机端顶部优化 */
    .mobile-menu-toggle {
        top: 8px;
        left: 12px;
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
        color: white;
        border-radius: 8px;
    }
    
    /* 添加顶部品牌栏 */
    .forum-main::before {
        content: "百家乐社区";
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 52px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        font-size: 16px;
        font-weight: 700;
        line-height: 52px;
        text-align: center;
        z-index: 98;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* 调整主内容区padding，给顶部品牌栏留空间 */
    .forum-main {
        padding: 60px 16px 80px;
    }
}
/* ==================== 手机端顶部优化 ==================== */
@media (max-width: 1200px) {
    /* 隐藏原来的顶部菜单按钮 */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* 顶部品牌栏 - 下方两个角圆角 */
    .forum-main::before {
        content: "百家乐社区";
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 52px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        font-size: 16px;
        font-weight: 700;
        line-height: 52px;
        text-align: center;
        z-index: 98;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        /* 下方两个角圆角：左上0 右上0 右下12px 左下12px */
        border-radius: 0 0 12px 12px;
    }
    
    /* 调整主内容区padding */
    .forum-main {
        padding: 60px 16px 80px;
    }
}

@media (max-width: 640px) {
    .forum-main {
        padding: 55px 12px 80px;
    }
    
    /* 小屏幕圆角稍微小一点 */
    .forum-main::before {
        border-radius: 0 0 10px 10px;
    }
}

/* ==================== 手机端侧边栏优化 ==================== */
@media (max-width: 1200px) {
    /* 手机端侧边栏全屏显示 */
    .forum-sidebar-left {
        width: 280px;
        max-width: 85vw;
        z-index: 1002;
        background: var(--card-bg);
    }
    
    /* 侧边栏打开时遮罩层 */
    .mobile-overlay {
        z-index: 1001;
    }
    
    /* 手机端侧边栏内的品牌区调整 - 更紧凑 */
    .forum-sidebar-left .forum-brand {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .forum-sidebar-left .brand-link {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .forum-sidebar-left .brand-logo {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 8px;
    }
    
    .forum-sidebar-left .brand-info h1 {
        font-size: 14px;
        margin: 0;
    }
    
    .forum-sidebar-left .brand-info p {
        font-size: 10px;
        margin: 2px 0 0;
    }
    
    /* 手机端侧边栏用户区域调整 - 更紧凑 */
    .forum-sidebar-left .forum-user-section.logged-in {
        padding: 12px 16px;
    }
    
    .forum-sidebar-left .forum-user-section.guest {
        padding: 12px 16px;
    }
    
    .forum-sidebar-left .user-avatar-large {
        width: 48px;
        height: 48px;
        margin: 0 auto 8px;
    }
    
    .forum-sidebar-left .avatar-default-large {
        font-size: 20px;
    }
    
    .forum-sidebar-left .user-info {
        margin-bottom: 8px;
    }
    
    .forum-sidebar-left .user-name {
        font-size: 14px;
    }
    
    .forum-sidebar-left .user-role {
        font-size: 11px;
    }
    
    /* 手机端侧边栏导航调整 */
    .forum-sidebar-left .forum-nav {
        padding: 8px;
    }
    
    .forum-sidebar-left .nav-section {
        margin-bottom: 12px;
    }
    
    .forum-sidebar-left .nav-section h3 {
        font-size: 10px;
        margin: 0 0 6px 8px;
    }
    
    .forum-sidebar-left .forum-nav li {
        margin-bottom: 1px;
    }
    
    .forum-sidebar-left .forum-nav li a {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    /* 统计卡片调整 */
    .forum-sidebar-left .forum-stats-card {
        padding: 12px 16px;
    }
    
    .forum-sidebar-left .stat-number {
        font-size: 16px;
    }
    
    .forum-sidebar-left .stat-label {
        font-size: 9px;
    }
}

@media (max-width: 640px) {
    .forum-sidebar-left {
        width: 260px;
    }
}