/* ========== 秀山论坛 - 现代化设计系统 ========== */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f59e0b;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 导航栏 ===== */
#mainNav {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(79, 70, 229, 0.3);
    padding: 10px 0;
}

#mainNav .navbar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
}

.brand-icon {
    display: inline-block;
    margin-right: 4px;
    font-size: 1.5rem;
}

#mainNav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

#mainNav .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.12);
}

#mainNav .btn-post {
    background: rgba(255,255,255,0.2);
    margin-left: 4px;
}

#mainNav .btn-post:hover {
    background: rgba(255,255,255,0.3);
}

#mainNav .btn-register {
    background: var(--accent);
    color: #1e1b4b !important;
    font-weight: 700;
    border-radius: 8px;
    margin-left: 4px;
}

#mainNav .btn-register:hover {
    background: #fbbf24;
}

/* ===== 主容器 ===== */
.main-container {
    flex: 1;
    padding-bottom: 40px;
}

/* ===== 按钮 ===== */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    color: #fff;
}

/* ===== 帖子卡片 ===== */
.post-card-modern {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
    overflow: hidden;
}

.post-card-modern:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.post-card-body {
    padding: 18px 20px;
}

/* 互动数据侧边栏 */
.post-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 52px;
    padding-right: 16px;
    border-right: 1px solid var(--border);
}

.stat-item {
    padding: 4px 0;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-hot .stat-value {
    color: var(--accent);
    font-size: 0.9rem;
}

/* 帖子内容 */
.post-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
}

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

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

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.meta-sep {
    color: #cbd5e1;
}

/* ===== 标签 ===== */
.badge-top {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-cat {
    background: #eef2ff;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 4px;
}

/* ===== 分页 ===== */
.pagination-modern {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 4px;
}

.pagination-modern .page-link {
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-modern .page-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

.pagination-modern .active .page-link {
    background: var(--primary);
    color: #fff;
}

/* ===== 侧边栏 ===== */
.side-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.side-card-body {
    padding: 14px 18px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    font-weight: 500;
}

.side-link:hover {
    background: #f8fafc;
    color: var(--text);
}

.side-link.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 700;
    border-left: 3px solid var(--primary);
}

.side-link-icon {
    font-size: 1rem;
}

/* ===== 卡片（登录/注册/详情等） ===== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* ===== 表单 ===== */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ===== Alert ===== */
.modern-alert {
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 500;
}

/* ===== 按钮 ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 20px;
}

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

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

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

/* ===== 页脚 ===== */
.footer-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 18px 0;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ===== 帖子详情 ===== */
.post-content {
    line-height: 1.9;
    font-size: 1.02rem;
}

.like-btn {
    border-radius: 20px;
    padding: 6px 18px;
    font-weight: 500;
    transition: all 0.2s;
}

.like-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .post-stats {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 8px;
        margin-bottom: 8px;
        min-width: auto;
        gap: 16px;
    }

    .post-card-body .d-flex.gap-3 {
        flex-direction: column;
    }

    #mainNav .navbar-brand {
        font-size: 1.15rem;
    }
}

/* ===== 个人中心 ===== */
.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    margin: 0 auto 12px;
}
