:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-card-dark: #1e293b;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans SC', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-light);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover { color: var(--primary); background: rgba(99,102,241,0.08); }
.nav-admin { color: var(--primary); font-weight: 500; }

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 20px;
    padding: 2px 4px 2px 16px;
    border: 1px solid var(--border);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 140px;
    padding: 6px 0;
    color: var(--text);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

/* 主内容 */
.main-content {
    margin-top: 64px;
    min-height: calc(100vh - 200px);
}

/* Flash 消息 */
.flash {
    padding: 12px 20px;
    margin: 0 auto;
    max-width: 1200px;
    margin-top: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, var(--primary), #7c3aed, var(--accent));
    padding: 80px 0;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero h1 { font-size: 42px; font-weight: 700; margin-bottom: 16px; position: relative; }
.hero p { font-size: 18px; opacity: 0.9; max-width: 600px; margin: 0 auto; position: relative; }

/* 分区标题 */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 文章列表 */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding: 40px 0 80px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    gap: 20px;
}

.post-card:hover { transform: translateX(4px); box-shadow: var(--shadow-lg); }

.post-card .post-cover {
    width: 200px;
    min-height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.post-card .post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card .post-body { flex: 1; }

.post-card .post-category {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.12));
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99,102,241,0.15);
}

.post-card .post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    transition: var(--transition);
}

.post-card .post-title:hover { color: var(--primary); }

.post-card .post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-card .post-meta span { display: flex; align-items: center; gap: 4px; }

/* 侧边栏 */
.sidebar { position: sticky; top: 84px; }

