/**
 * Moban Theme - 现代化潮流卡片风格
 * Version: 3.0.0
 */

/* ==================== CSS 变量 ==================== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================== 基础重置 ==================== */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 导航栏 - 玻璃拟态 ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.08);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* ==================== 卡片 - 现代风格 ==================== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-4px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 渐变卡片 */
.card-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.card-gradient .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* 玻璃拟态卡片 */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ==================== 帖子卡片 ==================== */
.thread-card {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.thread-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.2);
}

.thread-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 3px solid white;
    box-shadow: var(--shadow);
    transition: var(--transition-bounce);
}

.thread-card:hover .thread-avatar {
    transform: scale(1.1) rotate(5deg);
}

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

.thread-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

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

.thread-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.thread-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.thread-stats {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: var(--surface-hover);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-badge.hot {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

/* ==================== 标签 ==================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tag-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.tag-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.tag-hot {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.tag-top {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

/* ==================== 按钮 - 现代风格 ==================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-gradient:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* ==================== 统计卡片 - 大数字 ==================== */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== 侧边栏卡片 ==================== */
.sidebar-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sidebar-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-body {
    padding: 1rem 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--surface-hover);
    border-left-color: var(--primary);
    padding-left: 1.75rem;
}

/* ==================== 排行榜 ==================== */
.rank-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    transition: var(--transition);
}

.rank-item:hover {
    background: var(--surface-hover);
}

.rank-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 1rem;
    background: var(--surface-hover);
    color: var(--text-secondary);
}

.rank-number.top-1 {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    color: #92400e;
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.4);
}

.rank-number.top-2 {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #4b5563;
    box-shadow: 0 4px 8px rgba(156, 163, 175, 0.4);
}

.rank-number.top-3 {
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
    color: #9a3412;
    box-shadow: 0 4px 8px rgba(251, 146, 60, 0.4);
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-weight: 600;
    color: var(--text);
}

.rank-score {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==================== 公告 - 现代风格 ==================== */
.announcement {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.announcement-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.announcement-content {
    flex: 1;
}

/* ==================== 分页 - 现代风格 ==================== */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ==================== 表单 - 现代风格 ==================== */
.form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: var(--transition);
}

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

/* ==================== 用户头像组 ==================== */
.avatar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
}

.avatar-group .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
    cursor: pointer;
}

.avatar-group .avatar:hover {
    transform: scale(1.15) translateY(-4px);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

/* ==================== 返回顶部 - 悬浮按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.moban-animate {
    animation: fadeInUp 0.6s ease-out;
}

.moban-animate-delay-1 { animation-delay: 0.1s; }
.moban-animate-delay-2 { animation-delay: 0.2s; }
.moban-animate-delay-3 { animation-delay: 0.3s; }

/* ==================== 暗黑模式 ==================== */
body.dark-mode {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.dark-mode .navbar {
    background: rgba(30, 41, 59, 0.8) !important;
    border-bottom-color: rgba(51, 65, 85, 0.6);
}

body.dark-mode .card {
    background: var(--surface);
}

body.dark-mode .thread-card {
    background: var(--surface);
}

body.dark-mode .stat-card::before {
    background: linear-gradient(90deg, var(--primary-light), var(--secondary));
}

/* ==================== 文本颜色工具类 ==================== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-purple { color: #8b5cf6 !important; }

/* ==================== 主导航栏优化 ==================== */
.navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 991px) {
    .thread-stats {
        display: none;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    :root {
        --radius: 12px;
    }
    
    .thread-card {
        padding: 1rem;
    }
    
    .thread-avatar {
        width: 40px;
        height: 40px;
    }
}
