/* 林梦博客 v2.0 - 主样式表 */
/* 支持深色/浅色主题切换，默认跟随系统 */

/* ==================== 浅色主题（默认） ==================== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-width: 280px;
    --header-height: 60px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --code-bg: #1e293b;
    --code-color: #e2e8f0;
    --input-bg: #ffffff;
    --hover-bg: #fafafa;
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==================== 深色主题 ==================== */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --secondary-color: #94a3b8;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --border-color: #334155;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3);
    --code-bg: #0f172a;
    --code-color: #e2e8f0;
    --input-bg: #334155;
    --hover-bg: #252f47;
}

/* 系统偏好深色 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --secondary-color: #94a3b8;
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-color: #e2e8f0;
        --text-light: #94a3b8;
        --border-color: #334155;
        --success-color: #34d399;
        --warning-color: #fbbf24;
        --danger-color: #f87171;
        --shadow: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3);
        --code-bg: #0f172a;
        --code-color: #e2e8f0;
        --input-bg: #334155;
        --hover-bg: #252f47;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--theme-transition);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

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

.main-wrapper {
    display: flex;
    gap: 24px;
    padding: 24px 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* 头部 */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--theme-transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

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

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.nav {
    display: flex;
    gap: 4px;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
    background: var(--bg-color);
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--theme-transition);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* 文章列表 */
.article-item {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: var(--hover-bg);
}

.article-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-color);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

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

.article-excerpt {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 12px;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    transition: var(--theme-transition);
}

/* 文章图片画廊 */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.article-gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.article-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-gallery-item:hover img {
    transform: scale(1.05);
}

.article-gallery-more {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

/* 侧边栏组件 */
.widget {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--theme-transition);
}

.widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-body {
    padding: 20px;
}

/* 个人资料 */
.profile {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid var(--border-color);
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-desc {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* 友链 */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.link-item:hover {
    background: var(--bg-color);
}

.link-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s, background-color 0.3s;
    background: var(--input-bg);
    color: var(--text-color);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

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

.comment-item {
    display: flex;
    gap: 12px;
}

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

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

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

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-badge {
    padding: 2px 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
}

.comment-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
    word-break: break-word;
}

.comment-reply {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-left: 20px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.comment-actions button:hover {
    color: var(--primary-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding: 20px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: var(--theme-transition);
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

.page-link.active {
    background: var(--primary-color);
    color: white;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    color: var(--text-light);
}

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

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 页脚 */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 40px;
    transition: var(--theme-transition);
}

.footer-inner {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

/* 移动端菜单 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* 后台管理样式 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #1e293b;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #334155;
}

.admin-sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.admin-nav {
    padding: 16px 0;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    transition: all 0.2s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: #334155;
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    background: var(--bg-color);
    min-height: 100vh;
    transition: var(--theme-transition);
}

.admin-header {
    background: var(--card-bg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--theme-transition);
}

.admin-content {
    padding: 24px;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--theme-transition);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-card-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--hover-bg);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

/* 响应式 */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .article-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav a {
        padding: 12px 16px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .header-inner {
        padding: 0 16px;
    }
    
    .article-item {
        padding: 16px;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .article-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .article-meta {
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .comment-reply {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .main-wrapper {
        padding: 12px 0;
        gap: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .article-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 消息提示 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* 文章详情 */
.article-content {
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 24px 0 12px;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 16px;
}

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

.article-content pre {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 16px 0;
}

.article-content code {
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-light);
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

/* 文章互动按钮 */
.article-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.article-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.article-action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.article-action-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 二维码弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

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

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* 多图上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.upload-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
}

/* 分类标签 */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.category-filter a {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-color);
    color: var(--text-light);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.category-filter a:hover,
.category-filter a.active {
    background: var(--primary-color);
    color: white;
}

/* 管理后台标签页 */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.admin-tab {
    padding: 10px 20px;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-tab:hover,
.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 数据筛选 */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    width: auto;
}

/* ==================== 标签云 ==================== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
    justify-content: center;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-color);
    border-radius: 24px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.tag-cloud-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tag-cloud-count {
    font-size: 0.75rem;
    background: var(--card-bg);
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 12px;
}

.tag-cloud-item:hover .tag-cloud-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ==================== 文章归档 ==================== */
.archive-year {
    margin-bottom: 32px;
}

.archive-year-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.archive-month {
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 3px solid var(--border-color);
}

.archive-month-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.archive-count {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: normal;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--bg-color);
    transition: all 0.2s;
}

.archive-item:hover {
    background: var(--primary-color);
    color: white;
}

.archive-item-date {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 50px;
}

.archive-item:hover .archive-item-date {
    color: rgba(255,255,255,0.8);
}

.archive-item-title {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-item-views {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

.archive-item:hover .archive-item-views {
    color: rgba(255,255,255,0.8);
}

/* ==================== 评论回复表单 ==================== */
.reply-form {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-color);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 8px;
}

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

/* ==================== 返回顶部 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* ==================== 阅读进度条 ==================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    z-index: 1001;
    transition: width 0.1s;
}

/* ==================== 徽章变体 ==================== */
.badge-primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.badge-secondary {
    background: var(--bg-color);
    color: var(--text-light);
}
