/* ===== 个人资源博客 · 精致主题 ===== */
:root {
    --primary: #4a6cf7;
    --primary-dark: #3451d0;
    --primary-light: #eef2ff;
    --accent: #ff7a45;
    --gold: #e6a817;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #2b3445;
    --text-light: #7a8699;
    --border: #e6e9ef;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(20,30,60,0.06);
    --shadow-hover: 0 8px 28px rgba(20,30,60,0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    padding-top: 64px;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--primary); transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ===== 顶部导航 ===== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: linear-gradient(90deg, #4a6cf7 0%, #6a5cf5 100%);
    box-shadow: 0 2px 12px rgba(74,108,247,.25);
    height: 64px;
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; gap: 28px;
}
.site-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: #fff;
}
.site-logo img {
    height: 36px; width: 36px; border-radius: 8px; object-fit: cover;
    background: rgba(255,255,255,.2); padding: 2px;
}
.site-nav { display: flex; gap: 2px; flex: 1; }
.site-nav a {
    padding: 8px 18px; border-radius: 8px;
    font-size: 15px; color: rgba(255,255,255,.85); font-weight: 500;
    transition: all .2s;
}
.site-nav a:hover, .site-nav a.active {
    background: rgba(255,255,255,.18); color: #fff;
}
.header-user { display: flex; align-items: center; gap: 12px; }
.header-user .user-score {
    font-size: 13px; color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.15); padding: 4px 12px; border-radius: 20px;
}
.vip-badge {
    font-size: 12px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #ffd700, #ff9500);
    padding: 4px 12px; border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255,149,0,.4);
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
    background: rgba(255,255,255,.25); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255,255,255,.6); transition: all .2s;
}
.user-avatar:hover { border-color: #fff; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar .fallback-text { font-weight: 600; font-size: 14px; color: #fff; }

/* 按钮 */
.btn {
    display: inline-block; padding: 8px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 500; border: none; cursor: pointer;
    transition: all .2s; text-align: center; line-height: 1.4;
}
.btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 20px; }
.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-outline:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--primary-light); color: var(--primary-dark); }

/* 站内按钮（白底场景） */
.article-detail .btn-outline {
    background: #fff; color: var(--text); border: 1px solid var(--border);
}
.article-detail .btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.menu-toggle {
    display: none; background: rgba(255,255,255,.15); border: none;
    font-size: 20px; cursor: pointer; color: #fff;
    width: 38px; height: 38px; border-radius: 8px;
}

/* ===== 主体布局 ===== */
.blog-container {
    max-width: 1200px; margin: 0 auto; padding: 28px 24px;
    display: grid; grid-template-columns: 1fr 320px; gap: 28px;
}
.blog-main { min-width: 0; }
.blog-sidebar { min-width: 0; }

/* Hero */
.blog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 40px 36px; color: #fff; margin-bottom: 24px;
    position: relative; overflow: hidden;
}
.blog-hero::after {
    content: ''; position: absolute; right: -40px; top: -40px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.blog-hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 10px; position: relative; z-index: 1; }
.blog-hero .hero-desc { font-size: 15px; opacity: .92; position: relative; z-index: 1; }

