/**
 * CMS系统样式 - 简约现代风格
 * 支持日间/夜间双模式
 */

/* CSS变量 - 日间模式 */
:root {
    /* 主色调 - 清新蓝绿渐变 */
    --primary-start: #00b4d8;
    --primary-end: #0077b6;
    --primary-gradient: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    
    /* 强调色 */
    --accent-start: #48cae4;
    --accent-end: #00b4d8;
    --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* 边框色 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* 状态色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition: all 0.3s ease;
}

/* 夜间模式 */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: #1e293b;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* 基础重置 */
*, *::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', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-start), var(--primary-end));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-end);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-start) var(--bg-secondary);
}

a {
    color: var(--primary-end);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-start);
}

img {
    max-width: 100%;
    height: auto;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    padding: 0 20px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-end);
    color: var(--primary-end);
}

.btn-outline:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 卡片 */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}


/* 导航栏 */
.navbar {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.navbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-brand img {
    height: 36px;
    flex-shrink: 0;
}

/* 手机端导航栏品牌名称 */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 16px;
        gap: 8px;
        max-width: 55%;
    }
    
    .navbar-brand img {
        height: 28px;
    }
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-end);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 主题切换按钮 */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--border-color);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--text-primary);
    stroke: var(--text-primary);
    stroke-width: 1;
}

/* 移动端菜单 */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 28px;
    height: 28px;
}

/* 夜间模式下确保图标可见 */
[data-theme="dark"] .theme-toggle svg,
[data-theme="dark"] .mobile-menu-btn svg {
    fill: #f1f5f9;
    stroke: #f1f5f9;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 16px;
        right: 16px;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px 0;
        gap: 0;
        box-shadow: var(--shadow-xl);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .navbar-nav.active {
        display: flex;
    }
    
    .navbar-nav li {
        list-style: none;
    }
    
    .nav-link {
        display: block;
        padding: 14px 24px;
        font-size: 15px;
        font-weight: 500;
        text-align: center;
        color: var(--text-secondary);
        position: relative;
    }
    
    /* 手机端完全移除下划线伪元素 */
    .navbar-nav .nav-link::after,
    .nav-link::after,
    .nav-link:hover::after,
    .nav-link.active::after {
        display: none !important;
        content: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    .nav-link:hover {
        color: var(--primary-start);
        background: var(--bg-secondary);
    }
    
    .nav-link.active {
        color: var(--primary-start);
        font-weight: 600;
        background: var(--bg-secondary);
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 夜间模式移动端菜单 */
[data-theme="dark"] .navbar-nav {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Hero区域 */
.hero {
    padding: 80px 0;
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    transition: var(--transition);
}

/* 夜间模式 Hero 区域 */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d1b2a 100%);
}

[data-theme="dark"] .hero .btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .hero .btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .hero .btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* 文章列表 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.article-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-decoration: none;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.article-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
}

.article-content {
    padding: 16px;
}

.article-category {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    background: var(--accent-gradient);
    color: white;
    border-radius: 20px;
    margin-bottom: 10px;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-title a:hover {
    color: var(--primary);
}

.article-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 手机端文章列表布局 */
@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        margin: 20px 0;
        padding: 0 10px;
    }
    
    .article-card {
        border-radius: var(--radius-md);
        flex-direction: column;
        align-items: center;
        padding: 12px;
        text-align: center;
    }
    
    .article-cover {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto !important;
        flex-shrink: 0;
        border-radius: var(--radius-md);
        object-fit: contain;
        object-position: center center;
        background-color: var(--bg-tertiary);
        margin-bottom: 12px;
    }
    
    /* 手机端正方形图标样式 - 如果有专门的图标则填充显示 */
    .article-cover.mobile-icon {
        object-fit: cover;
    }
    
    .article-content {
        padding: 0;
        flex: 1;
        width: 100%;
    }
    
    .article-category,
    .article-summary,
    .article-meta {
        display: none !important;
    }
    
    .article-title {
        font-size: 14px;
        margin-bottom: 0;
        -webkit-line-clamp: 2;
        line-height: 1.4;
        text-align: center;
    }
}

