/* ========================================
   全局样式文件
   修改这里的颜色、大小来调整网站外观
   ======================================== */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color, #f5f5f5);
    color: var(--text-color, #333);
    line-height: 1.6;
}

/* 颜色变量（从配置文件读取，这里写默认值） */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
}

/* ========== 导航栏 ========== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu a {
    margin: 0 1rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ========== 登录页面 ========== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box {
    margin: 2rem 0;
}

.login-box input {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

/* ========== 两列布局 ========== */
.two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* ========== 文章卡片 ========== */
.article-list {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.article-card {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.article-card:hover {
    background: #f8f9fa;
}

.article-card:last-child {
    border-bottom: none;
}

.article-thumbnail {
    width: 120px;
    height: 80px;
    margin-right: 1rem;
    border-radius: 5px;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info {
    flex: 1;
}

.article-info h3 {
    margin-bottom: 0.5rem;
}

.article-info h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.article-preview {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #999;
}

/* ========== 游戏卡片 ========== */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.game-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 8px;
}

.game-info {
    flex: 1;
}

.game-info h4 {
    margin-bottom: 0.3rem;
}

.game-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.btn-play {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.3rem 1rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* ========== 文章详情页 ========== */
.full-article {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.article-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.article-body {
    margin: 2rem 0;
    line-height: 1.8;
}

.article-body img {
    max-width: 100%;
    border-radius: 5px;
    margin: 1rem 0;
}

/* ========== 评论区 ========== */
.comments-section {
    margin-top: 2rem;
    background: white;
    border-radius: 10px;
    padding: 2rem;
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    border-radius: 50%;
}

/* ========== 投稿表单 ========== */
.submit-container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.required {
    color: red;
}

.field-hint {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* ========== 图片上传区域 ========== */
.upload-area {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.image-link-item {
    background: #f8f9fa;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 3px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-input {
    flex: 1;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.9rem;
}

/* ========== 侧边栏 ========== */
.sidebar-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ========== 页脚 ========== */
.footer {
    background: white;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #666;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }

    .article-card {
        flex-direction: column;
    }

    .article-thumbnail {
        width: 100%;
        height: 160px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
}