/* 文章页面样式 */

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.nav-logo .company-name {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.nav-logo .company-type {
    display: block;
    font-size: 11px;
    color: #64748b;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-menu li a {
    display: block;
    padding: 10px 18px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

.btn-login {
    padding: 10px 20px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-login:hover {
    background: rgba(59, 130, 246, 0.08);
}

.btn-register {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* 用户头像下拉菜单 */
.nav-right { display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    overflow: hidden;
    transition: all 0.3s;
}
.user-avatar:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar i { color: #fff; font-size: 18px; }
.user-info { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-name { font-size: 14px; font-weight: 600; color: #1e3a5f; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 12px;
    margin-top: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}
.user-menu:hover .user-dropdown { opacity: 1; visibility: visible; margin-top: 8px; }
.user-dropdown-header { padding: 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 8px; }
.user-dropdown-header .name { font-size: 15px; font-weight: 700; color: #1e3a5f; }
.user-dropdown-header .email { font-size: 12px; color: #64748b; margin-top: 2px; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.user-dropdown-item:hover { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.user-dropdown-item i { width: 18px; text-align: center; }
.user-dropdown-item.logout { color: #ef4444; }
.user-dropdown-item.logout:hover { background: rgba(239, 68, 68, 0.1); }

.nav-toggle {
    display: none;
}

/* 主内容区 */
.main-content {
    padding-top: 100px;
    min-height: 100vh;
}

.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #cbd5e1;
}

.breadcrumb .current {
    color: #475569;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文章布局 */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* 文章主体 */
.article-main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.article-meta .category {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3b82f6;
}

.article-meta .category a {
    color: #3b82f6;
    text-decoration: none;
}

.article-meta .category a:hover {
    text-decoration: underline;
}

.article-meta .date {
    font-size: 13px;
    color: #64748b;
}

.article-meta .ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-excerpt {
    font-size: 16px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 20px;
}

.article-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #94a3b8;
}

.article-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-featured-image {
    margin-top: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 文章内容 */
.article-content {
    font-size: 16px;
    line-height: 1.9;
    color: #334155;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 40px 0 20px;
    padding-left: 16px;
    border-left: 4px solid #3b82f6;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 32px 0 16px;
}

.article-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 18px;
}

.article-content a {
    color: #3b82f6;
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 0 12px 12px 0;
    color: #475569;
    font-style: italic;
}

.article-content pre {
    margin: 24px 0;
    padding: 20px;
    background: #1e293b;
    border-radius: 12px;
    overflow-x: auto;
}

.article-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    color: #e2e8f0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.article-content th {
    background: #f8fafc;
    font-weight: 600;
}

/* 文章标签 */
.article-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.article-tags h3 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-list .tag {
    padding: 6px 14px;
    background: #f1f5f9;
    color: #3b82f6;
    font-size: 13px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.tags-list .tag:hover {
    background: #3b82f6;
    color: #fff;
}

/* 文章操作 */
.article-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.action-btn.liked {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}

/* 作者信息 */
.article-author {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
}

.author-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.author-info h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.author-info p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 12px;
}

.author-links {
    display: flex;
    gap: 12px;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.author-link:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* 侧边栏 */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
}

/* 目录 */
.table-of-contents {
    font-size: 14px;
}

.table-of-contents a {
    display: block;
    padding: 8px 0;
    color: #64748b;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
    transition: all 0.2s;
}

.table-of-contents a:hover,
.table-of-contents a.active {
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.table-of-contents a.h3 {
    padding-left: 24px;
    font-size: 13px;
}

/* 相关文章 */
.related-articles,
.popular-articles {
    list-style: none;
}

.related-article,
.popular-article {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    transition: all 0.2s;
}

.related-article:last-child,
.popular-article:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-article:hover h4,
.popular-article:hover h4 {
    color: #3b82f6;
}

.related-article-image {
    width: 80px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-article-content h4,
.popular-article-content h4 {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-meta,
.popular-article-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 10px;
}

/* 联系我们小部件 */
.contact-widget .contact-info p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.contact-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* 响应式 */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-menu,
    .nav-actions {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }
    
    .nav-toggle span {
        width: 24px;
        height: 2px;
        background: #475569;
        border-radius: 2px;
    }
    
    .article-main {
        padding: 24px;
        border-radius: 16px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-content h2 {
        font-size: 20px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .article-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .article-author {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .author-links {
        justify-content: center;
    }
}

/* 返回顶部按钮 */
.scroll-top-btn {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}