/* 文章详情 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-detail-header {
    text-align: center;
    margin-bottom: 40px;
}

.article-detail-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.article-detail-content {
    font-size: 16px;
    line-height: 1.8;
}

.article-detail-content h2 {
    font-size: 24px;
    margin: 32px 0 16px;
}

.article-detail-content h3 {
    font-size: 20px;
    margin: 24px 0 12px;
}

.article-detail-content p {
    margin-bottom: 16px;
}

.article-detail-content img {
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.article-detail-content pre {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 20px 0;
}

.article-detail-content code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

/* 标签 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.tag {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 20px;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary-gradient);
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.page-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.page-item:hover,
.page-item.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-widget {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-gradient);
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.category-list a:hover {
    color: var(--primary-end);
}

.category-count {
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

/* 页脚 */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary-end);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 14px;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-start);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1);
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
}

/* 投稿表单 */
.contribute-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.contribute-form .form-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.contribute-form .form-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* 消息提示 */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-end);
    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 svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* 二维码 */
.qrcode-container {
    text-align: center;
    padding: 20px;
}

.qrcode-container canvas {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .article-detail-title {
        font-size: 28px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* 分类页面 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.category-card {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
    padding: 16px 12px;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.category-cover {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 手机端双列紧凑布局 */
@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 12px 8px;
    }
    
    .category-cover {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }
    
    .category-name {
        font-size: 13px;
    }
}


/* 文章详情页 */
.article-page {
    min-height: 100vh;
    background: var(--bg-tertiary);
}

.article-hero {
    background: var(--primary-gradient);
    padding: 60px 20px 80px;
    margin-bottom: -40px;
    transition: var(--transition);
}

/* 夜间模式文章详情页 Hero */
[data-theme="dark"] .article-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d1b2a 100%);
}

.article-hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.article-category-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.article-category-tag:hover {
    background: rgba(255,255,255,0.3);
}

.article-hero-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    line-height: 1.4;
    margin-bottom: 24px;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.author-detail {
    text-align: left;
}

