﻿/**
 * GameGuide 主题样式
 * 游戏攻略站 - 响应式布局
 */

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    color: #333;
    background: #f5f6fa;
}
a { color: #1677ff; text-decoration: none; }
a:hover { color: #4096ff; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 头部导航 ===== */
.site-header {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.site-header .container {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 24px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.logo:hover { color: #4fc3f7; }

.main-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.main-nav a {
    color: rgba(255,255,255,0.75);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }

.header-search { display: flex; gap: 0; }
.header-search input {
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px 0 0 6px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    width: 180px;
    outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.4); }
.header-search input:focus { background: rgba(255,255,255,0.15); border-color: #4fc3f7; }
.header-search button {
    padding: 8px 14px;
    background: #4fc3f7;
    color: #0f0c29;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.header-search button:hover { background: #81d4fa; }

.mobile-menu-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; }

/* ===== 主体布局 ===== */
.main-layout { display: flex; gap: 30px; margin-top: 24px; margin-bottom: 40px; }
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ===== 首页文章网格 ===== */
.page-title { font-size: 24px; margin-bottom: 24px; color: #1a1a2e; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.card-image img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card-body { padding: 18px; }
.card-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 12px; }
.card-category {
    background: #e6f7ff;
    color: #1677ff;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 500;
}
.card-date { color: #999; }
.card-title { font-size: 18px; margin-bottom: 8px; line-height: 1.4; }
.card-title a { color: #1a1a2e; }
.card-title a:hover { color: #1677ff; }
.card-excerpt { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    display: inline-block;
    padding: 2px 10px;
    background: #f0f2f5;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.2s;
}
.tag:hover { background: #1677ff; color: #fff; }

/* ===== 搜索列表样式 ===== */
.article-card-horizontal { display: block; padding: 0; margin-bottom: 12px; }
.article-card-horizontal .card-body { padding: 20px; }
.article-card-horizontal .card-title { font-size: 18px; }
.article-list .article-card { display: block; }

/* ===== 文章详情 ===== */
.post-detail { background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.post-header { margin-bottom: 28px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.post-meta-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.post-category { background: #e6f7ff; color: #1677ff; padding: 4px 12px; border-radius: 6px; font-weight: 500; }
.post-date { color: #999; }
.post-title { font-size: 28px; line-height: 1.4; color: #1a1a2e; margin-bottom: 12px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.post-content { font-size: 16px; line-height: 1.9; color: #333; }
.post-content h2 { font-size: 22px; margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 2px solid #eee; color: #1a1a2e; }
.post-content h3 { font-size: 18px; margin: 20px 0 10px; color: #333; }
.post-content p { margin-bottom: 16px; }
.post-content img { border-radius: 8px; margin: 12px 0; }
.post-content ul, .post-content ol { margin: 12px 0 12px 24px; }
.post-content li { margin-bottom: 6px; list-style: disc; }
.post-content blockquote {
    border-left: 4px solid #4fc3f7;
    padding: 12px 20px;
    margin: 16px 0;
    background: #f0f9ff;
    border-radius: 0 8px 8px 0;
    color: #555;
}

/* ===== 外链区块（仅爬虫可见） ===== */
.backlink-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.backlink-section ul { list-style: none; margin: 0; }
.link-item { padding: 4px 0; border-bottom: 1px dashed #f0f0f0; }
.link-item a { color: #1677ff; font-size: 14px; }

/* ===== 上一篇/下一篇 ===== */
.post-nav { display: flex; justify-content: space-between; margin-top: 32px; padding-top: 20px; border-top: 1px solid #eee; font-size: 14px; }
.post-nav a { color: #666; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-nav a:hover { color: #1677ff; }

/* ===== 相关文章 ===== */
.related-posts { margin-top: 32px; padding-top: 20px; border-top: 1px solid #eee; }
.related-posts h3 { font-size: 18px; margin-bottom: 16px; color: #1a1a2e; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.related-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #f8f9fa; border-radius: 8px; transition: background 0.2s; }
.related-item:hover { background: #e6f7ff; }
.related-title { font-size: 14px; color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-date { color: #999; font-size: 12px; margin-left: 12px; }

/* ===== 侧边栏 ===== */
.sidebar { position: sticky; top: 84px; align-self: flex-start; }
.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sidebar-widget h3 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #4fc3f7; color: #1a1a2e; }
.category-list li { margin-bottom: 1px; }
.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}
.category-list a:hover { background: #f0f9ff; color: #1677ff; }
.category-list .count { background: #f0f2f5; padding: 2px 10px; border-radius: 10px; font-size: 12px; color: #999; }
.latest-posts li { border-bottom: 1px solid #f5f5f5; }
.latest-posts a { display: block; padding: 8px 0; font-size: 13px; color: #555; }
.latest-posts a:hover { color: #1677ff; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.page-btn { padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; color: #333; transition: all 0.2s; }
.page-btn:hover { border-color: #1677ff; color: #1677ff; }
.page-btn.active { background: #1677ff; color: #fff; border-color: #1677ff; }
.page-btn.disabled { color: #ccc; cursor: default; }

/* ===== 页脚 ===== */
.site-footer {
    background: #1a1a2e;
    color: #999;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
}
.footer-links { margin-bottom: 12px; display: flex; gap: 20px; justify-content: center; }
.footer-links a { color: #999; }
.footer-links a:hover { color: #fff; }
.copyright { color: #666; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 40px 0; color: #999; }
.empty-state p { font-size: 16px; }
.search-info { color: #999; margin-bottom: 16px; font-size: 14px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .article-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: #1a1a2e; padding: 10px; z-index: 99; }
    .header-search { display: none; }
    .mobile-menu-toggle { display: block; }
    .post-detail { padding: 20px; }
    .post-title { font-size: 22px; }
    .post-nav { flex-direction: column; gap: 10px; }
    .post-nav a { max-width: 100%; }
    .related-grid { grid-template-columns: 1fr; }
    .site-header .container { gap: 12px; }
}