/* ===== 文章卡片 ===== */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all .25s;
    border-left: 4px solid transparent;
    display: block;
}
.article-card:hover {
    box-shadow: var(--shadow-hover);
    border-left-color: var(--primary);
    transform: translateX(4px);
}
.article-title {
    font-size: 19px; font-weight: 600; color: var(--text);
    margin-bottom: 10px; line-height: 1.4;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    transition: color .2s;
}
.article-card:hover .article-title { color: var(--primary); }
.article-meta {
    font-size: 13px; color: var(--text-light);
    display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px;
}
.article-excerpt {
    font-size: 14px; color: var(--text-light);
    line-height: 1.75;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-more {
    margin-top: 14px; font-size: 13px; color: var(--primary); font-weight: 500;
}

/* 标签 */
.tag {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 9px; border-radius: 4px; vertical-align: middle; letter-spacing: .5px;
}
.tag-vip { background: linear-gradient(135deg, #ffd700, #ff9500); color: #fff; }
.tag-paid { background: #fff3e0; color: #e67e22; }

/* 空状态 */
.empty-state {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 70px 20px; text-align: center; color: var(--text-light);
    box-shadow: var(--shadow); font-size: 15px;
}

/* ===== 侧边栏 ===== */
.widget {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 22px 24px; margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 16px; font-weight: 600; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 2px solid var(--bg);
    color: var(--text); display: flex; align-items: center; gap: 8px;
}
.widget-text { font-size: 14px; color: var(--text-light); line-height: 1.75; }

.vip-widget {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: #fff;
}
.vip-widget .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,.35); margin-bottom: 10px; }
.vip-widget p { font-size: 14px; margin-bottom: 16px; opacity: .95; line-height: 1.6; }

/* 排行榜 */
.rank-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-no {
    width: 22px; height: 22px; line-height: 22px; text-align: center;
    border-radius: 50%; background: var(--primary-light); color: var(--primary);
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.rank-row:nth-child(2) .rank-no { background: linear-gradient(135deg,#ffd700,#ffaa00); color: #fff; }
.rank-row:nth-child(3) .rank-no { background: linear-gradient(135deg,#c0c0c0,#909090); color: #fff; }
.rank-row:nth-child(4) .rank-no { background: linear-gradient(135deg,#cd7f32,#a0522d); color: #fff; }
.rank-name { flex: 1; color: var(--text); font-weight: 500; }
.rank-score { font-size: 13px; color: var(--text-light); }
.rank-score.rank-vip { color: #d4a017; font-weight: 600; }

/* ===== 文章详情 ===== */
.article-container {
    max-width: 880px; margin: 28px auto; padding: 0 24px;
}
.article-detail {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 40px 44px; box-shadow: var(--shadow);
}
.article-detail-header h1 {
    font-size: 28px; font-weight: 700; line-height: 1.4;
    margin-bottom: 14px; color: var(--text);
}
.article-detail-header .article-meta {
    font-size: 13px; color: var(--text-light);
    display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px;
}
.article-badges { margin-bottom: 16px; display: flex; gap: 8px; }
.article-content {
    margin: 28px 0; font-size: 16px; line-height: 1.95;
    color: #333; word-break: break-word;
}
.article-content p { margin-bottom: 14px; }
.article-content img { border-radius: 8px; margin: 12px 0; }
.article-content blockquote {
    border-left: 4px solid var(--primary); background: var(--primary-light);
    padding: 12px 18px; margin: 14px 0; border-radius: 0 8px 8px 0;
    color: var(--text);
}
.article-content pre, .article-content code {
    background: #f4f6f9; padding: 2px 6px; border-radius: 4px;
    font-size: 14px;
}
.article-content pre { padding: 14px; overflow-x: auto; margin: 12px 0; }
.article-content h2, .article-content h3 { margin: 20px 0 10px; }
.article-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }

/* 未解锁提示 */
.need-vip-box {
    max-width: 520px; margin: 80px auto; text-align: center;
    background: var(--card-bg); padding: 56px 36px; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.need-vip-box h2 { margin-bottom: 12px; font-size: 22px; }
.need-vip-box p { color: var(--text-light); margin-bottom: 24px; }

/* ===== 分页 ===== */
.pagination {
    display: flex; gap: 6px; justify-content: center;
    margin-top: 30px; flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 15px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff;
    color: var(--text); font-size: 14px; transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--text); color: #fff; padding: 12px 24px; border-radius: 8px;
    font-size: 14px; z-index: 9999; opacity: 0; transition: opacity .3s;
    pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: #2ecc71; }
.toast.error { background: #e74c3c; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none;
    transition: all .2s; background: #fff; color: var(--text);
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}
.btn-submit {
    width: 100%; padding: 12px; background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-submit:hover { background: var(--primary-dark); }

/* ===== 页脚 ===== */
.site-footer {
    margin-top: 40px; padding: 28px 20px; text-align: center;
    color: var(--text-light); font-size: 13px;
    border-top: 1px solid var(--border); background: #fff;
}
.site-footer p { margin: 4px 0; }

/* ===== 兼容旧页面 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
.card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 26px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.badge-vip, .badge-paid { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; margin-right: 6px; }
.badge-vip { background: linear-gradient(135deg,#ffd700,#ff9500); color: #fff; }
.badge-paid { background: #fff3e0; color: #e67e22; }
.float-post-btn { display: none !important; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
    .blog-container { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 768px) {
    body { padding-top: 56px; }
    .site-header { height: 56px; }
    .header-inner { padding: 0 14px; gap: 10px; }
    .site-logo span { display: none; }
    .menu-toggle { display: block; margin-left: auto; order: 3; }
    .header-user { order: 2; }
    .site-nav {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: #fff; flex-direction: column; padding: 10px 16px;
        box-shadow: 0 6px 16px rgba(0,0,0,.1);
    }
    .site-nav a { color: var(--text-light); }
    .site-nav a:hover, .site-nav a.active { background: var(--primary-light); color: var(--primary); }
    .site-nav.open { display: flex; }
    .header-user .user-score { display: none; }
    .article-detail { padding: 24px 20px; }
    .article-detail-header h1 { font-size: 22px; }
    .blog-hero { padding: 26px 22px; }
    .blog-hero h1 { font-size: 21px; }
    .article-card { padding: 18px 20px; }
    .article-title { font-size: 17px; }
    .blog-container, .container { padding: 18px 14px; }
}