.author-name {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.publish-time {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.article-stats {
    display: flex;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 0 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.article-main {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
}

.article-cover-wrapper {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.article-cover-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.article-body {
    padding: 40px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
}

.article-body p {
    margin-bottom: 16px;
}

/* 图片无缝衔接 */
.article-body img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 0;
    display: block;
}

/* 包含图片的段落去除间距 */
.article-body p:has(> img) {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.article-body ul, .article-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

.article-body code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.article-body pre {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

/* 视频响应式样式 - 支持B站等iframe视频 */
.article-body iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    margin: 20px 0;
    border: none;
}

.article-body video {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 40px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.article-tags svg {
    color: var(--text-muted);
}

.tag-link {
    padding: 6px 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-link:hover {
    background: var(--primary);
    color: white;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 侧边栏 */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    border: 1px solid var(--border-light);
}

.author-card {
    text-align: center;
}

.author-avatar-lg {
    width: 72px;
    height: 72px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 28px;
    margin: 0 auto 16px;
}

.author-name-lg {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.author-bio {
    font-size: 14px;
    color: var(--text-muted);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s;
}

.related-item:hover {
    transform: translateX(4px);
}

.related-cover {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.related-cover-placeholder {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* 手机端文章头部默认隐藏 */
.article-mobile-header {
    display: none;
}

/* 文章详情页响应式 */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        display: none;
    }
    
    .article-hero {
        padding: 40px 16px 60px;
    }
    
    .article-hero-title {
        font-size: 24px;
    }
    
    .article-body {
        padding: 24px;
    }
    
    .article-tags,
    .article-actions {
        padding: 16px 24px;
    }
}

/* 手机端文章详情页 - 全新布局 */
@media (max-width: 768px) {
    /* 隐藏顶部Hero区域 */
    .article-page .article-hero {
        display: none !important;
    }
    
    /* 主内容区全屏显示 */
    .article-page .container {
        padding: 0;
        max-width: 100%;
    }
    
    .article-page .article-layout {
        gap: 0;
        margin-top: 0;
    }
    
    .article-page .article-main {
        border-radius: 0;
        box-shadow: none;
        margin-top: 0;
    }
    
    /* 手机端文章头部信息 - 简洁版 */
    .article-page .article-mobile-header {
        display: block !important;
        padding: 20px 16px;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-light);
    }
    
    /* 手机端文章页面整体上边距 */
    .article-page {
        padding-top: 20px !important;
    }
    
    .article-page .article-mobile-header .mobile-header-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }
    
    .article-page .article-mobile-header .mobile-title {
        font-size: 22px;
        font-weight: 700;
        line-height: 1.4;
        color: var(--text-primary);
        margin: 0;
        flex: 1;
    }
    
    .article-page .article-mobile-header .mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 6px 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        color: var(--text-secondary);
        font-size: 13px;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
        transition: all 0.2s;
    }
    
    .article-page .article-mobile-header .mobile-back-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }
    
    .article-page .article-mobile-header .mobile-back-btn svg {
        flex-shrink: 0;
    }
    
    .article-page .article-mobile-header .mobile-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 13px;
        color: var(--text-muted);
        flex-wrap: wrap;
        margin-top: 12px;
    }
    
    .article-page .article-mobile-header .mobile-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .article-page .article-mobile-header .mobile-category {
        padding: 3px 10px;
        background: var(--primary-gradient);
        color: white;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 500;
    }
    
    /* 封面图全宽 */
    .article-page .article-cover-wrapper {
        max-height: none;
    }
    
    .article-page .article-cover-img {
        border-radius: 0;
    }
    
    /* 内容区域 */
    .article-page .article-body {
        padding: 16px;
        font-size: 15px;
        line-height: 1.8;
    }
    
    .article-page .article-body h2 {
        font-size: 18px;
        margin: 24px 0 12px;
        padding-bottom: 8px;
    }
    
    .article-page .article-body h3 {
        font-size: 16px;
        margin: 20px 0 10px;
    }
    
    .article-page .article-body p {
        margin-bottom: 14px;
    }
    
    /* 图片无缝衔接 */
    .article-page .article-body img {
        margin: 0 -16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        border-radius: 0;
        display: block;
    }
    
    /* 连续图片之间无间距 */
    .article-page .article-body p > img {
        margin: 0 -16px;
    }
    
    .article-page .article-body p:has(> img) {
        margin: 0;
        padding: 0;
        line-height: 0;
    }
    
    /* 图片后面紧跟图片时无间距 */
    .article-page .article-body p:has(> img) + p:has(> img) {
        margin-top: 0;
    }
    
    .article-page .article-body pre {
        margin: 16px -16px;
        border-radius: 0;
        padding: 16px;
        font-size: 13px;
    }
    
    .article-page .article-body blockquote {
        margin: 16px 0;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* 视频全宽 */
    .article-page .article-body iframe,
    .article-page .article-body video {
        margin: 16px -16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        border-radius: 0;
    }
    
    /* 标签区域 - 手机端隐藏 */
    .article-page .article-tags {
        display: none !important;
    }
    
    .article-page .tag-link {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    /* 底部操作栏 */
    .article-page .article-actions {
        padding: 12px 16px;
        position: sticky;
        bottom: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-light);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .article-page .action-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}


/* 全局搜索按钮 */
.search-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.search-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary-start);
}
.search-toggle svg {
    width: 20px;
    height: 20px;
}

/* 搜索弹窗 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}
.search-overlay.show {
    display: flex;
}

.search-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: searchSlideIn 0.2s ease;
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px 16px;
}

.search-input-wrapper svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.search-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-close-btn:hover {
    background: var(--border-color);
}
.search-close-btn svg {
    width: 18px;
    height: 18px;
}

.search-modal-body {
    padding: 16px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.search-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.search-result-item {
    display: block;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.search-result-item:hover {
    background: var(--bg-secondary);
}
.search-result-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.search-result-item p {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