.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text-light); font-size: 14px; }
.category-list a:hover { color: var(--primary); }
.category-list .count { background: var(--bg); padding: 2px 8px; border-radius: 10px; font-size: 12px; color: var(--text-muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-cloud .tag {
    padding: 4px 12px;
    background: var(--bg);
    color: var(--text-light);
    font-size: 13px;
    border-radius: 20px;
    transition: var(--transition);
}

.tag-cloud .tag:hover { background: var(--primary); color: #fff; }

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

.popular-list li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.popular-list li:last-child { border-bottom: none; }

.popular-list .rank {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popular-list a { font-size: 14px; color: var(--text-light); }
.popular-list a:hover { color: var(--primary); }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 文章详情 */
.post-detail { padding: 40px 0 80px; max-width: 900px; margin: 0 auto; }

.post-detail .post-header {
    margin-bottom: 30px;
}

.post-detail .post-header h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.post-detail .post-header .meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.post-detail .post-header .meta span { display: flex; align-items: center; gap: 4px; }

.post-detail .post-header .cover {
    margin-top: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 480px;
}

.post-detail .post-header .cover img { width: 100%; height: 100%; object-fit: cover; }

/* 文章布局 - 目录在侧边 */
.post-layout {
    position: relative;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
}

.post-content h2 { font-size: 24px; font-weight: 700; margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.post-content h3 { font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
.post-content p { margin-bottom: 16px; }

.post-content pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.post-content code {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.post-content pre code { background: none; color: inherit; padding: 0; }

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    background: rgba(99,102,241,0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-light);
}

.post-content ul, .post-content ol { margin: 16px 0; padding-left: 24px; }
.post-content li { margin-bottom: 8px; }

.post-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.post-content a { color: var(--primary); border-bottom: 1px solid transparent; }
.post-content a:hover { border-bottom-color: var(--primary); }

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-content th, .post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th { background: var(--bg); font-weight: 600; }

/* 标签列表 */
.post-tags { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

.post-tags .tag {
    padding: 4px 14px;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    font-size: 13px;
    border-radius: 20px;
    transition: var(--transition);
}

.post-tags .tag:hover { background: var(--primary); color: #fff; }

/* 点赞按钮 */
.like-section {
    text-align: center;
    margin: 40px 0;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.like-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }

/* 上下篇 */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 20px;
}

.post-nav a {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text-light);
    transition: var(--transition);
}

.post-nav a:hover { color: var(--primary); transform: translateY(-2px); }
.post-nav .label { font-size: 12px; color: var(--text-muted); }

/* 评论区 */
.comments-section { margin-top: 60px; }

.comments-section h3 { font-size: 20px; margin-bottom: 24px; }

.comment-form {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.comment-form .form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg);
}

.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.comment-form textarea { min-height: 100px; resize: vertical; }

.comment-form .submit-btn {
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form .submit-btn:hover { background: var(--primary-dark); }

.comment-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.comment-item .comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-item .nickname { font-weight: 600; font-size: 14px; }
.comment-item .time { font-size: 12px; color: var(--text-muted); }
.comment-item .content { font-size: 14px; line-height: 1.7; color: var(--text-light); }

.comment-reply { margin-left: 52px; }

/* 相关文章 */
.related-posts { margin-top: 60px; }
.related-posts h3 { font-size: 20px; margin-bottom: 24px; }

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.related-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.related-card .card-img { height: 140px; background: linear-gradient(135deg, var(--primary), var(--accent)); overflow: hidden; }
.related-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.related-card .card-body { padding: 16px; }
.related-card .card-title { font-size: 15px; font-weight: 600; color: var(--text); }

/* 归档页 */
.archive-section { padding: 40px 0 80px; }

.archive-year { font-size: 28px; font-weight: 700; margin: 40px 0 20px; color: var(--primary); }

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

.archive-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.archive-list .date { font-size: 14px; color: var(--text-muted); min-width: 80px; }
.archive-list a { font-size: 15px; color: var(--text); }
.archive-list a:hover { color: var(--primary); }

/* 友链页 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 0 80px;
}

.link-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    gap: 16px;
    align-items: center;
}

.link-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.link-card .link-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.link-card .link-info h4 { font-size: 16px; margin-bottom: 4px; }
.link-card .link-info p { font-size: 13px; color: var(--text-muted); }

/* 页面内容 */
.page-content { padding: 40px 0 80px; }

.page-content .page-body {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* 页脚 */
.footer {
    background: var(--bg-dark);
    color: #94a3b8;
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.footer-desc { font-size: 14px; line-height: 1.8; }

.footer-links h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer-links a { display: block; color: #94a3b8; font-size: 14px; padding: 4px 0; }
.footer-links a:hover { color: var(--primary-light); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-4px); }

/* 登录/注册页 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 14px; }

.auth-card .form-group { margin-bottom: 20px; }
.auth-card .form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }

.auth-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

.auth-card .btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.auth-card .btn:hover { background: var(--primary-dark); }

.auth-card .links { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-card .links a { color: var(--primary); }

/* 响应式 */
@media (max-width: 768px) {
    .nav-links { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
    .nav-links.active { display: flex; }
    .menu-toggle { display: block; }
    .search-form { width: 100%; margin-top: 8px; }
    .search-input { width: 100%; }
    .hero h1 { font-size: 28px; }
    .content-layout { grid-template-columns: 1fr; }
    .post-card { flex-direction: column; }
    .post-card .post-cover { width: 100%; min-height: 180px; }
    .post-detail .post-header h1 { font-size: 24px; }
    .footer-content { grid-template-columns: 1fr; gap: 30px; }
    .comment-form .form-row { flex-direction: column; }
    .post-nav { flex-direction: column; }
}

/* ========== 深色模式 ========== */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.3);
}

[data-theme="dark"] .navbar { background: rgba(15,23,42,0.95); }
[data-theme="dark"] .search-form { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .search-input { color: #e2e8f0; }
[data-theme="dark"] .hero { background: linear-gradient(135deg, #1e293b, #0f172a); }
[data-theme="dark"] .footer { background: #020617; }
[data-theme="dark"] pre { background: #0f172a; }
[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .auth-card input { background: #1e293b; border-color: #334155; color: #e2e8f0; }

/* 主题切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

/* ========== 轮播图 ========== */
.banner-section {
    margin-bottom: 20px;
}

/* 站点简介 */
.site-intro {
    text-align: center;
    padding: 30px 0 10px;
    margin-bottom: 20px;
}

.site-intro-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

.site-intro-desc {
    font-size: 16px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.banner-slider {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.banner-slide.active { opacity: 1; }

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 40px 50px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.banner-overlay h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.banner-overlay p { font-size: 16px; opacity: 0.9; margin-bottom: 12px; }

.banner-link {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.banner-link:hover { background: rgba(255,255,255,0.3); color: #fff; }

.banner-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #fff;
}

/* ========== 公告滚动 ========== */
.announcement-bar {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
}

.announcement-content {
    display: inline-block;
    animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========== 文章目录 ========== */
.post-sidebar {
    position: absolute;
    right: -280px;
    top: 0;
    width: 240px;
}

.toc {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.toc-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.toc a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-light);
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 0.2s;
}

.toc a:hover,
.toc a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

.toc a.toc-h3 { padding-left: 24px; font-size: 12px; }

/* 移动端目录 */
.toc-mobile { display: none; }

@media (max-width: 1200px) {
    .post-sidebar { display: none; }
    .post-content { max-width: 100%; }
}

@media (max-width: 768px) {
    .toc-mobile {
        display: block;
        margin-bottom: 20px;
        padding: 16px;
        background: var(--bg-card);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
}

/* ========== 代码高亮 ========== */
pre code.hljs {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.hljs-keyword { color: #c084fc; }
.hljs-string { color: #86efac; }
.hljs-comment { color: #64748b; }
.hljs-function { color: #60a5fa; }
.hljs-number { color: #fbbf24; }

/* ========== 分享按钮 ========== */
.share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.9; }
.share-btn-wechat { background: #07c160; }
.share-btn-qq { background: #12b7f5; }
.share-btn-weibo { background: #e6162d; }
.share-btn-copy { background: var(--text-muted); }

/* ========== 用户中心菜单 ========== */
.user-menu-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.user-menu-tab {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}

.user-menu-tab:hover { color: var(--text); }
.user-menu-tab.active { background: var(--bg-card); color: var(--primary); font-weight: 500; box-shadow: var(--shadow); }

/* ========== 标题锚点 ========== */
.post-content h2[id],
.post-content h3[id] {
    cursor: pointer;
    position: relative;
}

.post-content h2[id]:hover::before,
.post-content h3[id]:hover::before {
    content: '#';
    position: absolute;
    left: -20px;
    color: var(--primary);
}

/* ========== 维护模式 ========== */
.maintenance-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    text-align: center;
}

.maintenance-page h1 { font-size: 48px; margin-bottom: 16px; }
.maintenance-page p { font-size: 18px; opacity: 0.8; }

/* ========== 加载动画 ========== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .text { font-size: 16px; }

/* ========== 文章页操作栏 ========== */
.post-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    font-size: 13px;
    border-radius: 20px;
    margin-bottom: 12px;
    margin-right: 8px;
}

.post-badge-hot {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.post-meta-bar {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.post-author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.post-meta-detail {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.post-cover-img {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 480px;
}

.post-cover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文章底部操作栏 */
.post-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 16px;
}

.post-action-left {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.05);
}

.action-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.1);
}

.action-like:hover,
.action-like.active {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239,68,68,0.05);
}

.action-fav:hover,
.action-fav.active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245,158,11,0.05);
}

.post-action-right {
    display: flex;
    align-items: center;
}

.share-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-label {
    font-size: 13px;
    color: var(--text-muted);
}

.share-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-family: inherit;
}

.share-chip:hover { opacity: 0.85; transform: translateY(-1px); }
.share-wechat { background: #07c160; }
.share-qq { background: #12b7f5; }
.share-weibo { background: #e6162d; }
.share-copy { background: #64748b; }

/* 版权声明 */
.post-copyright {
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    border-left: 3px solid var(--primary);
}

.post-copyright p { margin-bottom: 4px; }
.post-copyright p:last-child { margin-bottom: 0; }

/* 上下篇 */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.post-nav-item {
    display: block;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    color: var(--text);
}

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

.post-nav-next { text-align: right; }

.post-nav-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.post-nav-title {
    font-size: 14px;
    font-weight: 500;
}

/* 相关推荐 */
.section-title-sm {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.related-section { margin-bottom: 30px; }

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.related-card-img {
    height: 120px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.related-card-img img { width: 100%; height: 100%; object-fit: cover; }

.related-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 32px;
    opacity: 0.5;
}

.related-card-body { padding: 12px; }
.related-card-title { font-size: 14px; font-weight: 500; color: var(--text); }

/* ========== 评论区美化 ========== */
.comment-form-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-input:focus { outline: none; border-color: var(--primary); }

.comment-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    transition: border-color 0.2s;
}

.comment-textarea:focus { outline: none; border-color: var(--primary); }

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.comment-hint { font-size: 12px; color: var(--text-muted); }

.comment-submit {
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.comment-submit:hover { background: var(--primary-dark); }

/* 评论列表 */
.comment-list { display: flex; flex-direction: column; gap: 16px; }

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-avatar-sm { width: 32px; height: 32px; }

.comment-body { flex: 1; min-width: 0; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-name { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.6; color: var(--text-light); }

.comment-actions { margin-top: 8px; }

.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: inherit;
}

.comment-action-btn:hover { background: var(--bg); color: var(--primary); }

.comment-replies {
    margin-top: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.comment-reply-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.comment-reply-item + .comment-reply-item {
    border-top: 1px solid var(--border);
}

/* ========== 个人资料页 ========== */
.profile-page { padding-bottom: 60px; }

.profile-banner {
    position: relative;
    margin-bottom: 24px;
}

.profile-banner-bg {
    height: 180px;
    background: linear-gradient(135deg, var(--primary), #7c3aed, var(--accent));
    border-radius: var(--radius);
}

.profile-info-card {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    padding: 0 24px;
    margin-top: -60px;
    position: relative;
    z-index: 1;
}

.profile-avatar-wrap { text-align: center; }

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    box-shadow: var(--shadow-lg);
}

.profile-username {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.profile-details {
    flex: 1;
    padding-bottom: 8px;
}

.profile-nickname {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    gap: 24px;
}

.profile-stat { text-align: center; }
.profile-stat-num { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-stat-label { font-size: 12px; color: var(--text-muted); }

/* 标签页 */
.profile-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.profile-tab {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}

.profile-tab:hover { color: var(--text); }
.profile-tab.active { background: var(--bg-card); color: var(--primary); font-weight: 500; box-shadow: var(--shadow); }

/* 资料表单布局 */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.avatar-upload-area {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 12px;
    gap: 4px;
}

.avatar-upload-area:hover .avatar-overlay { opacity: 1; }

.avatar-username { font-size: 14px; color: var(--text-muted); }
.avatar-join { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 用户中心表单样式 */
.profile-page .form-group { margin-bottom: 18px; }

.profile-page .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.profile-page .form-input,
.profile-page .form-select,
.profile-page .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
}

.profile-page .form-input:hover,
.profile-page .form-select:hover,
.profile-page .form-textarea:hover {
    border-color: var(--primary-light);
}

.profile-page .form-input:focus,
.profile-page .form-select:focus,
.profile-page .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: var(--bg-card);
}

.profile-page .form-input::placeholder {
    color: var(--text-muted);
}

.profile-page .form-input:disabled {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.profile-page .form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.profile-page .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.profile-page .card {
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid var(--border);
}

.profile-page .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.profile-page .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.profile-page .card-body {
    padding: 20px;
}

.profile-page .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    transition: all 0.2s;
}

.profile-page .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

@media (max-width: 768px) {
    .profile-info-card { flex-direction: column; align-items: center; text-align: center; margin-top: -40px; }
    .profile-details { display: flex; flex-direction: column; align-items: center; }
    .profile-grid { grid-template-columns: 1fr; }
    .post-action-bar { flex-direction: column; }
    .post-nav { grid-template-columns: 1fr; }
    .comment-form-row { grid-template-columns: 1fr; }
    .profile-page .form-row { grid-template-columns: 1fr; }
    
    /* 轮播图手机端 */
    .banner-slider { height: 200px; border-radius: 12px; }
    .banner-overlay { padding: 16px; }
    .banner-overlay h2 { font-size: 18px; }
    .banner-overlay p { font-size: 13px; }
    .banner-link { padding: 6px 14px; font-size: 12px; }
    .banner-dots { bottom: 8px; }
    .banner-section { margin-bottom: 12px; }
    .site-intro { padding: 16px 0 8px; }
    .site-intro-title { font-size: 20px; }
}

@media (max-width: 480px) {
    .banner-slider { height: 160px; }
    .banner-overlay h2 { font-size: 16px; }
    .banner-overlay p { display: none; }
}

/* ========== 图片灯箱 ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 文章内图片可点击 */
.post-content img {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.post-content img:hover { opacity: 0.9; }

/* ========== 代码块复制按钮 ========== */
.post-content pre {
    position: relative;
    margin: 20px 0;
    padding-top: 32px;
}

.post-content pre .code-copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 12px;
    background: rgba(99,102,241,0.8);
    color: #fff;
    border: none;
    border-radius: 0 8px 0 8px;
    font-size: 12px;
    cursor: pointer;
}

.post-content pre .code-copy-btn:active {
    background: rgba(99,102,241,1);
}

.post-content pre .code-copy-btn.copied {
    background: #10b981;
}
