/* =====================================================
   博客默认模板样式
   内容区宽度：1500px，高端大气清爽风格
   ===================================================== */

/* 基础重置 */
*, *::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', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #333;
    background: #f5f7fa;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: #4a90d9; text-decoration: none; transition: color 0.2s; }
a:hover { color: #2b6cb0; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* 容器 - 1500px */
.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =====================================================
   顶部导航栏
   ===================================================== */
.site-header {
    background: #fff;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 999;
}
.header-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-text { background: linear-gradient(135deg, #4a90d9, #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* 主导航 */
.main-nav ul { display: flex; gap: 8px; }
.main-nav a {
    padding: 8px 16px;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.95rem;
}
.main-nav a:hover, .main-nav a.active { background: #ebf4ff; color: #4a90d9; }

/* 头部操作区 */
.header-actions { display: flex; align-items: center; gap: 12px; }

/* 搜索框 */
.search-form { display: flex; align-items: center; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.search-form input {
    border: none; background: transparent; padding: 6px 12px; font-size: 0.9rem;
    width: 160px; outline: none;
}
.search-form button {
    border: none; background: #4a90d9; color: #fff; padding: 6px 14px;
    cursor: pointer; font-size: 0.9rem;
}
.search-form button:hover { background: #3a7bc8; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-name {
    padding: 6px 14px; background: #f0f4ff; border-radius: 20px;
    color: #4a90d9; font-weight: 500; cursor: pointer;
}
.user-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-radius: 8px; padding: 8px 0; min-width: 140px; margin-top: 8px;
}
.user-menu:hover .user-dropdown { display: block; }
.user-dropdown a { display: block; padding: 8px 16px; color: #4a5568; font-size: 0.9rem; }
.user-dropdown a:hover { background: #f7fafc; color: #4a90d9; }

/* 登录/注册按钮 */
.btn-login, .btn-register {
    padding: 6px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
}
.btn-login { color: #4a90d9; }
.btn-register { background: #4a90d9; color: #fff; }
.btn-register:hover { background: #3a7bc8; color: #fff; }

.btn-admin {
    padding: 6px 14px; background: #f6ad55; color: #fff;
    border-radius: 8px; font-size: 0.85rem; font-weight: 500;
}
.btn-admin:hover { background: #ed8936; color: #fff; }

/* =====================================================
   主内容区
   ===================================================== */
.site-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    min-height: calc(100vh - 64px - 200px);
}

/* =====================================================
   首页横幅
   ===================================================== */
.hero-section {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 60px 48px;
    text-align: center;
    color: #fff;
    margin-bottom: 12px;
}
.hero-content h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.hero-desc { font-size: 1.15rem; opacity: 0.9; margin-bottom: 24px; }
.btn-contribute {
    display: inline-block; padding: 12px 36px; background: #fff; color: #6366f1;
    border-radius: 30px; font-weight: 700; font-size: 1.05rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.btn-contribute:hover { color: #4f46e5; transform: translateY(-2px); }

/* =====================================================
   文章列表 - 网格
   ===================================================== */
.articles-section { min-width: 0; }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }

.article-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.article-cover img { width: 100%; height: 200px; object-fit: cover; }

.article-info { padding: 20px; }
.article-title { font-size: 1.15rem; font-weight: 700; line-height: 1.5; margin-bottom: 10px; }
.article-title a { color: #1a202c; }
.article-title a:hover { color: #4a90d9; }
.badge-top, .badge-rec {
    display: inline-block; font-size: 0.75rem; padding: 2px 8px;
    border-radius: 4px; margin-right: 6px; vertical-align: middle;
}
.badge-top { background: #fef3c7; color: #d97706; }
.badge-rec { background: #d1fae5; color: #059669; }

.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: #a0aec0; margin-bottom: 10px; }
.article-summary { color: #718096; font-size: 0.95rem; line-height: 1.6; margin-bottom: 12px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.8rem; color: #4a90d9; background: #ebf4ff; padding: 2px 10px; border-radius: 12px; }

/* 文章列表（分类页） */
.articles-list { display: flex; flex-direction: column; gap: 20px; }
.article-list-item {
    display: flex; gap: 20px; background: #fff; border-radius: 14px;
    padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.article-list-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.list-cover { flex-shrink: 0; width: 200px; }
.list-cover img { width: 200px; height: 140px; object-fit: cover; border-radius: 10px; }
.list-info { flex: 1; }
.list-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.list-title a { color: #1a202c; }
.list-summary { color: #718096; font-size: 0.95rem; line-height: 1.6; }

/* =====================================================
   分页
   ===================================================== */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin-top: 36px; padding: 20px 0;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 14px;
    border-radius: 8px; font-size: 0.95rem;
}
.pagination a { background: #fff; color: #4a5568; border: 1px solid #e2e8f0; }
.pagination a:hover { background: #ebf4ff; color: #4a90d9; border-color: #4a90d9; }
.pagination .current { background: #4a90d9; color: #fff; font-weight: 600; }
.pagination span:not(.current) { color: #cbd5e0; }

/* =====================================================
   侧边栏
   ===================================================== */
.sidebar { min-width: 0; }
.widget { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.widget-title {
    font-size: 1.1rem; font-weight: 700; color: #1a202c;
    padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid #ebf4ff;
}
.widget-list li { margin-bottom: 10px; }
.widget-list a { display: flex; justify-content: space-between; color: #4a5568; font-size: 0.95rem; padding: 6px 0; }
.widget-list a:hover { color: #4a90d9; }
.cat-count, .view-count { color: #a0aec0; font-size: 0.85rem; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { font-size: 0.85rem; color: #4a90d9; background: #ebf4ff; padding: 4px 12px; border-radius: 14px; }
.tag-item:hover { background: #4a90d9; color: #fff; }

/* =====================================================
   文章详情页
   ===================================================== */
.article-detail {
    background: #fff; border-radius: 14px; padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05); margin-bottom: 20px;
}
.article-header { margin-bottom: 28px; border-bottom: 1px solid #f0f0f0; padding-bottom: 20px; }
.article-detail .article-title { font-size: 2rem; font-weight: 800; color: #1a202c; line-height: 1.4; margin-bottom: 14px; }
.article-detail .article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.9rem; color: #a0aec0; }
.article-detail .article-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.article-cover-full { margin-bottom: 28px; border-radius: 12px; overflow: hidden; }
.article-cover-full img { width: 100%; max-height: 420px; object-fit: cover; }
.article-body { font-size: 1.1rem; line-height: 1.9; color: #2d3748; }
.article-body p { margin-bottom: 1.2em; }
.article-body h2 { font-size: 1.5rem; margin: 1.5em 0 0.8em; padding-bottom: 8px; border-bottom: 2px solid #ebf4ff; }
.article-body h3 { font-size: 1.25rem; margin: 1.2em 0 0.6em; }
.article-body pre {
    background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 10px;
    overflow-x: auto; margin: 1.2em 0; font-size: 0.95rem; line-height: 1.6;
}
.article-body code { background: #f7fafc; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #e53e3e; }
.article-body pre code { background: transparent; color: inherit; padding: 0; }
.article-body blockquote {
    border-left: 4px solid #4a90d9; background: #f7fafc; padding: 12px 20px;
    margin: 1.2em 0; border-radius: 0 8px 8px 0; color: #4a5568;
}
.article-body img { border-radius: 8px; margin: 1em 0; }

.article-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.article-actions { display: flex; gap: 12px; }
.btn-like, .btn-share {
    padding: 8px 20px; border: 1px solid #e2e8f0; border-radius: 20px;
    background: #fff; cursor: pointer; font-size: 0.95rem; color: #4a5568;
    transition: all 0.2s;
}
.btn-like:hover, .btn-share:hover { border-color: #4a90d9; color: #4a90d9; }

/* =====================================================
   相关推荐
   ===================================================== */
.related-articles { margin-bottom: 20px; }
.section-title {
    font-size: 1.2rem; font-weight: 700; color: #1a202c;
    margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #ebf4ff;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.related-item {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.2s;
}
.related-item:hover { transform: translateY(-3px); }
.related-item img { width: 100%; height: 130px; object-fit: cover; }
.related-item h4 { padding: 10px 12px; font-size: 0.95rem; font-weight: 600; color: #1a202c; line-height: 1.4; }
.rel-views { padding: 0 12px 10px; font-size: 0.8rem; color: #a0aec0; }

/* =====================================================
   评论区
   ===================================================== */
.comments-section { background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.comment-form { margin-bottom: 24px; }
.comment-fields { display: flex; gap: 12px; margin-bottom: 12px; }
.comment-fields input {
    flex: 1; padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.95rem; outline: none;
}
.comment-fields input:focus { border-color: #4a90d9; }
.comment-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #e2e8f0;
    border-radius: 10px; font-size: 0.95rem; outline: none; resize: vertical;
    font-family: inherit;
}
.comment-form textarea:focus { border-color: #4a90d9; }
.comment-form button {
    margin-top: 10px; padding: 8px 24px; background: #4a90d9; color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.comment-form button:hover { background: #3a7bc8; }

.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f7fafc; }
.comment-avatar {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9, #6366f1); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.comment-nickname { font-weight: 600; color: #2d3748; font-size: 0.95rem; }
.comment-time { font-size: 0.8rem; color: #a0aec0; margin-left: 10px; }
.comment-content { margin-top: 6px; color: #4a5568; font-size: 0.95rem; line-height: 1.6; }

/* =====================================================
   分类页
   ===================================================== */
.category-section {}
.category-header { text-align: center; padding: 30px 0; margin-bottom: 20px; }
.category-title { font-size: 2rem; font-weight: 800; color: #1a202c; }
.category-desc { color: #718096; margin-top: 8px; font-size: 1.05rem; }
.category-count { color: #a0aec0; margin-top: 8px; font-size: 0.95rem; }

/* =====================================================
   搜索页
   ===================================================== */
.search-section { background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.search-header { margin-bottom: 24px; }
.search-keyword { color: #4a90d9; font-weight: 700; }

/* =====================================================
   登录/注册/会员中心/投稿 - 通用认证样式
   ===================================================== */
.auth-section, .member-section, .contribute-section {
    max-width: 600px; margin: 30px auto; background: #fff;
    border-radius: 14px; padding: 36px; box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.auth-title, .content-title { font-size: 1.6rem; font-weight: 800; color: #1a202c; margin-bottom: 24px; text-align: center; }
.auth-error { background: #fed7d7; color: #c53030; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; }
.auth-form .form-group, .contribute-form .form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; color: #2d3748; margin-bottom: 6px; font-size: 0.95rem; }
.required { color: #e53e3e; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.95rem; outline: none; font-family: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #4a90d9; }
.form-group select { background: #fff; cursor: pointer; }
.form-group textarea { min-height: 200px; resize: vertical; }
.btn-submit {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #4a90d9, #6366f1);
    color: #fff; border: none; border-radius: 10px; font-size: 1.05rem;
    font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.9; }
.btn-reset { padding: 10px 20px; background: #e2e8f0; color: #4a5568; border: none; border-radius: 8px; cursor: pointer; margin-left: 10px; }
.auth-links { text-align: center; margin-top: 20px; color: #718096; font-size: 0.95rem; }
.auth-links a { color: #4a90d9; font-weight: 600; }

/* 会员中心 */
.member-section { display: grid; grid-template-columns: 240px 1fr; gap: 24px; max-width: 100%; }
.member-sidebar {
    text-align: center; padding: 24px; background: #f7fafc; border-radius: 14px;
    height: fit-content;
}
.member-avatar { margin-bottom: 14px; }
.member-avatar img { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto; }
.avatar-placeholder {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto;
    background: linear-gradient(135deg, #4a90d9, #6366f1); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800;
}
.member-name { font-size: 1.2rem; font-weight: 700; color: #1a202c; margin-bottom: 4px; }
.member-email { color: #a0aec0; font-size: 0.9rem; margin-bottom: 16px; }
.member-stats { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.member-stats li { font-size: 0.9rem; color: #718096; }
.member-stats strong { color: #1a202c; }
.member-nav { display: flex; flex-direction: column; gap: 8px; }
.member-nav a {
    padding: 8px; border-radius: 8px; color: #4a5568; font-size: 0.95rem;
}
.member-nav a:hover { background: #ebf4ff; color: #4a90d9; }
.btn-contribute { display: block; background: #4a90d9; color: #fff !important; text-align: center; font-weight: 600; }
.btn-contribute:hover { background: #3a7bc8; }

.member-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.member-table th { background: #f7fafc; padding: 10px 14px; text-align: left; color: #2d3748; font-weight: 600; }
.member-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; color: #4a5568; }
.status-draft { color: #e53e3e; background: #fed7d7; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; }
.status-published { color: #059669; background: #d1fae5; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; }
.status-pending { color: #d97706; background: #fef3c7; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; }

/* 投稿页 */
.contribute-tip { background: #ebf4ff; color: #2b6cb0; padding: 10px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.95rem; }
.alert-success { background: #d1fae5; color: #059669; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fed7d7; color: #c53030; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; }

/* =====================================================
   404页面
   ===================================================== */
.error-section { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-container { text-align: center; }
.error-code { font-size: 8rem; font-weight: 900; color: #e2e8f0; line-height: 1; }
.error-desc { font-size: 1.3rem; color: #718096; margin: 16px 0 24px; }
.btn-home { display: inline-block; padding: 10px 28px; background: #4a90d9; color: #fff; border-radius: 8px; font-weight: 600; }
.btn-home:hover { background: #3a7bc8; color: #fff; }

/* =====================================================
   底部
   ===================================================== */
.site-footer {
    background: #1a202c; color: #a0aec0; padding: 40px 0 20px;
    margin-top: 40px;
}
.site-footer .container { max-width: 1500px; margin: 0 auto; padding: 0 24px; }
.footer-links { margin-bottom: 24px; }
.footer-links h3 { color: #fff; font-size: 1.1rem; margin-bottom: 12px; }
.footer-links ul { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: #a0aec0; font-size: 0.95rem; }
.footer-links a:hover { color: #4a90d9; }
.footer-info { text-align: center; padding-top: 20px; border-top: 1px solid #2d3748; }
.footer-info p { margin-bottom: 6px; font-size: 0.9rem; }
.footer-stats { color: #718096; font-size: 0.85rem; }

/* 回到顶部 */
.back-to-top {
    display: none; position: fixed; bottom: 30px; right: 30px;
    width: 44px; height: 44px; background: #4a90d9; color: #fff;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(74,144,217,0.4); z-index: 99;
    display: flex; align-items: center; justify-content: center;
    border: none;
}
.back-to-top:hover { background: #3a7bc8; }

/* =====================================================
   空提示
   ===================================================== */
.empty-tip { text-align: center; padding: 60px 20px; color: #a0aec0; font-size: 1.1rem; }
.empty-tip a { color: #4a90d9; font-weight: 600; }

/* =====================================================
   响应式
   ===================================================== */
@media (max-width: 1024px) {
    .site-main { grid-template-columns: 1fr; }
    .sidebar { order: -1; }
    .member-section { grid-template-columns: 1fr; }
    .member-sidebar { display: flex; align-items: center; gap: 16px; text-align: left; }
}
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
    .main-nav { display: none; }
    .hero-section { padding: 30px 20px; }
    .hero-content h1 { font-size: 1.8rem; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-list-item { flex-direction: column; }
    .list-cover { width: 100%; }
    .list-cover img { width: 100%; height: 180px; }
    .article-detail { padding: 20px; }
    .article-detail .article-title { font-size: 1.5rem; }
}
