/* 我的世界服务器论坛 - 现代化 UI 设计 */

/* 基础重置和变量定义 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 颜色系统 */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* 中性色 */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 背景色 */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    --bg-hover: #f8fafc;
    
    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* 过渡动画 */
    --transition: all 0.15s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    width: 100%;
}

/* 导航栏 */
.navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo:hover {
    color: var(--primary-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-links a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-8);
    padding: var(--space-8) 0;
    flex: 1;
}

/* 侧边栏 */
.sidebar {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: var(--space-6);
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: var(--space-1);
}

.category-list a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.875rem;
}

.category-list a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.category-list a.active {
    background: var(--primary);
    color: white;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: var(--space-2);
}

.search-box input {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.search-box button {
    padding: var(--space-2) var(--space-3);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* 内容区域 */
.content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
}

.posts-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
}

/* 帖子列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.post-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: var(--transition);
    cursor: pointer;
}

.post-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
    gap: var(--space-3);
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.post-category {
    background: var(--primary);
    color: white;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-surface);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-500);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

.btn-block {
    width: 100%;
}

/* 消息提示 */
.message {
    padding: var(--space-3);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
}

.message.success {
    background: rgb(16 185 129 / 0.1);
    color: var(--success);
    border: 1px solid rgb(16 185 129 / 0.2);
}

.message.error {
    background: rgb(239 68 68 / 0.1);
    color: var(--danger);
    border: 1px solid rgb(239 68 68 / 0.2);
}

/* 认证页面 */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: var(--space-8) 0;
}

.auth-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: var(--space-6);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 个人中心 */
.profile-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    margin: var(--space-8) auto;
    max-width: 1000px;
    width: 100%;
}

.profile-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.profile-content {
    display: grid;
    gap: var(--space-6);
}

.profile-info,
.profile-posts,
.profile-replies {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-6);
}

.profile-info h2,
.profile-posts h2,
.profile-replies h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

/* 统计信息 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
}

.stat-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-1);
}

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

/* 发帖页面 */
.create-post-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    margin: var(--space-8) auto;
    max-width: 800px;
    width: 100%;
}

.create-post-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.form-actions .btn {
    flex: 1;
}

/* 帖子详情 */
.post-detail {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    margin: var(--space-8) auto;
    max-width: 1000px;
    width: 100%;
}

.post-detail .post-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.post-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: var(--space-6) 0;
}

.replies-section {
    margin-top: var(--space-8);
}

.replies-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.reply-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.reply-author {
    font-weight: 600;
    color: var(--text-primary);
}

.reply-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.reply-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: var(--gray-800);
    color: white;
    text-align: center;
    padding: var(--space-6) 0;
    margin-top: auto;
}

.footer p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 无内容提示 */
.no-posts {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-8);
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .content {
        order: 1;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .profile-container,
    .create-post-container,
    .post-detail {
        margin: var(--space-4);
        padding: var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .post-category {
        align-self: flex-start;
    }
    
    .post-meta {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .auth-box {
        padding: var(--space-4);
    }
}